Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_push
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
顾海波
2025-02-19 13:50:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9ddf24e538bf2d4e9ddd99fb07667cd390016b66
9ddf24e5
1 parent
e0d5aaa6
【修复】推送点击跳转
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
11 deletions
android/src/main/kotlin/com/ewin/flutter_push/EwinMixPushReceiver.kt
android/src/main/kotlin/com/ewin/flutter_push/FlutterPushPlugin.kt
lib/flutter_push.dart
lib/flutter_push_method_channel.dart
lib/flutter_push_platform_interface.dart
android/src/main/kotlin/com/ewin/flutter_push/EwinMixPushReceiver.kt
View file @
9ddf24e
...
...
@@ -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
FlutterPushPlugin.lastMsg = message
context.startActivity(context.packageManager.getLaunchIntentForPackage(context.packageName))
if(FlutterPushPlugin.isInit()){
this.invokeListener(MixListenerTypeEnum.NotificationMessageClicked, message)
}
this.invokeListener(MixListenerTypeEnum.NotificationMessageClicked, message)
// var intent: Intent? = null
// if (message.payload == null) {
...
...
android/src/main/kotlin/com/ewin/flutter_push/FlutterPushPlugin.kt
View file @
9ddf24e
...
...
@@ -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()
}
...
...
lib/flutter_push.dart
View file @
9ddf24e
...
...
@@ -31,4 +31,8 @@ class FlutterPush {
void
removeListener
(
ListenerValue
func
)
{
FlutterPushPlatform
.
instance
.
removeListener
(
func
);
}
void
msgReceive
()
{
FlutterPushPlatform
.
instance
.
msgReceive
();
}
}
...
...
lib/flutter_push_method_channel.dart
View file @
9ddf24e
...
...
@@ -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'
);
}
}
...
...
lib/flutter_push_platform_interface.dart
View file @
9ddf24e
...
...
@@ -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
(
'
platformVer
sion() has not been implemented.'
);
throw
UnimplementedError
(
'
checkPermis
sion() has not been implemented.'
);
}
Future
<
bool
>
getPermission
()
async
{
throw
UnimplementedError
(
'
platformVer
sion() has not been implemented.'
);
throw
UnimplementedError
(
'
getPermis
sion() 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.'
);
}
}
...
...
Please
register
or
login
to post a comment