# Push Notification - communication with a server

**URL:** <https://forum.ionicframework.com/t/push-notification-communication-with-a-server/66776>\
**Category:** ionic-v3\
**Created:** [October 13, 2016, 10:12am UTC](https://forum.ionicframework.com/t/push-notification-communication-with-a-server/66776 "2016-10-13T10:12:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![XNN](https://avatars.discourse-cdn.com/v4/letter/x/b9e5f3/32.png) [@XNN](https://forum.ionicframework.com/u/XNN)\
**Post date:** [October 13, 2016, 10:12am UTC](https://forum.ionicframework.com/t/push-notification-communication-with-a-server/66776/1 "2016-10-13T10:12:38Z")

</div>

Hello!

I’m trying Push Notification. I did the tutorial from Ionic 2: [http://docs.ionic.io/services/push/](http://docs.ionic.io/services/push/)

All worked perfectly, I succeeded to get my device token and I was able to send Push Notification with the service from Ionic. But what next now? For example, when a button is clicked in the application, I would like that the application sends a request to a server such that it send to the smartphone a notification. I read several tutorials on Internet but most of them seem outdated (or maybe it is just me who was not able to understand correctly the tuto…). For example, I was thinking to do that:

> ```
> var req = {
> method: 'POST',
> url: 'https://api.ionic.io/push/notifications',
> headers: {
> 'Content-Type': 'application/json',
> 'Authorization': 'Bearer ' + this.APItoken
> },
> data: {
> "tokens": 'My_token',
> "profile": 'test',
> "notification": {
> "title": this.titlePush,
> "message": this.messagePush,
> "android": {
> "iconColor": "#ee9425",
> //"stack": 3,
> "title": this.titlePush,
> "message": this.messagePush
> },
> "ios": {
> "title": this.titlePush,
> "message": this.messagePush
> }
> }
> }
> };
> 
> ```

But is that correct? If yes, where am I suppose to write that in my code? How to use it in practice? Maybe with Http? How?
