Telephony icon indicating copy to clipboard operation
Telephony copied to clipboard

Sms failure handling

Open redanium opened this issue 2 years ago • 0 comments

This fix will handle all sms sending failures (RESULT_ERROR_GENERIC_FAILURE,RESULT_ERROR_NO_SERVICE,RESULT_ERROR_NULL_PDU,RESULT_ERROR_RADIO_OFF) to SMS_FAIL.

For example :

final SmsSendStatusListener listener = (SendStatus status) {
	// Handle the status
	switch (status) {
		case SendStatus.SENT:
		  print("SMS is sent!");
		  break;
		case SendStatus.DELIVERED:
		  print("SMS delivered.");
		  break;
		case SendStatus.FAIL:
		  print("Error sending sms");
		  break;
		default:
	  }
};
	
telephony.sendSms(
	to: "1234567890",
	message: "May the force be with you!",
	statusListener: listener
);

redanium avatar Jan 24 '23 10:01 redanium