我开发了一个phonegap应用程序,我从这两个设置中收到了来自onesignal
的一些丑陋的js警报:
// Show an alert box if a notification comes in when the user is in your app.
window.plugins.OneSignal.setSubscription(true);
//activating the reception of push notification when the app is working also
window.plugins.OneSignal.enableNotificationsWhenActive(true);
我可以自定义这些,所以我使用 cordovas navigator.notification.alert
而不是普通的 js alert
。
最佳答案
是的,这可以定制。首先,您应该将enableNotificationsWhenActive 设置为 false。
接下来,按照 notificationOpenedCallback 的文档进行操作并在 isActive
为 true 时运行 navigator.notification.alert(jsonData.message)
。
关于javascript - 使用 navigator.notification.alert 代替普通的 js 警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38059375/