瀏覽代碼

0106 推送集成设置别名规则masterId_userId

0107
tags/0.0.3+6
23028876916@qq.com 3 年之前
committed by “yanghuaxuan”
父節點
當前提交
fd7396b91f
共有 1 個檔案被更改,包括 6 行新增5 行删除
  1. +6
    -5
      lib/pages/home_page/home_page.dart

+ 6
- 5
lib/pages/home_page/home_page.dart 查看文件

@@ -122,11 +122,13 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
_eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError);

MobPushUtil.addPushReceiver();
EventUtil.instance.on<LoginSuccessEvent>().listen((event) {
EventUtil.instance.on<LoginSuccessEvent>().listen((event) async {
UserInfoModel userInfo = UserInfoNotifier?.staitcUserInfo;
Logger.log("我的TOKEN5: " + userInfo?.userId);
if (!EmptyUtil.isEmpty(userInfo.userId)) {
MobPushUtil.setAlias(userInfo.userId);
var setting = await NativeUtil.getSetting();
String masterId = setting['master_id'];
Logger.log("我的Alias: " + masterId + "_" + userInfo?.userId);
if (!EmptyUtil.isEmpty(userInfo.userId) && !EmptyUtil.isEmpty(masterId)) {
MobPushUtil.setAlias(masterId + "_" + userInfo.userId);
}
});

@@ -154,7 +156,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
}
}


@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);


Loading…
取消
儲存