ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
125 stars 111 forks source link

IOS push token not valid #31

Closed Eramirez06 closed 4 years ago

Eramirez06 commented 4 years ago

when i try to use this method from React Native on IOS

 ConnectyCube.pushnotifications.subscriptions.create(
      params,
      (error, response) => {
        console.log('error', error);
      },
    );

return client_identification_sequence: ["is invalid"] but i already try the the token that i sent on firebase and it work could someone help me to know what the problem is?

DaveLomber commented 4 years ago

Please post here what is inside params This will help us to identify the issue quickly

Eramirez06 commented 4 years ago

this is what is send it

device[platform]: ios
device[udid]: E53E3458-3205-411D-930E-545DBCFE32AB
notification_channels: apns
push_token[client_identification_sequence]: djmKaNIYF3A:APA91bFxhi3td6JNxyIdjsr-MhUKzrXAuKAUkS9gDUaq0eH0wHLWbT1nNA1XOaRo1kFCPT1FoBqFDZKfOneBeE_XqOpVMFGOh9g4NN-BhcGBNWWUzMv_0BwnoMiTUu1YiICZCPyPrPGR
push_token[environment]: development
DaveLomber commented 4 years ago

Your client_identification_sequence value seem invalid, as it's not in iOS APNS format

iOS device push tokens are strings with 64 hexadecimal symbols. Push token example: 03df25c845d460bcdad7802d2vf6fc1dfde97283bf75cc993eb6dca835ea2e2f

Please check it or provide a code how you are getting it

Eramirez06 commented 4 years ago

this is how i getting the push token i'm using firebase let reponse = await firebase.messaging().getToken(); and has i said i already test it on firebase the push token and it work fine i recive the push on my device

DaveLomber commented 4 years ago

Please send link to lib or guide

DaveLomber commented 4 years ago

@Eramirez06 the way why it can work is that it probably delivers it by Firebase channel, not by APNS channel

DaveLomber commented 4 years ago

Probably you need this one for IOS

https://invertase.io/oss/react-native-firebase/v6/messaging/reference/module#getAPNSToken

firebase.messaging().getAPNSToken()

Eramirez06 commented 4 years ago

cool let me a moment i will try it and the post if it works thanks

Eramirez06 commented 4 years ago

It work this is what i need, just for future implementation you should Really add this to you React Native Example o add a comment with this

for person who read this token on IOS work like this and just work in real device not in a emulator

   let response = await firebase
        .messaging()
        .ios.registerForRemoteNotifications();
      let reponse = await firebase.messaging().ios.getAPNSToken();
DaveLomber commented 4 years ago

In a case for further reference - we prepared a complete guide on how to integrate push notifications in React Native

https://developers.connectycube.com/reactnative/push-notifications