顾海波

【修复】推送点击跳转

... ... @@ -32,12 +32,12 @@ class EwinMixPushReceiver : MixPushReceiver() {
}
override fun onNotificationMessageClicked(context: Context, message: MixPushMessage) {
if(!FlutterPushPlugin.isInit()){
FlutterPushPlugin.lastMsg = message
context.startActivity(context.packageManager.getLaunchIntentForPackage(context.packageName))
return
}
if(FlutterPushPlugin.isInit()){
this.invokeListener(MixListenerTypeEnum.NotificationMessageClicked, message)
}
// var intent: Intent? = null
// if (message.payload == null) {
... ...
... ... @@ -83,6 +83,9 @@ class FlutterPushPlugin: FlutterPlugin, MethodCallHandler {
NotificationManagerUtils.openPermissionSetting(context)
}
result.success(true)
} else if (call.method == "msgReceive") {
lastMsg = null
result.success(true)
} else {
result.notImplemented()
}
... ...
... ... @@ -31,4 +31,8 @@ class FlutterPush {
void removeListener(ListenerValue func) {
FlutterPushPlatform.instance.removeListener(func);
}
void msgReceive() {
FlutterPushPlatform.instance.msgReceive();
}
}
... ...
... ... @@ -57,4 +57,9 @@ class MethodChannelFlutterPush extends FlutterPushPlatform {
Future<String?> getRegId() async {
return await methodChannel.invokeMethod('getRegId');
}
/// 获取客户端的 RegId
Future<String?> msgReceive() async {
return await methodChannel.invokeMethod('msgReceive');
}
}
... ...
... ... @@ -38,29 +38,34 @@ abstract class FlutterPushPlatform extends PlatformInterface {
String? appId,
String? appKey,
}) async {
throw UnimplementedError('platformVersion() has not been implemented.');
throw UnimplementedError('init() has not been implemented.');
}
Future<bool> checkPermission() async {
throw UnimplementedError('platformVersion() has not been implemented.');
throw UnimplementedError('checkPermission() has not been implemented.');
}
Future<bool> getPermission() async {
throw UnimplementedError('platformVersion() has not been implemented.');
throw UnimplementedError('getPermission() has not been implemented.');
}
/// 添加消息监听
void addListener(ListenerValue func) {
throw UnimplementedError('platformVersion() has not been implemented.');
throw UnimplementedError('addListener() has not been implemented.');
}
/// 移除消息监听
void removeListener(ListenerValue func) {
throw UnimplementedError('platformVersion() has not been implemented.');
throw UnimplementedError('removeListener() has not been implemented.');
}
/// 获取客户端的 RegId
Future<String?> getRegId() async {
throw UnimplementedError('platformVersion() has not been implemented.');
throw UnimplementedError('getRegId() has not been implemented.');
}
/// 获取客户端的 RegId
Future<String?> msgReceive() async {
throw UnimplementedError('msgReceive() has not been implemented.');
}
}
... ...