dataUsageIOS static method
Gets Data Usage From iOS Device as Future<IOSDataUsageModel>
WARNING
-
This method will only get the total amounts of data transfered and received
-
Data resets after every reboot
Implementation
/// [WARNING]
///
/// - This method will only get the total amounts of data transfered and received
///
/// - Data resets after every reboot
static Future<IOSDataUsageModel> dataUsageIOS() async {
if (Platform.isIOS) {
final data = await _channel.invokeMethod(
'getDataUsage',
);
return IOSDataUsageModel.fromJson(Map<String, dynamic>.from(data));
} else {
//Limit API to iOS Platform
throw PlatformException(
code: 'DATA_USAGE',
message:
'This method can only be called on an ios device use .dataUsageAndroid() instead');
}
}