DEV Community

Cover image for Migrating Amazon SNS from Legacy FCM API to HTTP V1 API
Ryan Lee
Ryan Lee

Posted on • Updated on

Migrating Amazon SNS from Legacy FCM API to HTTP V1 API


On a work project, we use Amazon SNS to send push notifications to a mobile app registered with Google's Firebase Cloud Messaging (FCM). Although Google was deprecating the Legacy FCM API at that time, SNS did not yet support the new HTTP V1 API. Last weekend, I received an email from AWS that SNS now supports the new API (yay!).

Screenshot of the email


This tutorial is written based on the steps I took to migrate to the V1 API. Please adjust accordingly.

  1. Getting the Service JSON

    1. Log in to the Firebase console.
    2. Select the project that receives API calls from SNS.
    3. At the top left corner, click on the gear icon, and select Project Settings. Project Settings
    4. At the top navigation under Project Settings, pick Service accounts. Service accounts
    5. Click Generate new private key. A popup shows up reminding you to secure the key. Click *Generate key.
    6. The key should be downloaded.
  2. Uploading the Service JSON

    1. Log in to the Amazon SNS console.
    2. Select Push notifications (under Mobile) from the left side menu. Pick the appropriate platform application. Push notifications
    3. Edit the platform application. At the authentication method, pick Token (recommended). It will ask you to upload a service.json file. Pick the key downloaded previously from the Firebase console. Token authentication method
    4. Save changes.
  3. Testing

    1. At the Platform application page, click on the link of an endpoint from the list below. At the top right-hand corner, click Publish message.
    2. At the Message body section, pick Custom payload and input the GCM message payload according to your platform (mine is Android). Message body and custom payload
    3. Check the app for notifications. Push notification received
    4. To verify that it is using the new API, go back to the Firebase console Service accounts tab (refer to step 1.4). Click Manage service account permissions at the top-right-hand corner.
    5. At the Service accounts management page, locate the account associated with Firebase Admin SDK. Click the dots menu under Action" on the right, and pick View metrics. View metrics
    6. Verify there were actions when the message was being sent. Metrics


The migration is now complete. You may have to update the message payload to the new message format. Start exploring the multiplatform messaging capability now!

Extended reading

Top comments (0)