Showing
4 changed files
with
10 additions
and
8 deletions
| @@ -25,7 +25,7 @@ import android.content.Intent; | @@ -25,7 +25,7 @@ import android.content.Intent; | ||
| 25 | import android.net.Uri; | 25 | import android.net.Uri; |
| 26 | import android.os.Build; | 26 | import android.os.Build; |
| 27 | import android.provider.Settings; | 27 | import android.provider.Settings; |
| 28 | - | 28 | +import android.util.Log |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | /** FlutterPushPlugin */ | 31 | /** FlutterPushPlugin */ |
| @@ -50,6 +50,10 @@ class FlutterPushPlugin: FlutterPlugin, MethodCallHandler { | @@ -50,6 +50,10 @@ class FlutterPushPlugin: FlutterPlugin, MethodCallHandler { | ||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | override fun onMethodCall(call: MethodCall, result: Result) { | 52 | override fun onMethodCall(call: MethodCall, result: Result) { |
| 53 | + | ||
| 54 | + | ||
| 55 | + Log.d("onMethodCall", "${call.method}") | ||
| 56 | + | ||
| 53 | if (call.method == "getPlatformVersion") { | 57 | if (call.method == "getPlatformVersion") { |
| 54 | result.success("Android ${android.os.Build.VERSION.RELEASE}") | 58 | result.success("Android ${android.os.Build.VERSION.RELEASE}") |
| 55 | } else if (call.method == "init") { | 59 | } else if (call.method == "init") { |
| @@ -8,7 +8,7 @@ class FlutterPush { | @@ -8,7 +8,7 @@ class FlutterPush { | ||
| 8 | return FlutterPushPlatform.instance.getPlatformVersion(); | 8 | return FlutterPushPlatform.instance.getPlatformVersion(); |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | - Future<void> init({ | 11 | + Future<bool> init({ |
| 12 | String? defaultPlatform, | 12 | String? defaultPlatform, |
| 13 | String? appId, | 13 | String? appId, |
| 14 | String? appKey, | 14 | String? appKey, |
| @@ -21,7 +21,7 @@ class MethodChannelFlutterPush extends FlutterPushPlatform { | @@ -21,7 +21,7 @@ class MethodChannelFlutterPush extends FlutterPushPlatform { | ||
| 21 | /// 初始化,如果没有appId或appKey,请登录小米开发者中心申请 | 21 | /// 初始化,如果没有appId或appKey,请登录小米开发者中心申请 |
| 22 | /// [appId] 应用appId | 22 | /// [appId] 应用appId |
| 23 | /// [appKey] 应用appKey | 23 | /// [appKey] 应用appKey |
| 24 | - Future<void> init({ | 24 | + Future<bool> init({ |
| 25 | String? defaultPlatform, | 25 | String? defaultPlatform, |
| 26 | String? appId, | 26 | String? appId, |
| 27 | String? appKey, | 27 | String? appKey, |
| @@ -59,7 +59,7 @@ class MethodChannelFlutterPush extends FlutterPushPlatform { | @@ -59,7 +59,7 @@ class MethodChannelFlutterPush extends FlutterPushPlatform { | ||
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | /// 获取客户端的 RegId | 61 | /// 获取客户端的 RegId |
| 62 | - Future<String?> msgReceive() async { | 62 | + Future<bool> msgReceive() async { |
| 63 | return await methodChannel.invokeMethod('msgReceive'); | 63 | return await methodChannel.invokeMethod('msgReceive'); |
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| @@ -28,12 +28,10 @@ abstract class FlutterPushPlatform extends PlatformInterface { | @@ -28,12 +28,10 @@ abstract class FlutterPushPlatform extends PlatformInterface { | ||
| 28 | throw UnimplementedError('platformVersion() has not been implemented.'); | 28 | throw UnimplementedError('platformVersion() has not been implemented.'); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | - | ||
| 32 | - | ||
| 33 | /// 初始化,如果没有appId或appKey,请登录小米开发者中心申请 | 31 | /// 初始化,如果没有appId或appKey,请登录小米开发者中心申请 |
| 34 | /// [appId] 应用appId | 32 | /// [appId] 应用appId |
| 35 | /// [appKey] 应用appKey | 33 | /// [appKey] 应用appKey |
| 36 | - Future<void> init({ | 34 | + Future<bool> init({ |
| 37 | String? defaultPlatform, | 35 | String? defaultPlatform, |
| 38 | String? appId, | 36 | String? appId, |
| 39 | String? appKey, | 37 | String? appKey, |
| @@ -65,7 +63,7 @@ abstract class FlutterPushPlatform extends PlatformInterface { | @@ -65,7 +63,7 @@ abstract class FlutterPushPlatform extends PlatformInterface { | ||
| 65 | } | 63 | } |
| 66 | 64 | ||
| 67 | /// 获取客户端的 RegId | 65 | /// 获取客户端的 RegId |
| 68 | - Future<String?> msgReceive() async { | 66 | + Future<bool> msgReceive() async { |
| 69 | throw UnimplementedError('msgReceive() has not been implemented.'); | 67 | throw UnimplementedError('msgReceive() has not been implemented.'); |
| 70 | } | 68 | } |
| 71 | } | 69 | } |
-
Please register or login to post a comment