textbee icon indicating copy to clipboard operation
textbee copied to clipboard

Failed to obtain FCM Token

Open Virgus opened this issue 11 months ago • 6 comments

Hello, very interesting project. I'm struggling to test it but I'm getting the message "Failed to obtain FCM Token".

Here the steps I've done so far:

  1. Downloaded and installed the apk from the GitHub repo.
  2. Enabled permissions (SMS, Phone, Camera) for the apk
  3. Registered on the web site and clicked "Get Started" button
  4. Got the api key via the QR code scanning
  5. Selected the default SIM

Then I've been trying several times by clicking around but I've no clue what's missing. Could you please point me to the right steps ?

Thanks and have a nice day, V.

EDIT: BTW I cannot see any Device ID in the app GUI. I'm using Lineage OS Android 11 version. Might this be the cause of what's going on ?

Virgus avatar Mar 03 '24 14:03 Virgus

Hi @Virgus thanks for reporting this issue. I tried reproducing it but could not. could you double check your device's internet connectivity, or try clearing app data /reinstalling the app to start fresh.

vernu avatar Mar 03 '24 16:03 vernu

Hello @vernu and thanks for your prompt reply. I tried starting over from scratch and have the same issue. Could it be caused by the fact that I'm using a degoogled phone ? Are you using google libraries for acknowledging the server of the device ID ? Infact I see no device ID in the Android app's GUI. Screenshot_20240304-012023_TextBee

Virgus avatar Mar 04 '24 00:03 Virgus

@Virgus the app utilizes Google's Firebase cloud messaging (FCM) service. As you mentioned, it may not function properly on a degoogled phone.

vernu avatar Mar 04 '24 01:03 vernu

Thanks, I feared that was the cause. To your knowledge which one is the apk that is related to the FCM service exactly ? I'm wondering if I could install it on top of my Lineage OS to have textbee working...

Virgus avatar Mar 04 '24 08:03 Virgus

@vernu I made it ! Updated microg to the latest version and enabled "Device registration" and "Cloud Messaging". It worked like a charm from your website. Really nice !!!

Now I'm trying to make textbee work via Curl Post messages, to be able to integrate it in my batch and AutoIt scripts under Windows. Do you have a sample script to adapt the javascript sample snippet ?

Thanks for the tool, it opens a lot of new possibilites !

EDIT: BTW I have a dual SIM phone. How do I get the device ID to be able to send SMS via SIM2 ?

Virgus avatar Mar 04 '24 12:03 Virgus

@Virgus Good to hear that it worked.

if you're working with curl you can use the following:

curl -X POST -H "Content-Type: application/json" -d '{
  "receivers": ["+251912345678"],
  "smsBody": "Your Message"
}' 'https://api.textbee.vernu.dev/api/v1/gateway/devices/DEVICE_ID/sendSMS?apiKey=API_KEY'

Regarding selecting the sender SIM, currently, there is no way to specify which SIM to send from in the API request. However you can select the preferred SIM from the Android app.

vernu avatar Mar 04 '24 15:03 vernu