-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmindbox_ios_platform.dart
More file actions
116 lines (99 loc) · 3.56 KB
/
Copy pathmindbox_ios_platform.dart
File metadata and controls
116 lines (99 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import 'package:mindbox_platform_interface/mindbox_platform_interface.dart';
/// An [MindboxPlatform] that wraps Mindbox iOS SDK.
class MindboxIosPlatform extends MindboxPlatform {
MindboxIosPlatform._();
final MindboxMethodHandler _methodHandler = MindboxMethodHandler();
/// Registers this class as the default instance of [MindboxPlatform].
static void registerPlatform() {
/// Register the platform instance with the plugin platform interface.
MindboxPlatform.instance = MindboxIosPlatform._();
}
/// Returns native SDK version or "Unknown" on error.
@override
Future<String> get nativeSdkVersion async => _methodHandler.nativeSdkVersion;
/// Initializes the SDK for further work.
///
/// You can call this method multiple times to set new configuration params.
/// Read more about [Configuration] parameter.
@override
Future<void> init({required Configuration configuration}) async {
await _methodHandler.init(configuration: configuration);
}
/// Returns device UUID string to callback.
@override
void getDeviceUUID({required Function(String uuid) callback}) {
_methodHandler.getDeviceUUID(callback: callback);
}
/// Returns token to callback.
@override
void getToken({required Function(String token) callback}) {
_methodHandler.getToken(callback: callback);
}
/// Returns token to callback.
@override
void getTokens({required Function(String token) callback}) {
_methodHandler.getTokens(callback: callback);
}
/// Method for managing sdk logging
@override
void setLogLevel({required LogLevel logLevel}) {
_methodHandler.setLogLevel(logLevel: logLevel);
}
/// Returns link from push to callback.
@override
void onPushClickReceived({
required PushClickHandler handler,
}) {
_methodHandler.handlePushClick(handler: handler);
}
/// Returns id, redirectUrl and payload from In-app to callback.
@override
void onInAppClickRecieved({required InAppClickHandler handler}) {
_methodHandler.handleInAppClick(handler: handler);
}
/// Returns id from In-app to callback.
@override
void onInAppismissed({required InAppDismissedHandler handler}) {
_methodHandler.handleInAppDismiss(handler: handler);
}
/// Method for register a custom event.
@override
Future<void> executeAsyncOperation({
required String operationSystemName,
required Map<String, dynamic> operationBody,
}) async {
_methodHandler.executeAsyncOperation(
operationSystemName: operationSystemName,
operationBody: operationBody,
);
}
/// Method for executing an operation synchronously.
@override
Future<void> executeSyncOperation({
required String operationSystemName,
required Map<String, dynamic> operationBody,
required Function(String response) onSuccess,
required Function(MindboxError error) onError,
}) async {
_methodHandler.executeSyncOperation(
operationSystemName: operationSystemName,
operationBody: operationBody,
onSuccess: onSuccess,
onError: onError,
);
}
@override
void registerInAppCallbacks({required List<InAppCallback> inAppCallbacks}) {
_methodHandler.registerInAppCallbacks(callbacks: inAppCallbacks);
}
// Method for to send notification permission status
@override
void refreshNotificationPermissionStatus() {
_methodHandler.refreshNotificationPermissionStatus();
}
/// Writes a log message to the native Mindbox logging system.
@override
void writeNativeLog({required String message, required LogLevel logLevel}) {
_methodHandler.writeNativeLog(message: message, logLevel: logLevel);
}
}