getSmsMessages method
Get all SMS messages
Implementation
@override
Future<List<SmsMessage>> getSmsMessages() async {
try {
final List<dynamic> result = await methodChannel.invokeMethod<List<dynamic>>('getSmsMessages') ?? [];
return result.map((item) => SmsMessage.fromMap(Map<String, dynamic>.from(item))).toList();
} on PlatformException catch (e) {
if (e.code == 'NOT_SUPPORTED') {
throw UnsupportedError('Reading SMS messages is not supported on this platform');
}
rethrow;
}
}