locked
Unable to send message with FCM notification format RRS feed

  • Question

  • I'm trying to send FCM notification through Microsoft.Azure.NotificationHubs.NotificationHubClient in new format, but notification target platform become GCM any way.

    GCM format is now deprecated and we'd like to migrate our application to FCM format. Is it possible to send such notifications.

    And what should i do if it is?

    Friday, November 15, 2019 11:17 AM

All replies

  • Hello Deadoc, 

    Thanks for reaching out to us. Apologize for the delay here. 

    Yes, You should still be able to send notifications. 

    Please go through the below article for more information regarding the same. 

    Send Push Notifications

    I hope this information helps. 

    Please feel free to revert back to me if you have any further questions. 


    Tuesday, November 19, 2019 5:42 PM
  • Hello Monika,

    we able to send notifications, but mobile device receive notification in GCM old format.

    Old format is

    {
      "to": "/topics/news",
      "notification": {
        "title": "Breaking News",
        "body": "New news story available."
      },
      "data": {
        "story_id": "story_12345"
      }
    }

    New format is

    {
      "message": {
        "topic": "news",
        "notification": {
          "title": "Breaking News",
          "body": "New news story available."
        },
        "data": {
          "story_id": "story_12345"
        }
      }
    }

    https://firebase.google.com/docs/cloud-messaging/migrate-v1

    We use NotificationHubClient from Microsoft.Azure.NotificationHubs nuget package to send notification.

    And see TargetPlatform gcm in NotificationDetails received from azure.

    May be exists some way to switch notification format in azure hub?

    Wednesday, November 20, 2019 2:56 PM
  • Hello Deadoc, 

    Have you registered GCM and FCM in different hubs? Sorry, I didnt mention that in earlier post.

    If not, that might be the problem why it is still going to GCM Old Format. 

    Since the libraries of GCM and FCM are different, you need to use 2 different hubs , so there is no way to switch the notifications registered information (reg ID, token, tag, etc.) from GCM to FCM, you need register the device on both the hubs.

    You also need to update FCM Key under the Google (GCM) in Azure Portal. 

    Please refere to this doc for more info : Azure Notification Hubs

     

    I hope this information helps. 

    -------------------

    Please Do "Mark as Answer" and Upvote on the post that helped you answer your question, So it will be beneficial for other community members. 

    Wednesday, November 20, 2019 3:19 PM
  • Hello Monika,

    we try to use manual that you provide in first answer, unfortunately, we receive 403 The maximum number of devices has been reached or exceeded for the namespace on NotificationHub.register(FCM_token).

    And the same error when try to register device through NotificationHubClient.CreateFcmNativeRegistrationAsync() C# dot net.

    Hub is newly created and have no devices yet.

    But we are able to create installation through CreateOrUpdateInstallation why is it so?

    Thursday, November 21, 2019 8:29 AM
  • Hello Deadoc, 

    We might need to investigate this issue further with you offline. 

    Can you please send us an email to AzCommunity@Microsoft.com and provide the below details

    Subject: ATTN: Monika

    •  Can you share the Notification Hub Namespace 
    • Notification Hub Name 
    • And Exact time frame in UTC.
    • Subscription ID

    Please send the above details in the email and we will investigate it further and post any findings we may get in this post to help the community.

    I hope this information helps. 

    Looking forward for your email. 

    Thursday, November 21, 2019 5:08 PM