capcom6 / android-sms-gateway

The SMS Gateway for Androidâ„¢ app enables sending and receiving SMS messages through an API that can be accessed directly on the device or via a cloud server when direct device access is not possible.
https://sms.capcom.me
Apache License 2.0
131 stars 32 forks source link

Phone parsing: Invalid phone number #28

Closed jakeharlow28 closed 6 months ago

jakeharlow28 commented 6 months ago

i keep getting this response on one of the numbers in my app, ive checked the number is it is correct.

POST: { "id": "tH5-AUItZNqar8W5_pC8b", "recipients": [ { "error": "Phone parsing: Invalid phone number", "phoneNumber": "0493563919", "state": "Failed" } ], "state": "Pending" }

GET: { "id": "tH5-AUItZNqar8W5_pC8b", "recipients": [ { "phoneNumber": "0493563919", "state": "Failed" } ], "state": "Failed" }

it also fails on "+6149356391" but all the other numbers i send to work. great app by the way!

capcom6 commented 6 months ago

Hi, @jakeharlow28!

Regarding the phone numbers mentioned:

  1. For the number 0493563919, I recommend using international notation or E.164 phone number notation, which includes the "+" sign. Alternatively, if you are using the national format, please ensure that the locale of the phone is appropriate, as it is used to translate national phone numbers to international notation.
  2. For the number +61 493 563 91, it appears that one digit is missing. As far as I know, Australian mobile numbers have the format +61 4XX XXX XXX with 11 digits, but the number you provided contains only 10 digits.

If the information above is not helpful, please provide the following details:

  1. Whether you are using a local server or a cloud server.
  2. The version of the app you are using.
  3. What locale is selected on the phone?

I hope this helps!

jakeharlow28 commented 6 months ago

sorry the missing digit is a typo in my message, here is my other post

{ "id": "bC8pv4biJgMut8wZ-eIQ5", "recipients": [ { "error": "Phone parsing: Invalid phone number", "phoneNumber": "+61493563919", "state": "Failed" } ], "state": "Pending" }

not sure on the version of the app im using but i believe its v1.3.0 and im using local server and we are in australia, if i manually send a message though our default messaging app it works. also thanks for the quick response!

capcom6 commented 6 months ago

Please update the app on your device to version 1.3.1, where I have updated the library for phone number validation. I tested the last phone number on version 1.3.0 and encountered the same error, but on version 1.3.1, it works fine.

jakeharlow28 commented 6 months ago

absolute legend!, ill test now and report back

jakeharlow28 commented 6 months ago

updated to 1.3.1 and its working. cant thank you enough!

capcom6 commented 6 months ago

Great to hear that updating to version 1.3.1 resolved the issue for you! I'm glad I could help.