How to create android notifications that vibrate and appear
See original GitHub issueI’ve got basic push notifications work on both IOS and Android (thanks!!). The IOS ones are much nicer though. I can’t seem to get android to vibrate or show the notification on screen without swiping down from the top of the home screen.
So far this payload is working in android:
notification: {"sound": "default", "icon": "new_message", "color": "#18d821"}
data: {... some other stuff}
It plays a sound and the color of the background of the icon is green. The icon doesn’t seem to display properly, but that might be something I did to the images.
I’d like to make the notification appear on screen, like in IOS. And I’d like it to vibrate. I’ve obviously read the docs but can’t find an answer. I’m wondering if this is something that has to be done natively and cannot be controlled from a notification.
Anyone managed to get Android notifications working in a similar way to IOS?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Ok, got it working. Thanks for your help. To clarify, the push message looks like this:
I had to add some stuff to my android app that I found here. Specifically:
To
app/build.gradle
:To
android/build.gradle
:classpath 'com.google.gms:google-services:1.4.0-beta3'
To
manifest.xml
:Thanks for the reply. Your suggestion didn’t work for me though. No notification and the response I get back from gcm-http.googleapis.com wasn’t even well formed (just the text “to\n” !?).