Skip to content

Instantly share code, notes, and snippets.

@WengerK
Last active June 24, 2020 10:44
Show Gist options
  • Save WengerK/b8e32d617d730877c09a6cf377bd5c26 to your computer and use it in GitHub Desktop.
Save WengerK/b8e32d617d730877c09a6cf377bd5c26 to your computer and use it in GitHub Desktop.
Implementation of push notification thought Firebase Cloud Messaging using Ionic

Article Ressources - Implementation of push notification thought Firebase Cloud Messaging using Ionic !

This is the Gist repository for my article Implementation of push notification thought Firebase Cloud Messaging using Ionic.

Be aware that this article has been wrote for the Blog of Antistatique — Web Agency in Lausanne, Switzerland. A place where I work as Full Stack Web Developer.

Feel free to read it the full article on Medium or check it out on Antistatique.

Content of this Gist :

  • android_custom_resources.js : Example of resourceDirs
  • cURL : cURL example for Google FCM
var resourceDirs = [
'res/drawable-land-ldpi',
'res/drawable-land-mdpi',
'res/drawable-land-hdpi',
'res/drawable-land-xhdpi',
'res/drawable-land-xxhdpi',
'res/drawable-land-xxxhdpi',
'res/drawable-port-ldpi',
'res/drawable-port-mdpi',
'res/drawable-port-hdpi',
'res/drawable-port-xhdpi',
'res/drawable-port-xxhdpi',
'res/drawable-port-xxxhdpi',
'res/mipmap-ldpi',
'res/mipmap-mdpi',
'res/mipmap-hdpi',
'res/mipmap-xhdpi',
'res/mipmap-xxhdpi',
'res/mipmap-xxxhdpi'
];
curl -X POST \
https://fcm.googleapis.com/fcm/send \
-H 'authorization: key=YOUR-FIREBASE-SERVER-KEY' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"to": "/topics/all",
"notification": {
"title": "Hello World!",
"body": "Proin rutrum, nunc vitae porta volutpat, mi nibh.",
"icon": "fcm_push_icon",
"color": "#F79838",
"sound":"default"
},
"priority": "high",
"click_action":"FCM_PLUGIN_ACTIVITY"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment