20
Views
1
Comments
Solved
[Firebase Mobile] GetToken returns null
Question
Forge component by David Sousa
23
Published on 26 May 2020

I'm trying to initialize firebase in my mobile android app. The problem is that the app gets stuck at InitCloudMessaging. After some debugging and logging in the FirebaseMobile component I found out that the GetToken JS in RegisterDevice is in an infinite loop. I added a log right after the GetToken, but it never gets fired. So I looked more into this and I can see that if the GetToken functionality keeps returning null, the app will get stuck and will try it forever.

I followed a tutorial on youtube (https://www.youtube.com/watch?v=ygbu3AITS4k&ab_channel=OutSystems).

I'm in an OS10 environment using FirebaseMobile 1.0.4.

MABS version 6.3 (Latest)

I also made a change in the extensibility configuration of the FirebaseMobile 1.0.4 component version according to the post of Davis Sousa in order to generate a native android app. (https://www.outsystems.com/forums/discussion/55476/cant-generate-my-app-with-android/)

Rank: #8433
Solution

After 2 weeks of investigating my problem I managed to solve it. It had to do with the emulator I was using. I didn't have google play store installed on the emulator not knowing that firebase needs google play services in order to get the token. 

So for the people that are having the same problem and are using an emulator. Check your google play services. I just had to install Open Gapps in GenyMotion (Emulator that I'm using).