onMethodCall static method
Implementation
static Future<dynamic> onMethodCall(MethodCall call) {
final Map<dynamic, dynamic> argumentsMap = call.arguments;
final InstallReferrerStateEvent? referrerEvent = _toReferrerStateEvent(call.method);
final int? id = argumentsMap['id'];
if (id != null && InstallReferrerClient.allReferrers[id] != null) {
final InstallReferrerClient client = InstallReferrerClient.allReferrers[id]!;
if (client.stateListener != null) {
if (referrerEvent == InstallReferrerStateEvent.setupFinished &&
argumentsMap['responseCode'] != null) {
ReferrerResponse? response = _toReferrerResponse(argumentsMap['responseCode']);
client.stateListener!(referrerEvent, responseCode: response);
} else
client.stateListener!(referrerEvent);
}
}
return Future<dynamic>.value(null);
}