0
我試圖在我的聊天應用中插入推送通知。事情是,我一直在OneSignal上發生這個錯誤:無效的Google Credentials。我敢肯定,我把正確的服務器API密鑰。在我的ionic2項目中,我把它放在了我的app.ts中:Onesignal ionic2無效的Google憑據
class MyApp {
@ViewChild(NavController) nav: NavController;
rootPage: any = Accueil;
pages: Array<{icon : string, title: string, component: any}>;
constructor(public platform: Platform, private authService : AuthService, private alertController: AlertController) {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
var notificationOpenedCallback = function(jsonData) {
console.log('didReceiveRemoteNotificationCallBack: ' + JSON.stringify(jsonData));};
window["plugins"].OneSignal.init("MTUxMDg0YjYtZmFiMS00ZTE2LTk3NmYtZWNjMjY3YTdkMDc5",
{googleProjectNumber: "220513038393"},
notificationOpenedCallback);
// Show an alert box if a notification comes in when the user is in your
// 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();
});
}
你認爲哪裏會出錯?
我的另一個問題是如何管理從我的服務器(NODE JS)發送的通知,以便用戶每次收到新消息都能收到推送通知?
我發現它:0fe7be35-7a59-4739-b97d-5bb618c45598我仍然無法看到設備上的推動 – voguendi