移动端ios、安卓的home键点击事件是什么

请问移动端ios、安卓的home键点击事件是什么,这个事件怎么响应

js本身并没有对应按键这一事件的API,你看下这个方法可行不
https://blog.csdn.net/Umbrella_Um/article/details/106326183

//监听是否触发home键挂起程序.

   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillResignActive:)

                                         name:UIApplicationWillResignActiveNotification object:nil];

   

   //监听是否重新进入程序程序.

   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:)

                                         name:UIApplicationDidBecomeActiveNotification object:nil];



#pragma mark - 触发home 键

- (void)applicationWillResignActive:(NSNotification *)notification

{

   printf("触发home按下");

}



#pragma mark - 重新进入应用相应

- (void)applicationDidBecomeActive:(NSNotification *)notification

{

    printf("重新进来后响应");

}



在AppDelegate 中的方法
#pragma mark home 键出触发后 的方法

- (void)applicationDidEnterBackground:(UIApplication *)application {

   // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.

   // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

}