-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmindbox_platform.dart
More file actions
137 lines (117 loc) · 5.36 KB
/
Copy pathmindbox_platform.dart
File metadata and controls
137 lines (117 loc) · 5.36 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import '../mindbox_platform_interface.dart';
/// The interface that implementations of 'mindbox' must implement.
///
/// Platform implementations should extend this class rather than implement it
/// as `mindbox` does not consider newly added methods to be breaking changes.
/// Extending this class(using `extends`) ensures that the subclass will get the
/// default implementation, while platform implementations that `implements`
/// this interface will be broken by newly added [MindboxPlatform] methods.
abstract class MindboxPlatform {
/// Should only be accessed after setter is called.
static late MindboxPlatform _instance;
/// Platform-specific plugins should set this with their own platform-specific
/// class that extends [MindboxPlatform] when they register themselves.
// ignore: unnecessary_getters_setters
static set instance(MindboxPlatform instance) {
_instance = instance;
}
/// The instance of [MindboxPlatform] to use.
///
/// Must be set before accessing.
// ignore: unnecessary_getters_setters
static MindboxPlatform get instance => _instance;
/// Initializes the SDK for further work
///
/// You can call this method multiple times to set new configuration params.
/// Read more about [Configuration] parameter.
Future<void> init({required Configuration configuration}) =>
throw UnimplementedError('init() has not been implemented.');
/// Returns native SDK version.
Future<String> get nativeSdkVersion =>
throw UnimplementedError('sdkVersion has not been implemented.');
/// Method to obtain device UUID.
void getDeviceUUID({required Function(String) callback}) =>
throw UnimplementedError('getDeviceUUID() has not been implemented.');
/// Method to obtain token.
void getToken({required Function(String) callback}) =>
throw UnimplementedError('getToken() has not been implemented.');
/// Method to obtain tokens.
void getTokens({required Function(String) callback}) =>
throw UnimplementedError('getToken() has not been implemented.');
/// Method for handling push-notification click. Returns link and payload to
/// callback.
void onPushClickReceived({
required PushClickHandler handler,
}) =>
throw UnimplementedError(
'onPushClickReceived() has not been implemented.');
/// Method for handling In-app click. Returns id, payload and url to
/// callback.
///
/// Deprecated - Use [registerInAppCallbacks] method instead
@Deprecated('Use method registerInAppCallbacks')
void onInAppClickRecieved({
required InAppClickHandler handler,
}) =>
throw UnimplementedError(
'onInAppClickRecieved() has not been implemented.');
/// Method for handling In-app dismiss. Returns id to
/// callback.
///
/// Deprecated - Use [registerInAppCallbacks] method instead
@Deprecated('Use method registerInAppCallbacks')
void onInAppismissed({
required InAppDismissedHandler handler,
}) =>
throw UnimplementedError(
'onInAppismissed() has not been implemented.');
/// Method for register a custom event.
Future<void> executeAsyncOperation({
required String operationSystemName,
required Map<String, dynamic> operationBody,
}) =>
throw UnimplementedError(
'executeAsyncOperation() has not been implemented.');
/// Method for executing an operation synchronously.
Future<void> executeSyncOperation({
required String operationSystemName,
required Map<String, dynamic> operationBody,
required Function(String response) onSuccess,
required Function(MindboxError error) onError,
}) =>
throw UnimplementedError(
'executeSyncOperation() has not been implemented.');
/// Registers a list of InAppCallback instances to handle clicks and dismiss.
///
/// This method allows you to register one or more of the following callbacks:
/// - [UrlInAppCallback] for handling in-app messages
/// by opening an associated URL.
/// - [EmptyInAppCallback] for handling in-app messages without performing
/// any actions.
/// - [CopyPayloadInAppCallback] for handling in-app messages by copying
/// the associated payload to the clipboard.
/// - [CustomInAppCallback] for providing custom click and dismiss handlers
/// for in-app messages.
///
/// [inAppCallbacks] is a required list of InAppCallback instances
/// to be registered for handling in-app message events.
///
/// If this method is not called, a default behavior will be implemented.
/// The default behavior will open the link from
/// the 'redirectUrl' parameter and copy the payload to the clipboard
/// if it is not in JSON or XML format.
void registerInAppCallbacks({required List<InAppCallback> inAppCallbacks}) =>
throw UnimplementedError(
'registerInAppCallbacks() has not been implemented.');
/// Method for managing SDK logging
void setLogLevel({required LogLevel logLevel}) =>
throw UnimplementedError(
'setLogLevel() has not been implemented.');
/// Method for sending notification permission status
void refreshNotificationPermissionStatus() => throw UnimplementedError(
'refreshNotificationPermissionStatus() has not been implemented');
/// Writes a log message to the native Mindbox logging system.
void writeNativeLog({required String message, required LogLevel logLevel}) =>
throw UnimplementedError(
'writeNativeLog() has not been implemented');
}