# How to implement Google Cloud Messaging with ionic

**URL:** <https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543>\
**Category:** ionic-v1\
**Created:** [November 7, 2015, 1:45pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543 "2015-11-07T13:45:24Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![1fabiopereira](https://avatars.discourse-cdn.com/v4/letter/1/f19dbf/32.png) [@1fabiopereira](https://forum.ionicframework.com/u/1fabiopereira)\
**Post date:** [November 7, 2015, 1:45pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/1 "2015-11-07T13:45:24Z")

</div>

Hello everybody, I wonder if anyone knows of any tutorials on how to implement Google Cloud Messaging with ionic, I need something stable that it can go to production, Push ionic works but is still alfa is very risky to put into production, if anyone knows how to use the GCM or any tutorial that can help me I am grateful.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 7, 2015, 1:48pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/2 "2015-11-07T13:48:09Z")

</div>

You can actually use Ionic Push in your app, but send the push messages using any other push service (or even manually via GCM). This way you don’t depend on the Ionic Push service (backend), but can use the great library in your app.

---

<div class="post-metadata">

**Author:** ![1fabiopereira](https://avatars.discourse-cdn.com/v4/letter/1/f19dbf/32.png) [@1fabiopereira](https://forum.ionicframework.com/u/1fabiopereira)\
**Post date:** [November 7, 2015, 2:25pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/3 "2015-11-07T14:25:22Z")

</div>

And how can I use the GCM to send the message and take with the ionic push this would be what I consider the most interesting for my app

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 7, 2015, 3:42pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/4 "2015-11-07T15:42:03Z")

</div>

You build your app using Ionic Push - everything like it is in the docs. You can also use the web interface to send the first pushes.

Later, when you don’t trust Ionic Push any more you can use any other push service that can push to push tokens directly or use one of the many push servers that connect directly to GCM to do this.

---

<div class="post-metadata">

**Author:** ![1fabiopereira](https://avatars.discourse-cdn.com/v4/letter/1/f19dbf/32.png) [@1fabiopereira](https://forum.ionicframework.com/u/1fabiopereira)\
**Post date:** [November 7, 2015, 6:12pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/5 "2015-11-07T18:12:46Z")

</div>

I 've done THIS IS NOT no However Working When the application IS Closed.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 7, 2015, 6:14pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/6 "2015-11-07T18:14:57Z")

</div>

Sorry, I don’t understand what you want to say. What is not working when? What would be the expected result?

---

<div class="post-metadata">

**Author:** ![1fabiopereira](https://avatars.discourse-cdn.com/v4/letter/1/f19dbf/32.png) [@1fabiopereira](https://forum.ionicframework.com/u/1fabiopereira)\
**Post date:** [November 7, 2015, 6:16pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/7 "2015-11-07T18:16:12Z")

</div>

The work fot notification if the application is open, if I close it and try to send the notification it not to receive.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 7, 2015, 6:18pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/8 "2015-11-07T18:18:32Z")

</div>

- Ok, so what did you actually implement in your app? Ionic Push?
- Is your app in development mode? (dev\_push = true)  
[http://docs.ionic.io/docs/push-from-scratch#section-4-put-your-app-in-development-mode](http://docs.ionic.io/docs/push-from-scratch#section-4-put-your-app-in-development-mode)
- How are you sending the push notificiation?
- What would be the expected result when the app is closed?

---

<div class="post-metadata">

**Author:** ![1fabiopereira](https://avatars.discourse-cdn.com/v4/letter/1/f19dbf/32.png) [@1fabiopereira](https://forum.ionicframework.com/u/1fabiopereira)\
**Post date:** [November 7, 2015, 6:24pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/9 "2015-11-07T18:24:27Z")

</div>

yes I will use ionic Push,  
Yes my app is enabled in mode of development,  
For now I’m using ionic CLI to send notifications ,  
I hope that when I send a notification and the application is closed the notification appears on the screen of the application , and this is not occurring

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 7, 2015, 7:03pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/10 "2015-11-07T19:03:36Z")

</div>

> [@1fabiopereira](#):
>
> Yes my app is enabled in mode of development,

Then I quote this from the documentation:

> Development pushes aren’t native push notifications, and are meant for testing against our API. They’ll work in a browser or emulator, but **won’t arrive when your app is minimized** , and the tokens won’t last more than 2 hours.

---

<div class="post-metadata">

**Author:** ![1fabiopereira](https://avatars.discourse-cdn.com/v4/letter/1/f19dbf/32.png) [@1fabiopereira](https://forum.ionicframework.com/u/1fabiopereira)\
**Post date:** [November 7, 2015, 7:37pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/11 "2015-11-07T19:37:23Z")

</div>

so how can I develop something resembling the native push

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 7, 2015, 8:15pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/12 "2015-11-07T20:15:13Z")

</div>

Turn off dev\_push - then it is native.

---

<div class="post-metadata">

**Author:** ![1fabiopereira](https://avatars.discourse-cdn.com/v4/letter/1/f19dbf/32.png) [@1fabiopereira](https://forum.ionicframework.com/u/1fabiopereira)\
**Post date:** [November 7, 2015, 8:17pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/13 "2015-11-07T20:17:00Z")

</div>

Thanks for help, work 🙂

---

<div class="post-metadata">

**Author:** ![ehabahmed](https://avatars.discourse-cdn.com/v4/letter/e/5fc32e/32.png) [@ehabahmed](https://forum.ionicframework.com/u/ehabahmed)\
**Post date:** [April 13, 2016, 11:19am UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/14 "2016-04-13T11:19:56Z")

</div>

I did many trials to did it but there are no output? how I can send notifications to more than one device at same time  
?

---

<div class="post-metadata">

**Author:** ![1fabiopereira](https://avatars.discourse-cdn.com/v4/letter/1/f19dbf/32.png) [@1fabiopereira](https://forum.ionicframework.com/u/1fabiopereira)\
**Post date:** [September 2, 2016, 6:48pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/15 "2016-09-02T18:48:50Z")

</div>

Google moved the GCM for the FCM is to send eviar push to several devices at the same time enough:

> ionic plugin add cordova-plugin-inappbrowser  
> ionic plugin add cordova-plugin-fcm  
> ionic plugin add cordova-plugin-velda-devicefeedback

And go to [Firebase Console](https://firebase.google.com/)

Create New Project  
Add a Name to your project  
Select which platform you like (ios/android)  
Add your Package Name which is the id of your app, (you can see it in your config.xml something like id=“com.ionicframework.someTest123”) It will give you a file google-services.json  
Paste it in the platforms/android/ directory  
Then run ionic build android on your CLI  
And you can now go to Notifications Page \> New Message Make sure to select the app (id of the app) you added before sending push notification.

---

<div class="post-metadata">

**Author:** ![firaskudsy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/firaskudsy/32/78221_2.png) [@firaskudsy](https://forum.ionicframework.com/u/firaskudsy)\
**Post date:** [January 20, 2017, 5:32pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/16 "2017-01-20T17:32:51Z")

</div>

works on android, but on ios, no notification received !!??

---

<div class="post-metadata">

**Author:** ![1fabiopereira](https://avatars.discourse-cdn.com/v4/letter/1/f19dbf/32.png) [@1fabiopereira](https://forum.ionicframework.com/u/1fabiopereira)\
**Post date:** [February 3, 2017, 5:00pm UTC](https://forum.ionicframework.com/t/how-to-implement-google-cloud-messaging-with-ionic/36543/17 "2017-02-03T17:00:58Z")

</div>

Hello, it’s work on android and IOS [https://github.com/1fabiopereira/cordova-plugin-fcm](https://github.com/1fabiopereira/cordova-plugin-fcm)
