Closed hamsadev closed 2 years ago
I'm confused! Shouldn't listenIncomingSms callbacks be executed only to receive sms? When I call _sendSMS, the onNewMessage callback is also executed
Future<void> initPlatformState() async { final bool? result = await telephony.requestPhoneAndSmsPermissions; if (result != null && result) { telephony.listenIncomingSms( onNewMessage: onMessage, onBackgroundMessage: onBackgroundMessage); } if (!mounted) return; }
Future<void> _sendSMS(String recipients, String password) async { final String? command = _commandMap[_selectedCommand]; await telephony.sendSms( to: recipients, message: '$password*$command', ); }
I apologize, it was my mistake
I'm confused! Shouldn't listenIncomingSms callbacks be executed only to receive sms? When I call _sendSMS, the onNewMessage callback is also executed