我在将 OneSignal 集成到我的 iOS 应用程序时遇到了问题。我按照 Ionic 指南和 OneSignal 的指南进行了操作,但出现了以下错误:
ERROR: 在与 OneSignal 注册推送期间遇到错误: Error Domain=OneSignalError Code=400 "(null)" UserInfo={returned={ errors = ( "app_id not found. You may be missing a Content-Type: application/json header." ); }}
我确定 app_id
是正确的。
请问有人能提供帮助吗?这是我的代码:
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
if(platform.is('ios')){
console.log('platform is ios using onsignail for ios');
this.oneSignal.startInit('bae0c3e1-bc4e-49ab-9274-18635XXXXX', );
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
this.oneSignal.handleNotificationReceived().subscribe(() => {
// do something when notification is received
});
this.oneSignal.handleNotificationOpened().subscribe(() => {
// do something when a notification is opened
});
this.oneSignal.endInit();
}
这是在Xcode控制台中的输出
错误:在OneSignal推送注册期间遇到错误:OneSignalError领域=错误代码=400“(null)”UserInfo = {returned={ errors = ( "app_id not found. You may be missing a Content-Type: application/json header." ); }} 2018-09-20 09:48:39.056130+0100 Baby Fashion[514:115983] 错误:在OneSignal电子邮件注册期间遇到错误:(null)
感谢您的帮助!