Show Menu
TOPICS×

Configure your app to use APNS or FCM

You can configure your app to use Apple Push Notification Service (APNS) or Firebase Cloud Messaging (FCM).

Android Apps

If FCM is not enabled in your app

To configure your Android app to use FCM in this scenario:
  1. Go to https://firebase.google.com/ and log in with your Google Dev credentials.
  2. Click Get Started and select Add Project .
  3. Enter a project name and if opting in to Google Analytics for Firebase data, click the checkbox accepting the controller-controller terms.
  4. Click Create project and wait for the project to be created.
  5. Click on the created project and the Project Overview page for the created project should be shown. Click the button with the Android icon to add an Android app to the project.
  6. Enter the app package name, app nickname, and signing certificate if needed.
  7. Follow the additional steps suggested by the setup wizard. After verifying the Firebase setup by testing communication with the Firebase servers, return to the Project Overview page.
  8. Click the gear icon to the right of the Project Overview button and click Project Settings .
  9. Click the Cloud Messaging tab.
  10. Copy the Legacy server key and Sender ID for later use.
    For example:
    - Legacy server key = AIzaSyC6FNgsCOpBL5eXhDvwf8979mWba6x7Roo
    
    
    - Sender ID = 835015092250
    
    

If FCM is enabled in your app

To configure your Android app to use FCM in this scenario:
  1. Go to https://firebase.google.com/ and log in with your Google Dev credentials.
  2. Click Get Started . This will open the project index page. Find the Firebase enabled project which is linked to your Android app and click the project card.
  3. The Project Overview for the project should then be loaded. Click the gear icon to the right of the Project Overview button and click Project Settings .
  4. Click the Cloud Messaging tab.
  5. Copy the Legacy server key and Sender ID for later use.
    For example:
    - Legacy server key = AIzaSyC6FNgsCOpBL5eXhDvwf8979mWba6x7Roo
    
    
    - Sender ID = 835015092250
    
    

iOS apps

To configure your iOS app to use APNS:
  1. Under iOS Apps , select Identifiers .
  2. If you have an App ID set up for push, go to Step 11.
  3. Press the + button to create a new App ID.
  4. Type an App ID Description.
  5. Type an App ID Suffix.
    To support push, you must use an Explicit App ID that does not use a wild card (for example, - com.tester.pushSample ).
  6. Under App Services , select the Push Notifications check box.
  7. Click Continue .
  8. Click Submit .
  9. Click Done .
  10. Select your App ID that is set up to use push messaging from the list and click Edit .
  11. If you already have a Push Certificate created, skip to Step 15.
  12. Scroll down to Push Notifications and click the correct Create Certificate... button.
    The button you click depends whether you are creating a certificate for Development or Production.
  13. Follow the steps on how to create your CSR on Apple's website, upload the CSR, and generate your certificate.
  14. Scroll down to the Push Notifications section and download the SSL certificate you just created.
  15. Double-click the downloaded certificate to add it to your keychain.

SSL certificate and private keys

To get your SSL certificate and private key (APNS):
  1. Open Keychain Access .
  2. Click My Certificates and find the appropriate iOS Push Services Certificate for your app and environment.
    You can identify the correct certificate by matching the bundle ID and whether it is Development or Production.
  3. Expand the certificate and verify that it contains a private key.
  4. Right-click the private key and select Export " *`<name of key>`* .
  5. Type the necessary information in the dialog box and save your new .p12 file.
    You do not have to type a password.
  6. In the Private Key , type the .p12 file.