looking for some solutions? You are welcome.

SOLVED: Phonegap / Cordova Push Notification not waking up screen


I've been doing some research and android seems a bit stricter on waking up screen (light up device screen) when push notification is received.

What I would like to achieve is like a text message notification that it would turn on the screen, sound and vibrate. But my push notification only chime or vibrate. Is waking up the device from sleeping possible in cordova? I am using pubnub for the backend.

Here's my sample fcm payload: var pushPayload = { "message": "Some message", "user_id": "1", "pn_gcm" : { "priority" : "high", "data" : { "title":"Notification title", "body":"You are a winner!", "room" : "Room name", //"count" : 5, "content-available":"1", "force-start": "1", "priority":2 } }

And here's my piece of AndroidManifest.xml <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.VIBRATE" />

I am using phonegap-plugin-push.

Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots

No comments: