can i use GCM (google cloud messaging) as sms gateway

12,438

SMS and GCM are not the same thing at all. SMS uses carrier routing, GCM uses IP (WiFi or mobile data) routing.

GCM can send messages as long as the user is connected to the internet. You can use third-party gateways (like Twilio mentioned in another answer) but there is generally a cost or other constraints.

You can also use SmsManager on the owner's device to send messages, but some apps may prevent this on KitKat devices (or later) since it has to route SMS through the "default" SMS app.

So, your user will need to test this. Since it is an emergency app, I'm pretty sure you don't want to worry about WiFi connection.

Also, take a look at superdupersms.com - it supports this kind of functionality.

Share:
12,438
shahnup
Author by

shahnup

Updated on June 04, 2022

Comments

  • shahnup
    shahnup almost 2 years

    Actually I am developing an Android app for women security, its an emergency app which will send out panic messages to emergency contacts at the double click of power button of your phone, so at this double click event, only a request needs to be send to the server and the server will then send out messages to dedicated persons emergency contacts for this I need a free sms gateway or a rest api.

    I only need to send messages.

    Is GCM suitable?If not please suggest free gateways/api

  • Mike M.
    Mike M. about 9 years
    Any app with the SEND_SMS permission can still send messages with SmsManager in KitKat and above. The primary restriction is that only the default app has standard write access to the Provider. However, any non-default app sending messages will have them automatically written to the Provider by the system.
  • Jim
    Jim about 9 years
    Out of a few hundred thousand installs using that method, I've seen it not always work. Apparently, not all phones implement it properly or intentionally ignore that part of the specification. That's why I wrote what I did. Is your experience that it is fully reliable?
  • Mike M.
    Mike M. about 9 years
    Gotcha. I misread your post as saying "it will not work on KitKat". Apologies. Personally, I've not come across a situation where it didn't work, but obviously specific implementations can alter that behavior. Good to know. Thanks!
  • shahnup
    shahnup about 9 years
    i dont want to send it from user phone because in case the users account balance will be null, the functionality will fail, and the sole purpose of emergency app will go in vain, so looking for internet messaging option