Open mattheworiordan opened 5 years ago
I would like to test this by myself and see if it really works and then write a conclusion about it.
iOS: https://support.ably.io/solution/articles/3000089745
Android register with FCM: https://support.ably.io/solution/articles/3000089746
Just seen @ricardopereira 's comment, I'll make these drafts for now, once we're certain they work we can publish.
@tomczoink Sorry, those links doesn't open for me. Are they private?
@ricardopereira I've published them to make sure you can see them.
I did some experiments and now I understand how Firebase FCM works.
First of all, the code I gave you won't work because, at least in iOS, all actions will use the local device. That local device is generated automatically and it's expecting an APNS DeviceToken. So, i.e., it will always use the local device when the user subscribe to a channel (the request requires device authentication).
Even so, from the project I built and what I read from the Firebase FCM documentation, this particular issue doesn't make sense to me. Why does the user wants to assign a FCM registrationToken to Ably Device? Does the client want to use Firebase FCM and Ably Push at the same time? If that's the case then there's no problem while working with the two of them at the same time. I tested it by myself. So you can receive messages with notifications using Firebase and you can receive Ably channel notifications.
Here is a basic and possible setup that I did with Ably and Firebase FCM working together.
Please have in mind, in iOS, if you want to send a notification to a specific device, then you need the APNS DeviceToken. In Android you use the FCM RegistrationToken. You can have a RegistrationToken using Firebase FCM iOS SDK and that FCM.RegistrationToken
is like our Ably.LocalDevice.id
. The LocalDevice.id
is always related with the APNS DeviceToken and so do the Firebase. Ably doesn't need to know the iOS FCM RegistrationToken because Ably as already all the needed data to send push notifications to the related device.
This is from internal chats.
We need to:
On iOS
And the client has the responsibility of saving the device details because, currently, the local device is always assuming APNS
On Android
There's a customer there who is asking if they can do push device registration using fcm (ie not apns)
it ought to be possible I think if they do
push.deviceRegistrations.save(localDevice) if they set the
recipientdetails -
transportType=fcmand
registrationToken=xx`┆Issue is synchronized with this Jira Task by Unito