kevin. Mobile SDK
Search…
Installation
Prerequisites: Flutter uses Android and iOS native SDKs to integrate kevin. infrastructure. Before proceeding further, please import SDK dependencies as it is described in the corresponding installation sections.
Extensive demo example on how to implement kevin. Flutter project can be found in our public github repository.
In order to use kevin. SDK in your Flutter application you need to initialize kevin. plugin and set up platform-specific MethodChannels.

Android

Override configureFlutterEngine method in your projects android/app/src/main/kotlin/your/app/MainActivity.kt file:
1
class MainActivity: FlutterActivity() {
2
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
3
super.configureFlutterEngine(flutterEngine)
4
5
// Setup your custom theme which extends Theme.Kevin.Base
6
Kevin.setTheme(R.style.Theme_Kevin_Base)
7
// Set optional locale, default is phone locale
8
Kevin.setLocale(Locale("en"))
9
// Initialize required plugins with your callback urls
10
KevinAccountsPlugin.configure(
11
KevinAccountsConfiguration.builder()
12
.setCallbackUrl("https://your.callback.url")
13
.build()
14
)
15
KevinPaymentsPlugin.configure(
16
KevinPaymentsConfiguration.builder()
17
.setCallbackUrl("https://your.callback.url")
18
.build()
19
)
20
21
MethodChannel(
22
flutterEngine.dartExecutor.binaryMessenger,
23
"your.application.name/kevinChannel"
24
).setMethodCallHandler { call, result ->
25
// TODO: Handle Flutter calls here
26
}
27
}
28
}
Copied!

iOS

Override didFinishLaunchingWithOptions method in your projects ios/Runner/AppDelegate.swift file:
1
@UIApplicationMain
2
@objc class AppDelegate: FlutterAppDelegate {
3
override func application(
4
_ application: UIApplication,
5
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
6
) -> Bool {
7
GeneratedPluginRegistrant.register(with: self)
8
9
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
10
11
// Setup your custom theme which extends KevinTheme
12
Kevin.shared.theme = KevinTheme()
13
// Set optional locale, default is English locale
14
Kevin.shared.locale = Locale(identifier: "en")
15
// Initialize required plugins with your callback urls
16
KevinAccountsPlugin.shared.configure(
17
KevinAccountsConfiguration.Builder(
18
callbackUrl: URL(string: "https://your.callback.url")!
19
).build()
20
)
21
KevinInAppPaymentsPlugin.shared.configure(
22
KevinInAppPaymentsConfiguration.Builder(
23
callbackUrl: URL(string: "https://your.callback.url")!
24
).build()
25
)
26
27
let kevinChannel = FlutterMethodChannel(
28
name: "your.application.name/kevinChannel",
29
binaryMessenger: controller.binaryMessenger
30
)
31
32
kevinChannel.setMethodCallHandler({
33
(call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
34
// TODO: Handle Flutter calls here
35
})
36
37
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
38
}
39
}
Copied!
Copy link
Contents