fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
623 stars 995 forks source link

Data not received when the app is killed. #95

Open rinikaravinth opened 8 years ago

rinikaravinth commented 8 years ago

When the app is killed I get notifications sent by firebase console. But when I use REST api I can't receive notifications when the app is killed. Also the log data shows "09-01 19:59:38.896 19017-19044/in.mykard.customer D/FCMPlugin: View not ready. SAVED NOTIFICATION: javascript:FCMPlugin.onNotificationReceived({"to":"topics\/all","wasTapped":false,"notification":"{\"body\":\"Notification body\",\"title\":\"Notification title\"}","data":"{\"text\":\"New shops have been added in Desert category. Check out!\",\"type\":2}"}) "

benlooi commented 8 years ago

Seems like your notification is not in JSON, but a string. If you are using PHP, you should store $notification as an associative array.