Closed gwenoleR closed 3 years ago
It's totally fine to use 'react-native-firebase' here
Please refer to general push notifications guide https://developers.connectycube.com/reactnative/push-notifications
and also there is a tiny section regarding 'react-native-firebase' at the bottom https://developers.connectycube.com/reactnative/push-notifications?id=react-native-firebase-lib
So basically you have to use firebase.messaging().getAPNSToken()
for iOS as a token
And also please use notification_channel: Platform.OS === 'ios' ? 'apns' : 'gcm',
For android you should pass gcm
even if you use Firebase token
Hum, this is what I thought in the first place, but when I tried it, it was not working :(
I can see in the dashboard the new device subscription on APNS
, but when i try to send notifications I have this error "No one can receive the message"
Here, the method to send the push. I remove the voip parameters because I not subscribe to APNS_VOIP
const payload = JSON.stringify({
uuid: this.callSession.ID,
callerName: currentUserName,
handle: currentUserName,
hasVideo: this.callSession.callType === 1 ? '1' : '0',
ios_badge: 1,
// ios_voip: 1,
})
const pushParameters = {
notification_type: 'push',
user: { ids: [ccUserId] }, // recipients.
environment: 'development',
message: ConnectyCube.pushnotifications.base64Encode(payload),
}
ConnectyCube.pushnotifications.events
.create(pushParameters)
Make sure you have same 'environment' value when create push subscription and when send an event
Unfortunatly, I double check, but this the same environment
value :(
Ok this is fine
Then check also user id you send a push to
There not many cases where it can throw the mentioned error
Either you send to a wrong user( w/o push subscription) or environment is diff
Only these 2
I also check this 2,
I tried to send a push notification to user 3754019
on development
environment
And this user have an APNS
subscription
and this subscription is in development
environment
@gwenoleR we have checked the provided information and everything looks good - no reason for it to not to work
We are investigating the case more at your side
Ok, thanks @DaveLomber
If you need any informations I would be glad to help
Hey @DaveLomber, any news ?
@gwenoleR I finally was able to get the root cause
In terms of push subscriptions, everything is ok, a user has a proper subscription
But
We checked an iOS push certificate which you uploaded to Admin Panel and it says it's for APNS VOIP only , not a universal one. That's why the request is failing.
Please generate a universal iOS push certificate, which will cover normals pushes (dev+prod) plus voip pushes.
The guide is a bit outdated https://developers.connectycube.com/ios/how-to-create-apns-certificate but it shows the flow re how to do it
@DaveLomber, thanks for your help.
You're right, with the good certificate the notification is send without error on iOS. But still, the firebase library doesn't fire any received event from your notification, strange.
I use now apns_voip, it seems to work fine with the react-native-voip-push-notification
library
@gwenoleR Google Firebase does not support iOS VOIP by itself
Hence using a react-native-voip-push-notification
library is a right way
Yeah I know, but i was trying with the apns
type. Anyway, I didn't look why it didn't works because it's better to use the Voip Push :)
Hi there !
I'm working on an implementation of Video Call in my current app and i have a question concerning the Push Notifications.
I saw on the doc than to receive notifications on iOS I have to subscribe to APNS notifications. But in my app, I already have FCM using react-native-firebase, and I don't want to integrate another library to receive push directly from APNS.
It should by nice if on iOS we can subscribe to FCM, something like that:
Or maybe I missed something on the doc ?