feat:jpush中各个厂商token截取实现以及原生native层获取token接口桥接到flutter层供业务调用
This commit is contained in:
parent
3cfe50277e
commit
63ce6b1070
@ -61,7 +61,7 @@ FutureOr<void> main() async {
|
||||
], child: MyApp(isLogin: isLogin)));
|
||||
// runApp(MyApp(isLogin: isLogin));
|
||||
}, onException: (FlutterErrorDetails details) async {
|
||||
debugPrint("FlutterErrorDetails $details");
|
||||
debugPrint('FlutterErrorDetails ${details.exceptionAsString()}');
|
||||
});
|
||||
|
||||
if (AppPlatform.isAndroid) {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:jpush_flutter/jpush_flutter.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/mineUnbindPhoneOrEmail_entity.dart';
|
||||
@ -49,28 +50,39 @@ class XSJPushProvider {
|
||||
//极光推送事件处理方法
|
||||
void addJPushEventHandler() {
|
||||
jpush.addEventHandler(
|
||||
onCommandResult: (Map<String, dynamic> message) async {
|
||||
AppLog.log('onCommandResult: $message');
|
||||
debugPrint("addJPushEventHandler onCommandResult:$message");
|
||||
},
|
||||
onReceiveNotification: (Map<String, dynamic> message) async {
|
||||
AppLog.log('onReceiveNotification: $message');
|
||||
debugPrint("addJPushEventHandler onReceiveNotification:$message");
|
||||
// showCustomNotification(message);
|
||||
},
|
||||
onOpenNotification: (Map<String, dynamic> message) async {
|
||||
AppLog.log('onOpenNotification: $message');
|
||||
debugPrint("addJPushEventHandler onOpenNotification:$message");
|
||||
},
|
||||
onReceiveMessage: (Map<String, dynamic> message) async {
|
||||
AppLog.log('onReceiveMessage: $message');
|
||||
debugPrint("addJPushEventHandler onReceiveMessage:$message");
|
||||
//这里接收自定义消息
|
||||
MessageManagement.shunting(message);
|
||||
},
|
||||
onReceiveNotificationAuthorization: (Map<String, dynamic> message) async {
|
||||
AppLog.log('onReceiveNotificationAuthorization: $message');
|
||||
debugPrint(
|
||||
"addJPushEventHandler onReceiveNotificationAuthorization:$message");
|
||||
},
|
||||
onInAppMessageShow: (Map<String, dynamic> message) async {
|
||||
AppLog.log('onInAppMessageShow: $message');
|
||||
debugPrint("addJPushEventHandler onInAppMessageShow:$message");
|
||||
},
|
||||
onConnected: (Map<String, dynamic> message) async {
|
||||
//绑定设备id
|
||||
final String rid = await jpush.getRegistrationID();
|
||||
AppLog.log('onConnected registration id : $rid');
|
||||
debugPrint("addJPushEventHandler onConnected:$message");
|
||||
await Storage.setString(pushDeviceID, rid);
|
||||
await pushBindDeviceID(rid);
|
||||
|
||||
|
||||
@ -991,10 +991,11 @@ packages:
|
||||
jpush_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: jpush_flutter
|
||||
sha256: bb29ce650c6765a54ecbdd8f448840ecea83b4e24564e554d11eba20ed3b37d9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
path: "."
|
||||
ref: main
|
||||
resolved-ref: aa93729f48762421658675800be68aee27b6d8fb
|
||||
url: "git@code-internal.star-lock.cn:StarlockTeam/jpush_flutter.git"
|
||||
source: git
|
||||
version: "2.5.8"
|
||||
js:
|
||||
dependency: transitive
|
||||
|
||||
@ -211,7 +211,10 @@ dependencies:
|
||||
cached_network_image: ^3.2.0
|
||||
webview_flutter: ^4.5.0
|
||||
|
||||
jpush_flutter: ^2.5.1
|
||||
jpush_flutter:
|
||||
git:
|
||||
url: git@code-internal.star-lock.cn:StarlockTeam/jpush_flutter.git
|
||||
ref: main
|
||||
|
||||
#视频播放器
|
||||
video_player: ^2.9.2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user