i tried sending sms programmatically from an iPhone app using the following two modules but I am running into one issue in both cases.
https://github.com/omorandi/TiSMSDialog https://github.com/benbahrenburg/benCoding.SMS
After sending the sms (after sms dialog disappears), my app window becomes unresponsive (text fields are not editable, etc.). I am wondering if anybody else who has used these modules have experienced something similar? I tried the sample apps that module provides and even the examples have this same issue.
Any help is appreciated.
1 Answer
Accepted Answer
Hi Saqib
I have used the TiSMSDialog module and it works correctly, I am not seeing the same issue as you.
I used the exact same code as the example supplied with the module, only changing the phone number when the dialog is shown, before sending. Obviously this needs to be done on the physical phone as the simulator does not support this function.
I added the module into the Modules folder of the project rather than globally, in case that might be different from your use.
Exact code used shown below. This was triggered by a left nav button and sat above a table. Once the sms was successfully sent I continued to have normal use of the app.
var SMS = require('ti.sms'); var sms = SMS.createSMSDialog({ animated: true }); sms.barColor = 'black'; sms.toRecipients = [ '5678309' // who should receive the text? put their numbers here! ]; sms.messageBody = 'This is a text message.'; sms.addEventListener('complete', function(evt) { if (evt.success) { alert('SMS sent!'); } else { switch (evt.result) { case SMS.CANCELLED: alert('User cancelled SMS!'); break; case SMS.FAILED: default: alert(evt.error); break; } } }); sms.open();
Your Answer
Think you can help? Login to answer this question!