How to judge the time when APP jumps to Mini Program?

1. I want to do APP jump Mini Program, APP account override Mini Program account function. But now do not know how to judge whether the jump is APP jump over, or by other ways to jump over, is there a corresponding event or method?
the 2.onLaunch lifecycle is triggered only once and does not meet the requirements. OnLoad is triggered many times, but it does not meet the requirements.
3. Now I just want to know the time when APP jumps to Mini Program, how to judge? Ask the great god for advice

Dec.25,2021

https://open.weixin.qq.com/cg.

String appId = "wxd930ea5d5a258f4f"; // AppId
IWXAPI api = WXAPIFactory.createWXAPI(context, appId);

WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req();
req.userName = "gh_d43f693ca31f"; // id
req.path = path;                  //
req.miniprogramType = WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE;//  
api.sendReq(req);

path can take parameters here. For example,

/ pages/index/index?type=app

Menu