5***@qq.com
5***@qq.com
  • 发布:2020-06-11 16:18
  • 更新:2020-07-28 14:33
  • 阅读:1489

IOS跳出系统之后进入消息通知设置页面。怎么监听左上角返回按钮了

分类:Native.js

我点击开启消息推送。跳转到ios的设置页面。我如何可以监听左上角的按钮了。andriod有startActivityForResult可以监听。但是ios不知道要怎么编写
看到有大神写的

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(endBackground) name:UIApplicationWillEnterForegroundNotification object:nil];

即可监听点击了系统返回方法

但是我要怎么转化为njs的代码方式了?

2020-06-11 16:18 负责人:无 分享
已邀请:
9***@qq.com

9***@qq.com

document.addEventListener('plusready', function(){
if (plus.os.name === 'iOS') {
var NSNotificationCenterClass = plus.ios.importClass("NSNotificationCenter");
var NSNotificationCenterObj = NSNotificationCenterClass.defaultCenter();
plus.ios.invoke(NSNotificationCenterObj, "addObserverForName:object:queue:usingBlock:", "UIApplicationWillEnterForegroundNotification", null, null, function() {
mui.toast("返回到App界面");
console.log('返回到App界面');
});
}
});

  • shawnji

    可以接收到通知的传参吗

    2022-10-25 12:59

该问题目前已经被锁定, 无法添加新回复