ostownsville / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
21 stars 17 forks source link

iOS simulator behaviour #21

Closed luigi37 closed 6 years ago

luigi37 commented 6 years ago

Hi, This is a general question about push notification on simulators... On Android simulator, the notification seems to be working as expected on a real device: if the App is in foreground, the notification gets caught by the code, if not a notification is given to the simulator. On iOS it seems that the foreground notification works but not the background one. Is that correct? Are the notification not supposed to be working on iOS simulator when app is in background? Or it's not working with this plugin for some reasons? Thanks

ironbone commented 6 years ago

For push notifications on iOS you need a real device

luigi37 commented 6 years ago

Well, that's what I thought myself but.. testing yesterday, I was able, at least with app in foreground on the simulator to get notifications...

chrisjpalmer commented 6 years ago

Yes foreground notifications work because they can be transmitted through the private Firebase channel (bypassing APNS) when APNS is not available. Essentially what is happening in this case is, Google Firebase is talking directly to the device and not using apple.

Unfortunately to get notifications working completely, you need a real device.

luigi37 commented 6 years ago

Ok, good to know because it allows me to test many things in the simulator. So to recap:

Android Simulator: Foreground Notification -> Works Background Notification -> Works

iOS Simulator: Foreground Notification -> Works Background Notification -> NO

NOTE: This is general simulators behavior (as per 20171024) and not linked to this specific plugin.