From fd7396b91f59e6339af37f99651158145d8e0feb Mon Sep 17 00:00:00 2001 From: "23028876916@qq.com" Date: Wed, 6 Jan 2021 18:34:51 +0800 Subject: [PATCH] =?UTF-8?q?0106=20=20=E6=8E=A8=E9=80=81=E9=9B=86=E6=88=90?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=88=AB=E5=90=8D=E8=A7=84=E5=88=99masterId?= =?UTF-8?q?=5FuserId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0107 --- lib/pages/home_page/home_page.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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);