I am trying to send push notification on my iOS device with the help of FCM and ionic 3. But I'm unable to get on my device, for android it is working fine, but for iOS its not working. I'm getting device token for iOS and I've enabled push notification from xcode also. Is there any other configuration, which I'm missing between iOS and FCM?
0
votes
for iOS , you need to have Push Notification Certificate from the Developer Console and add it to the thirdparty site
– The Blue Shirt Developer
@Webruster I've already created Push Notification certificate from developer console. I've added .plist file into my root folder of project. Is there any other configuration ?
– rhl9119
if you are creating Certificate then you need to have XCODE 8 so that there you need to enable push notification, in order to avoid all these trouble give a try of OneSignal
– The Blue Shirt Developer
@Webruster Setup is working for Android. facing problem for iOS. We have uploaded all the certificates and enabled push notification in Xcode8. How to find out errors in FCM.
– rhl9119
@Webruster I'm getting {"error":"InvalidRegistration"} message from server.
– rhl9119
1 Answers
0
votes
Yes. Steps for ios FCM Integration:
- Add the GoogleService-info.plist file in to the root folder of your app.
- Add the plugin to your app following this link : https://ionicframework.com/docs/native/fcm/
- Write the necessary code
- Run command in terminal/cmd 'ionic cordova prepare'
- Open Xcode and allow the code to be indexed.
- Click on 'show project navigator' on the extreme left hand side below run button. Check the Resources Folder and click on GoogleService-info.plist. If it is empty, delete it and manually place the file again in that folder by dragging and dropping.
- Under Capabilities, ON push notifications and ON background modes> remote notifications 8 Upload p8 file on firebase console. 9 and you're done! Test your notification :)
Note: Don't forget to use actual device to test this feature. iOS Simulator doesn't support notifications.
App Crash Issue: Make sure that platforms/ios/MyApp/Resources/Resources/GoogleService-Info.plist and platforms/ios/MyApp/Resources/GoogleService-Info.plist are same and complete. An incomplete file on any of the above paths can lead to crashing of the app.