vernu / textbee

textbee.dev is an opensource and free sms-gatway for sending SMS messages through API or dashboard web interface.
https://textbee.dev
MIT License
326 stars 55 forks source link

Failed to obtain FCM Token #5

Closed Virgus closed 3 months ago

Virgus commented 6 months ago

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 2) Registered on the web site and clicked "Get Started" button 3) Got the api key via the QR code scanning 4) 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 ?

vernu commented 6 months ago

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.

Virgus commented 6 months ago

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

vernu commented 6 months ago

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

Virgus commented 6 months ago

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 commented 6 months ago

@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 ?

vernu commented 6 months ago

@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.