gpt4 book ai didi

xcode - 错误 : Encountered error during push registration with OneSignal: Error Domain=OneSignalError Code=400 "

转载 作者:行者123 更新时间:2023-12-02 11:21:18 25 4
gpt4 key购买 nike

我在将一个信号集成到我的 iOS 应用程序时遇到了问题
我遵循了 ionic 指南和单一信号中的每一件事
但收到此错误

ERROR: Encountered error during push registration with 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 控制台中的输出

ERROR: Encountered error during push registration with OneSignal: Error Domain=OneSignalError Code=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] ERROR: Encountered error during email registration with OneSignal: (null)



感谢您的帮助

最佳答案

您需要尽快启动 OneSignal,否则当应用程序尝试使用 ios 挂接插件时它不会提供 app_id 并且它会抛出错误。

你在 platform.ready 里面有代码方法因此 oneSignal 在插件尝试 Hook 时需要时间来初始化。

您还需要设置 firebase 项目 ID 以启用 Android 应用的推送通知。

关于xcode - 错误 : Encountered error during push registration with OneSignal: Error Domain=OneSignalError Code=400 ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52421230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com