requestPermissions method

Future<bool> requestPermissions (
  1. {bool force: false}
)

Implementation

Future<bool> requestPermissions({bool force = false}) async {
  if (Platform.isIOS) return true;

  // check to see if we've requested before
  // (unless force == true, in which case make the request again)
  final directory = await getApplicationDocumentsDirectory();
  final file = File('${directory.path}/com.gomes.nowplaying');
  if (!force && await file.exists()) return false;

  file.create();
  await _channel.invokeMethod<bool>('requestPermissions');
  return true;
}