2016-04-15 14 views
0

私はONSコードベースのアンドロイドアプリケーションのOneSignalプッシュ通知を使用しています。閉鎖状態のアプリを送信するとプッシュ通知に苦労しています。 oneSignal通知サイト。 はい、プッシュ通知は、実行中の状態のアプリケーションまたはバックグラウンドのアプリ モードで正常に機能しました。私は、この問題の解決に私を助けてください アプリケーションが閉鎖状態のときに、ONSIGNALプッシュ通知が機能しない

document.addEventListener('deviceready', function() { 
 
      // Enable to debug issues. 
 
      // window.plugins.OneSignal.setLogLevel({logLevel: 4, visualLevel: 4}); 
 

 
      var notificationOpenedCallback = function(jsonData) { 
 
       console.log('didReceiveRemoteNotificationCallBack: ' + JSON.stringify(jsonData)); 
 
      }; 
 

 
      window.plugins.OneSignal.init("3......<NOT-SHARED>", 
 
       {googleProjectNumber: "963........"}, 
 
       notificationOpenedCallback); 
 

 
      // Show an alert box if a notification comes in when the user is in your app. 
 
      window.plugins.OneSignal.enableInAppAlertNotification(true); 
 
     }, false);

コードスニペットで、次の私のapp.jsに通知用のコードを追加して、私のproject.Alsoに「onesignal・コルドバ・プラグインを追加コルドバプラグイン」を追加しました。.. ありがとうございました

答えて

0

あなたのアプリが「強制停止」状態になっているようです。どのようにあなたのアプリを閉鎖していますか?最近のアプリリストから[設定]> [アプリ]の順にスワイプしてから、[強制停止]ボタンまたは他のサードパーティのタスクマネージャを押します。

プッシュ通知を送信して問題が「強制停止」状態であることを確認するときは、次のエントリの場所を確認してください。

/** 2.2 Sent notification, GCM Message payload was received by Google Play services on the device. **/ 
02-27 13:44:54.019 2630-31453/? I/GCM: GCM message com.onesignal.example 0:1456609494311032%616610ddf9fd7ecd 
/** 2.3 Google Play services couldn't wake the app as "result=CANCELLED" is in the intent callback. **/ 
02-27 13:44:54.044 2630-2630/? W/GCM-DMM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.onesignal.example (has extras) } 

https://gist.github.com/jkasten2/fb83b1df754cf26df378

関連する問題