2016년 12월 25일 일요일

"Generic failure, message not sent" error when using Texting component


I'm trying to use a procedure to send sms to 3 numbers in a list , but I get "generic failure, message not sent.." and  only the first number receive the message. 
Little precision : the fist number is the number of the phone on witch the app is install.
--
You did not post an image of your blocks Jules, that would help give you specific advice.   The first message goes out ok.  Great.   Now why do not the final two messages?


Either this is a timing issue; you request sending messges 2 and 3 before 1 is sent
or
one of the messages is longer than 160 characters (including spaces).  There is a limit to the 'length' of a standard sms message.

You might fix a 'timing' issue by using a Clock.Timer to create a delay between messages.  You could also use three buttons, each of which would send a message provided you wait between button touches.

Try some blocks.  The problem is probably timing.  When you get a solution, please post your blocks here Jule and / or show us what you attempted..

--
 texting.png
After some little modifications(message longer reduction), it's appear that only the 2 first numbers in the list receive the SMS but the "Generic failure, message not sent" always appear and the last number 
 (of the phone on witch the app is installed) doesn't receive the SMS.

--
as SteveJG suggested, instead of using a for each loop use a clock to add some delay between sending the messages
--
 MIT App Inventor 2 2015-06-24 03-26-39.png
In my app, the sms must be send by a button.click to the 3 numbers of the list . Impossible to insert a Clock.Timer in a button.click block to manage a delay between each message.
I have build an other kind of timer/loop by using While_Test and from_each(number)From(1)To(6000)By(1)Do..., and it work !

--
unfortunately this is a very bad solution
if you have to send a few more sms, you app will close with a runtime error

instead of using a for each loop use a clock to add some delay between sending the messages
see my doSomething example how to use the clock see here https://groups.google.com/d/msg/mitappinventortest/HyitZbwMJOA/2hYC_Z3K1tQJ

--
Thank you !! That is exactly what i was looking for ! Your solution is undoubtedly the best !! it's SMART ! However, if I had to use my solution for more than 3 messages, I would have just split my numbers by group of 3 and then applied my method for each group.

--

댓글 없음:

댓글 쓰기