Aliz
Posts: 0
Joined: Wed May 13, 2015 10:38 am

Send SMS in one tap

Hi, I need my app to be able to send a SMS to a given number (a variable number, previously defined by a function), in one tap on a button (just one :) ). Is there a way to do that with appery.io ? Thanks for your kind answer :)

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Send SMS in one tap

I found this video:
https://youtu.be/7L3OHPxUpYY
All you would have to do is map a local storage variable containing your number or just make the number static like in the picture below:

Image

I strongly suggest putting the number in a Local Storage Variable (LSV) and filling that LSV at some point before the user clicks the button to send the SMS.

Aliz
Posts: 0
Joined: Wed May 13, 2015 10:38 am

Send SMS in one tap

Well that seems amazing, dude, thanks a lot for that. I started doing it already, let's see how far I can get with my very limited knowledge of development :)

One important question though : is there a way to make the users of the app use their own phone number as "From", and not a Twilio number ? I don't want the users to be able to spam the Twilio service and send sms recklessly and anonymously without having to account for it :)

Thanks !

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Send SMS in one tap

I am not familiar with Twilio yet, but I found this:

https://www.twilio.com/help/faq/sms/c...

"you cannot set the ‘From’ phone number as a phone number that you do not own in your Twilio Account." sounds like a potential yes to your question.

Aliz
Posts: 0
Joined: Wed May 13, 2015 10:38 am

Send SMS in one tap

Hey thanks for your answer :)
I saw that Twilio advises to get a shortcode phone number in this case.

The thing is, even then, I really don't want my users to use this app to spam SMS. Which they will, eventually :) People always take the extremes when they can :)
https://www.twilio.com/help/faq/sms/c...

So, unfortunately, Twilio seems to be an amazing service, but it would not be safe for my app to use it :(

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Send SMS in one tap

I agree, you definitely have to account for misuse and abuse. Do you think it would be logical to set a timeout for a period of time to disable the spamming?

setTimeout(function(){
//your code to be executed after 1 second
}, 1000);

That code delays triggering for one second, but could be changed up a little to delay more and possibly act as a button enabler after the button disables itself.

Aliz
Posts: 0
Joined: Wed May 13, 2015 10:38 am

Send SMS in one tap

Well, that's an interesting idea, really ;-)
Let me see if it's enough to prevent spam (I guess yes) and if it doesn't impact UX too strongly though :)

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Send SMS in one tap

It should, as far as spamming through the app, but it wont stop the recipient of the sms to spam the "sent from" number if that is what you are worried about. If so, I wouldn't worry too much. I'm sure Twilio can handle that.

Return to “Issues”