launchIntent method
Future<Map?>
launchIntent({
- required FlutterIntentWithResult intentDetails,
- dynamic onResponse(
- dynamic
- String? packageName,
override
Implementation
@override
Future<Map?> launchIntent(
{required FlutterIntentWithResult intentDetails,
Function(dynamic)? onResponse,
String? packageName}) async {
if (onResponse != null) {
_startListeningToIntentStatus(onResponse);
}
try {
Map? nativeResponse = await methodChannel.invokeMapMethod(
methodName,
{
"intentURL": intentDetails.url,
"action": intentDetails.action,
"packageName": packageName,
"extras": intentDetails.extras,
"requestCode": intentDetails.requestCode,
},
);
bool isSuccess = ((nativeResponse?["status"] ?? "") == "SUCCESS");
if (!isSuccess) {
_intentStatusSubscription?.cancel();
}
return nativeResponse;
} catch (e) {
// print the error
rethrow;
}
}