# iOS push notification

**URL:** <https://forums.fusetools.com/t/ios-push-notification/3235>\
**Category:** General\
**Created:** [August 17, 2017, 8:37pm UTC](https://forums.fusetools.com/t/ios-push-notification/3235 "2017-08-17T20:37:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom1](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Tom1](https://forums.fusetools.com/u/Tom1)\
**Post date:** [August 17, 2017, 8:37pm UTC](https://forums.fusetools.com/t/ios-push-notification/3235/1 "2017-08-17T20:37:48Z")

</div>

My NotificationPage.ux

```
 <Panel ux:Class="NotificationPage">
<Router ux:Dependency="router"/>
<JavaScript File="NotificationPage.js"/>
    <StackPanel>
        <Text Value="{notificationPayload}" TextColor="#fff"/>
	</StackPanel>
   </Panel>

```

My NotificationPage.js file. I did add Fuse.PushNotifications on .unoproj file. My question is why can’t I console print the device id on iOS preview?. On Android it prints but not in iOS.

```
var push = require("FuseJS/Push");
var Observable = require("FuseJS/Observable")
var notificationPayload = Observable("Payload will display here");

var push = require("FuseJS/Push");

push.on("registrationSucceeded", function(regID) {
    console.log("Reg Succeeded: " + regID);
    notificationPayload.value=regID;
});

push.on("error", function(reason) {
    console.log("Reg Failed: " + reason);
});

push.on("receivedMessage", function(payload) {
    console.log("Recieved Push Notification: " + payload);
});
module.exports={ notificationPayload }
```

---

<div class="post-metadata">

**Author:** ![Tom1](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Tom1](https://forums.fusetools.com/u/Tom1)\
**Post date:** [August 17, 2017, 10:45pm UTC](https://forums.fusetools.com/t/ios-push-notification/3235/2 "2017-08-17T22:45:42Z")

</div>

ignore the above question. How to push notification at same time in multiple devices on iOS. I did followed this github post [https://github.com/fuse-compound/Fuse.APNS](https://github.com/fuse-compound/Fuse.APNS). Android seems easy to send push on multiple devices. However, I can’t do with iOS. I have to do individually if i want to push to iOS.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [August 18, 2017, 9:27am UTC](https://forums.fusetools.com/t/ios-push-notification/3235/3 "2017-08-18T09:27:20Z")

</div>

Take a look at this repository: [https://github.com/fuse-compound/FuseExample\_Using\_APNS\_and\_Firebase\_Together](https://github.com/fuse-compound/FuseExample_Using_APNS_and_Firebase_Together)

---

<div class="post-metadata">

**Author:** ![Tom1](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Tom1](https://forums.fusetools.com/u/Tom1)\
**Post date:** [August 18, 2017, 6:28pm UTC](https://forums.fusetools.com/t/ios-push-notification/3235/4 "2017-08-18T18:28:07Z")

</div>

Hi Uldis,

I did followed the same tutorial but didn’t work. It shows only registration id (rID) on device that’s all. When I open firebase app and try sending notification. It says successful but nothing on devices. if you would like to see i can upload it into dropbox and see what wrong I did.

This is my .unoproj

```
 {
 "Packages": [
  "Fuse",
  "FuseJS",
  "Fuse.BasicTheme"
 ],
  "Projects": [
   "src/Fuse.APNS.unoproj",
  ],
  "Includes": [
    "*",
    "GoogleService-Info.plist:ObjCSource:iOS"
  ],
  "Firebase": {
   "GoogleServices": {
    "iOS": "GoogleService-Info.plist"
   }
  },
}
```

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [August 21, 2017, 12:50pm UTC](https://forums.fusetools.com/t/ios-push-notification/3235/5 "2017-08-21T12:50:26Z")

</div>

You need to make sure that you’re pushing notifications via Apple APNS server, and that you’re using the right APNS - there’s two, sandbox and production.

Firebase notifications on iOS can only be delivered to a Fuse app when the app is running in foreground; so you should be getting it in `push.on("receivedMessage", function(payload) { ...`, but the notification will not be added to the notification tray, unless you send it via APNS.

This is mostly a configuration / backend thing that has little to do with Fuse.
