Requesting getExpoPushTokenAsync throws exception

SDK version 36
Platform Android

When building an Expo app and installing for the first time, If you disconnect the WIFI/Data and detect a connection change by using NetInfo.addEventListener to get networkState.isInternetReachable. Once a connection is reachable you can press a button and request getExpoPushTokenAsync however it just throws an exception until you soft close/Fully close the app and reopen from the phone menu with internet connection from the start. Is there a way to getExpoPushTokenAsync and get the token without having to close the app after a connection is established. I have looked for hours on the forums and Stackoverflow with no Joy! I must also say that it already has permission granted using the Expo latest docs example.

I have tried to wrap in a setTimeout to see if it was a change detection issue or delay.

Running this when connection is reachable after it previously wasn’t
Produces the Exception in the uploaded Image

Please can you advise

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.