distriqt / ANE-Message

Send messages from AIR using email and SMS
https://airnativeextensions.com/extension/com.distriqt.Message
0 stars 0 forks source link

Some messages don't get sent out #58

Open raresn opened 4 years ago

raresn commented 4 years ago

Hey! We have this strange case where a message doesn't get sent out - tried to look with logcat to see if there are any errors, but couldn't find anything.

private function sendTestSms():void
{

    trace("send Test");
    var payloadNotWorking:String = '{ "status": "Buna ziua, va reamintim de programarea dv din data de.\\nApelati 0700123456.\\nCosmetic\\u0103 by Lia"}';
    var payloadWorkin:String = '{ "status": "Buna.\\nApelati 0700123456.\\nCosmetic\\u0103 by Lia"}';
    var data:Object = JSON.parse(payloadNotWorking);
    var msg:String = data['status'];

    trace("Json msg:", msg);

    var sms:SMS = new SMS();
    sms.id = '2';
    sms.address = '<-- your phone here -->';
    sms.message = msg;
    log("Sending TEST sms with id: " + sms.id + " - address: " + sms.address + " - text: " + sms.message);

    Message.service.smsManager.sendSMS( sms );
}

Any clue what might cause payloadNotWorking not to work and the other one to work? Maybe we can do some debugging on a .. lower level?

Also, a question that is not related: Is there an ANE to read the call log? We are interested in getting the number from the last call (and other options if possible)

Thank you!

marchbold commented 4 years ago

Have you checked the length of the message, could be the device is using an older sms standard and limiting the character length to 67? Does it happen on all devices / networks?

Could you post the device log and we'll have a look over it as well?

We don't have any ANE that can access the call log. Contact our custom development team if you need something specific developed at airnativeextensions@distriqt.com

raresn commented 4 years ago

Any way of checking the sms standard? I mean we send out around 50k sms messages from multiple devices and multiple netowrks and only some fail. Feels like acombination of diacritics and linebreaks and we can't get an exact error so a fix can be applied.

On Android 7 we get nothing back with the payloadNotWorking On Android 9 we get:

06-15 17:46:40.884 29968 29968 I air.ro.oursmsaplication: SMS Event [Event type="sms:sent:error" bubbles=false cancelable=false eventPhase=2] sms:sent:error [SMS(id=2,address='0757000001',message='Buna ziua, va reamintim de programarea dv din data de.
06-15 17:46:40.884 29968 29968 I air.ro.oursmsaplication: Apelati 0757000000.
06-15 17:46:40.884 29968 29968 I air.ro.oursmsaplication: Cosmetică by Lia')] generic_failure

The logcat doesn't trace any errors, but I attached it anyway. logcat_android9_short.txt logcat_android7_short.txt

When testing, you can copy/paste our function above and just put in your phone number to achieve the fail-result. Thank you for taking the time to check this.

marchbold commented 4 years ago

Not really sure what to suggest here, we will try to replicate.