以下のリファレンスを見てreproからpush通知を送ってみたのですが
動作しません。
具体的には pushNotification.on('registration'イベントは呼ばれていることを確認して
reproからpushを送ったときにpushNotification.on('notification', function (data) {まで呼ばれていることを確認しました。
しかしnotificationのdataがundifinedになっていてメッセージが来ていないことがわかります
pushイベントは来ているのに通知バーには通知は表示されない状況です
アプリがフォアグラウンドの時にはnotificationが呼ばれてalertは表示されます
原因などご存知の方ご教示ください
http://docs.repro.io/ja/dev/sdk/push-notification/monaca.html#id3
function onDeviceReady() { // リプロ処理 if (typeof Repro != "undefined") { // Setup Repro Repro.setup("id"); // Start Recording Repro.startRecording(); // For iOS var pushNotification = PushNotification.init({ "android": { "senderID": "senderid" }, "ios": { "alert": "true", "badge": "true", "sound": "true" } }); pushNotification.on('registration', function (result) { Repro.setPushDeviceToken(result.registrationId); console.log("push登録"); }); pushNotification.on('notification', function (data) { alert(JSON.stringify(data)) }); pushNotification.on('error', function (error) { console.log("エラー"); console.log(error); }); // For Android Repro.enablePushNotification("senderid"); }
あなたの回答
tips
プレビュー