0

I'm building a VoIP app, and I'd like to use FCM to be notified of incoming calls. The FCM token generated on Android contains a InstanceId prefix, followed by a colon (:). However, due to an implementation detail, I am unable to use string that contains colons. Is there a way to generate a valid token that doesn't contain a colon?

Specifically, I'm using react-native-pjsip, and the library crashes when I pass the token in the contact params, since it contains a colon. It works when I wrap the string in double-quotes (" "), but my SIP provider doesn't support parsing these strings in quotes. So I'm trying to find a way to generate a token that will keep both sides happy, which is one that doesn't contain a colon.

Any help is much appreciated!

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
glocore
  • 1,727
  • 1
  • 14
  • 24

1 Answers1

2

There is no API to control what tokens get generated by Firebase Cloud Messaging. So what you'll need to do is encode the token you get into a value that is valid for your infrastructure. For example, you could use a simple URL encoding, which would turn a token a:bc into a%3Abc.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807