协议通知后注册推送

This commit is contained in:
2026-03-13 17:09:30 +08:00
parent 02e1946319
commit 84b174c4a5
3 changed files with 97 additions and 6 deletions

View File

@@ -29,8 +29,14 @@ class HomeController extends GetxController with BaseControllerMixin {
@override
void onInit() {
super.onInit();
initAliyunPush();
addPushCallback();
// 检查是否同意过隐私政策,只有同意后才初始化推送
if (StorageService.to.isPrivacyAgreed) {
requestPermission();
initAliyunPush();
addPushCallback();
}
FlutterNativeSplash.remove();
log('page-init');
@@ -152,7 +158,6 @@ class HomeController extends GetxController with BaseControllerMixin {
// 根据登录状态和登录渠道返回不同的首页
Widget getHomePage() {
requestPermission();
if (StorageService.to.isLoggedIn) {
if (StorageService.to.loginChannel == LoginChannel.station) {
return B_BaseWidgetsPage();