Showing
3 changed files
with
18 additions
and
2 deletions
assets/h_notification.png
0 → 100644
2.47 KB
| @@ -3,6 +3,7 @@ import 'dart:convert'; | @@ -3,6 +3,7 @@ import 'dart:convert'; | ||
| 3 | import 'dart:io'; | 3 | import 'dart:io'; |
| 4 | import 'package:cached_network_image/cached_network_image.dart'; | 4 | import 'package:cached_network_image/cached_network_image.dart'; |
| 5 | import 'package:common_utils/common_utils.dart'; | 5 | import 'package:common_utils/common_utils.dart'; |
| 6 | +import 'package:device_info/device_info.dart'; | ||
| 6 | import 'package:flutter/cupertino.dart'; | 7 | import 'package:flutter/cupertino.dart'; |
| 7 | import 'package:flutter/material.dart'; | 8 | import 'package:flutter/material.dart'; |
| 8 | import 'package:flutter/services.dart'; | 9 | import 'package:flutter/services.dart'; |
| @@ -943,7 +944,22 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -943,7 +944,22 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 943 | } | 944 | } |
| 944 | 945 | ||
| 945 | //初始化信鸽推送 | 946 | //初始化信鸽推送 |
| 946 | - initPlatformState() { | 947 | + initPlatformState() async { |
| 948 | + //安卓弹窗提示使用通知权限目的,仅提示一次 | ||
| 949 | + | ||
| 950 | + //全局提示权限使用目的 | ||
| 951 | + // if (Platform.isAndroid) { | ||
| 952 | + // DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); | ||
| 953 | + // AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; | ||
| 954 | + // if (androidInfo.manufacturer == 'HUAWEI') { | ||
| 955 | + // if (!(App.sp.getBool("h_notification") ?? false)) { | ||
| 956 | + // DialogUtil.showAuthorityDestination(context, 'h_notification', | ||
| 957 | + // '通知权限使用说明', '在客户预订以及店内营销需要的时候,给您发送通知消息。'); | ||
| 958 | + // } | ||
| 959 | + // } | ||
| 960 | + // } | ||
| 961 | + // App.sp.setBool("h_notification", true); | ||
| 962 | + | ||
| 947 | /// 开启DEBUG | 963 | /// 开启DEBUG |
| 948 | XgFlutterPlugin().setEnableDebug(false); | 964 | XgFlutterPlugin().setEnableDebug(false); |
| 949 | 965 |
| @@ -45,7 +45,7 @@ Future<bool> requestPermission(Permission permissionGroup) async { | @@ -45,7 +45,7 @@ Future<bool> requestPermission(Permission permissionGroup) async { | ||
| 45 | BuildContext context = App.navigatorKey.currentState.overlay.context; | 45 | BuildContext context = App.navigatorKey.currentState.overlay.context; |
| 46 | if (permissionGroup == Permission.storage) { | 46 | if (permissionGroup == Permission.storage) { |
| 47 | DialogUtil.showAuthorityDestination( | 47 | DialogUtil.showAuthorityDestination( |
| 48 | - context, 'h_storage', '相册权限使用说明', '用于上传店铺门头照,包间照片等。'); | 48 | + context, 'h_storage', '存储权限使用说明', '用于读取相册照片上传店铺门头照,包间照片等。'); |
| 49 | } else if (permissionGroup == Permission.camera) { | 49 | } else if (permissionGroup == Permission.camera) { |
| 50 | DialogUtil.showAuthorityDestination( | 50 | DialogUtil.showAuthorityDestination( |
| 51 | context, 'h_camera', '相机权限使用说明', '用于上传店铺门头照,包间照片等。'); | 51 | context, 'h_camera', '相机权限使用说明', '用于上传店铺门头照,包间照片等。'); |
-
Please register or login to post a comment