user2724028
user2724028

Reputation: 604

GCM and FCM same project

I am working on an iOS app for an old service. And there is already an Android application using GCM. So I need to create an iOS application, but using FCM since the migration, I don't have any other choice.

Is it possible to still using GCM on Android side, and FCM for iOS ? We want to make both working without updating Android. The server is sending the notification with http request like this :

curl \
-H "Content-Type:application/json" \
-H "Authorization:key=AIzaSyfdbcYoLl-fdXp8RBNMMltD1LVzpjEbXF4N4" \
--data '{ "to": "d42peUXfDq0:APA91bEK6FKxAvgFdvnNgCBY8MHqFhWqY2E24JO-I_rlUhpkptN49dZA-vzRj6exI3OWZ7oY-PGBRsvrfdCqNCrNTfdbTVCJdm9ez6FPoqIfd5snkSdYGAZGCFdrnpTOXqwIXRtfbe0NRy","data": { "message": "message"} }' \
https://gcm-http.googleapis.com/gcm/send

The request is not working for iOS so far. Is it possible to make a request working for both GCM and FCM ?

Thanks in advance.

Upvotes: 1

Views: 536

Answers (1)

AL.
AL.

Reputation: 37778

You can make use of the FCM endpoint (https://fcm.googleapis.com/fcm/send) when sending to both. The notifications should still work like usual for the the ones using GCM.

Similar question here.

Upvotes: 2

Related Questions