Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createFcmNotification - ServiceBusNotification-Format "gcm" vs "fcm", #44

Closed
hangryfabian opened this issue Mar 21, 2019 · 4 comments
Closed

Comments

@hangryfabian
Copy link

In a previous commit I see ServiceBusNotification-Format as "fcm", but in the recent ones it is "gcm". When I changed it to "fcm", the push notifications do not work (our client app is using FCM).

I'm not sure how this is handled by Azure Hub in the background, but the force over to FCM is in a few weeks, so just want to confirm "gcm" in the below function will still work after that date?

Thanks!

public static Notification createFcmNotifiation(String body) {
    Notification n = new Notification();
    n.body = body;
    n.contentType = ContentType.APPLICATION_JSON;
    n.headers.put("ServiceBusNotification-Format", "gcm");
    return n;
}
@amit70
Copy link

amit70 commented Apr 11, 2019

@hangryfabian Did you get the solution for the above problem statement. Even I'm facing the same issue and being forced to FCM from google.

@hangryfabian
Copy link
Author

No :(

@jvbeck
Copy link

jvbeck commented Nov 20, 2019

The C# equivalent code sends "gcm" too - thanks to line 1794 of NotificationHubClient.cs In the SendNotificationImplAsync method we have
// Convert FcmNotification into GcmNotification
notification = FcmToGcmNotificationTypeCast(notification);

Problems could be caused by FcmRegistration. This sends a GcmRegistrationDescription entity in the XML whereas the C# equivalent sends an FcmRegistrationDescription entity. However, the C# code also converts any GcmRegistrationDescription objects that it receives to FcmRegistrationDescription objects so the back-end could handle this.

@mpodwysocki
Copy link
Contributor

As noted on our ReadMe that GCM is the only valid value as FCM will throw an error as we do not fully support the FCM protocol, only the FCM-Legacy protocol via the GCM setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants