Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition between register and execute #106

Closed
youjingwong opened this issue Jan 4, 2022 · 1 comment
Closed

Race condition between register and execute #106

youjingwong opened this issue Jan 4, 2022 · 1 comment

Comments

@youjingwong
Copy link

Hi @jefflinwood

While initializing the client, it crashes with

java.lang.NullPointerException: accessToken must not be null

The logs show
Screenshot 2022-01-05 at 2 18 09 AM

The order seems to be

  1. Initializing TwilioVoicePlugin
  2. FCM token retrieved
  3. Running execute method

This causes a crash as register() is called in step 2, before step 3 is ran, causing mAccessToken to be null.

I'm not too sure why the FCM token is retrieved so quickly, perhaps because I am also using capacitor-push-notifications, which uses the same library.

Does moving FCM token retrieval into the execute method make sense?

@youjingwong
Copy link
Author

This was caused by using a wrong version of firebase messaging.

Closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant