initialize method
Implementation
@override
Future<bool> initialize({
String? apiKey,
String? appId,
String? clientId,
String? baseUrl,
}) async {
try {
final packageName = await WalletconnectPayUtils.getPackageName();
final sdkConfig = SdkConfig(
baseUrl: WalletconnectPayUtils.getBaseUrl(),
sdkName: WalletconnectPayUtils.getSdkName(),
sdkVersion: WalletconnectPayUtils.getSdkVersion(),
sdkPlatform: WalletconnectPayUtils.getPlatform(),
apiKey: apiKey,
projectId: appId,
appId: appId,
bundleId: packageName,
clientId: clientId,
);
final result = await methodChannel.invokeMethod<bool>(
'initialize',
sdkConfig.toJsonString(),
);
return result!;
} on PlatformException catch (e) {
debugPrint('[$runtimeType] ❌ initialize: $e');
throw PayInitializeError(
code: e.code,
message: e.message?.replaceFirst('v1=', ''),
details: e.details,
stacktrace: e.stacktrace,
);
}
}