react-native-webrtc / react-native-voip-push-notification

React Native VoIP Push Notification - Currently iOS only
ISC License
213 stars 83 forks source link

VoIP token is different from PushNotificationIOS token? #31

Closed krajay015 closed 4 years ago

krajay015 commented 5 years ago

I'm trying to get VoIP notification using RN-VoIP-PN library so I've generated my VoIP token using following method:

VoipPushNotification.addEventListener('register', token => {
   console.log('VOIP TOKEN: ', token)
})

but my VoIP token was getting rejected by APN server saying that it's an invalid token. After seeing this I've tried using PushNotificationIOS for token and generated a token using the following code:

 PushNotificationIOS.addEventListener('notification', (token)=>{
        console.log('PushNotificationIOS token: ', token)
      })

and surprisingly this token was different from VoipPushNotification generated token and my APN server accepted this token. There are multiple questions that I want to clarify

  1. Why both tokens are different even VoipPushNotification used PushNotificationIOS to generate there token?
  2. What's the difference between VoIP token and normal token? Can I use a normal token using the second method only?

Thanks in advance

anhtukhtn commented 5 years ago
  1. PushKit and PushNotificaiton will generate 2 separate tokens
  2. You have to use each one separately, includes cer files.