diff --git a/lib/pages/home_page/home_page.dart b/lib/pages/home_page/home_page.dart index 62bb0d2..fd6234f 100644 --- a/lib/pages/home_page/home_page.dart +++ b/lib/pages/home_page/home_page.dart @@ -122,11 +122,13 @@ class _HomePageState extends State with WidgetsBindingObserver, Ticker _eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError); MobPushUtil.addPushReceiver(); - EventUtil.instance.on().listen((event) { + EventUtil.instance.on().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 with WidgetsBindingObserver, Ticker } } - @override void dispose() { WidgetsBinding.instance.removeObserver(this);