0
votes

I am new to the Firebase Cloud Message world. Following is my current App scenario. I want to know if FCM can suffice my requirement.

I have a Cordova Hybrid App for Android and iOS. I want to implement push notification to iOS. That is, i want to send push notification from FCM to my iOS device via APNS.

As per my understanding i have to do the following, please correct me if i am wrong.

  1. Upload your APNS certificate to FCM.
  2. Let the mobile device receive the Push_Token from APNS by using the Cordova PushNotification Plugin.
  3. Send this Push_Token to FCM and get back a FCM_Token.
  4. To send a Push Notification to any iOS device, make a CURL request to https://fcm.googleapis.com/fcm/send with FCM_Token and message.

If i am right about the above process, my questions are is How to perform step 1 and 3

Please Help!

1
Answer: We can use FCM for Cordova mobile apps. First get APNS token from APNS server, next exchange this token for a FCM token. Answer 1: Create iOS app inside your FCM project. Set the iOS app bundleID and once you create this, there will be an option to upload push token certificate(.p12 file). Answer 3: developers.google.com/instance-id/reference/…Amit Prabhu Parrikar

1 Answers

0
votes

You can follow the documentation on how to set ip a Firebase Cloud Messaging client app on iOS. It stated there the prerequisites, how to add Firebase to your app as well as its SDK.

For your question on how to upload your APNS certificate to FCM, it is also given here.

Upload your APNs certificate to Firebase. If you don't already have an APNs certificate, see Provisioning APNs SSL Certificates.

  1. Inside your project in the Firebase console, select the gear icon, select Project Settings, and then select the Cloud Messaging tab.
  2. Select the Upload Certificate button for your development certificate, your production certificate, or both. At least one is required.
  3. For each certificate, select the .p12 file, and provide the password, if any. Make sure the bundle ID for this certificate matches the bundle ID of your app. Select Save.

Check this Send a Notification to an iOS Device documentation.

You can also check on this Google Firebase Cloud Messaging Cordova Push Plugin. It is a plug and play push notification plugin for Cordova applications with Google Firebase FCM. For iOS, you need to put your generated file GoogleService-Info.plist in the project root folder.

Hope this helps!