flutter_push_platform_interface.dart
2.12 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
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'flutter_push_method_channel.dart';
import 'mix_push_plugin_listener.dart';
abstract class FlutterPushPlatform extends PlatformInterface {
/// Constructs a FlutterPushPlatform.
FlutterPushPlatform() : super(token: _token);
static final Object _token = Object();
static FlutterPushPlatform _instance = MethodChannelFlutterPush();
/// The default instance of [FlutterPushPlatform] to use.
///
/// Defaults to [MethodChannelFlutterPush].
static FlutterPushPlatform get instance => _instance;
/// Platform-specific implementations should set this with their own
/// platform-specific class that extends [FlutterPushPlatform] when
/// they register themselves.
static set instance(FlutterPushPlatform instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}
Future<String?> getPlatformVersion() {
throw UnimplementedError('platformVersion() has not been implemented.');
}
/// 初始化,如果没有appId或appKey,请登录小米开发者中心申请
/// [appId] 应用appId
/// [appKey] 应用appKey
Future<void> init({
String? defaultPlatform,
String? appId,
String? appKey,
}) async {
throw UnimplementedError('init() has not been implemented.');
}
Future<bool> checkPermission() async {
throw UnimplementedError('checkPermission() has not been implemented.');
}
Future<bool> getPermission() async {
throw UnimplementedError('getPermission() has not been implemented.');
}
/// 添加消息监听
void addListener(ListenerValue func) {
throw UnimplementedError('addListener() has not been implemented.');
}
/// 移除消息监听
void removeListener(ListenerValue func) {
throw UnimplementedError('removeListener() has not been implemented.');
}
/// 获取客户端的 RegId
Future<String?> getRegId() async {
throw UnimplementedError('getRegId() has not been implemented.');
}
/// 获取客户端的 RegId
Future<String?> msgReceive() async {
throw UnimplementedError('msgReceive() has not been implemented.');
}
}