离子 - OneSignal 在 iOS 13.x 上不起作用



我的 ionic 3 应用程序和 OneSignal 有问题。

该应用程序在Android版本和iOS版本12.x上运行良好,但在iOS 13.*中没有任何反应。

在 OneSignal 仪表板中查看未注册的设备。我也没有在我的应用程序中获取玩家 ID(调用 getIds(( 方法(。

app.component.ts:

constructor(platform: Platform, 
statusBar: StatusBar, 
private oneSignal: OneSignal,
public api: ApirestProvider,
private alertCtrl: AlertController,
splashScreen: SplashScreen) {
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
this.handlerNotifications();
});
}
private handlerNotifications(){
this.oneSignal.startInit('xxxxxxxxxxxxxxxxxxxxxxxxxx', 'xxxxxxxxxxxxx');
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.Notification);
this.oneSignal.handleNotificationOpened()
.subscribe(jsonData => {
let alert = this.alertCtrl.create({
title: jsonData.notification.payload.title,
subTitle: jsonData.notification.payload.body,
buttons: ['OK']
});
alert.present();
});
this.oneSignal.getIds().then(identity => {
console.log("Player ID:" + identity.userId);
this.api.player_id=identity.userId;
}).catch(err => {
this.api.showMsg("Error en getIds():" + err);
}); 
this.oneSignal.endInit();
}

离子信息:

Ionic:
Ionic CLI          : 5.4.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework    : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.1
Cordova:
Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : ios 4.5.5
Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 14 other plugins)
Utility:
cordova-res : not installed
native-run  : not installed
System:
NodeJS : v10.16.3 (/usr/local/bin/node)
npm    : 6.9.0
OS     : macOS Mojave
Xcode  : Xcode 11.2.1 Build version 11B500

科尔多瓦插件列表:

cordova-open-native-settings 1.5.2 "Native settings"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-advanced-http 2.0.2 "Advanced HTTP plugin"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-email-composer 0.9.1 "EmailComposer"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.4.6 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.3.1 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
mx.ferreyra.callnumber 0.0.2 "Cordova Call Number Plugin"
onesignal-cordova-plugin 2.4.6 "OneSignal Push Notifications"

在XCODE iPhone模拟器(目标iOS 13.2.2/iPhone 11(上运行项目工作正常,进行订阅并获取播放器ID。

它只是不适用于真实设备 iPhone 13.x。

有什么建议吗?

最佳 Rgs

使用2.6.0或更高版本更新您的onesignal插件,那么它在iOS 13中工作正常。

最新更新