【发布时间】:2015-07-16 02:05:30
【问题描述】:
根据 OneSignal 的网站,只需添加此代码以要求用户允许应用接收推送通知:
window.plugins.OneSignal.registerForPushNotifications();
但它没有显示出来。并且设备无法注册。
document.addEventListener("deviceready", function() {
window.plugins.OneSignal.init( "project_id",
{googleProjectNumber: "null_if_ios",
autoRegister: false},
mobile.didReceiveRemoteNotificationCallBack);
对于 Android,这很好用。无需调用 registerForNotifications 函数。
【问题讨论】: