initialize static method
Initializes Unity Mediation. UnityMediation should be initialized when app starts.
gameId
- unique identifier for a game, given by Unity Ads admin tools.onComplete
- called whenUnityMediation
is successfully initializedonFailed
- called whenUnityMediation
is failed in initialization.
Implementation
static Future<void> initialize({
required String gameId,
Function? onComplete,
Function(UnityMediationInitializationError error, String errorMessage)? onFailed,
}) async {
Map<String, dynamic> arguments = {
gameIdParameter: gameId,
};
_channel.setMethodCallHandler(
(call) => _initializeMethodCall(call, onComplete, onFailed));
await _channel.invokeMethod(initializeMethod, arguments);
}