Closed rdac2012 closed 1 year ago
I got the same issues as you. Does any help please?
maybe you can try to set a push type with Payload setPushType method?
I'm also receiving the same thing when setting $payload->setPushType('voip')
. It appears to be VoIP push type related but I'm not sure what I'm missing? I see the same error, and the error description returned is
The device token does not match the specified topic
I'm also receiving the same thing when setting
$payload->setPushType('voip')
. It appears to be VoIP push type related but I'm not sure what I'm missing? I see the same error, and the error description returned isThe device token does not match the specified topic
Just to answer my own question, and hopefully help others, the problem was related to the device token. I was using rn firebase messaging().getAPNSToken()
which returns a standard push token.
The solution was to use https://github.com/react-native-webrtc/react-native-voip-push-notification to get a proper VoIP push token. After this our backend API was able to send the push notification successfully.
DeviceTokenNotForTopic
usually means the device token used is not related to the bundle id. In my case I had a typo in the bundle id.
I followed the steps on how to provide the right value in the
$options
array in which I cannot disclose here.When I tried to dump the variables in the following code:
Here is what I'm getting:
I would like to ask or seek help on why I am getting the
HTTP400
DeviceTokenNotForTopic
error though I think the provided values in the$options
array are correct?Also, I just discovered that when I change the value of the second parameter of $client from this:
to this
I am getting the
BadDeviceToken
HTTP400
error:Thanks in advance.