我的应用程序的位置权限弹出窗口是这样的:
我需要这样的(在网上找到的):
我正在 flutter 中完成我的项目,所以我需要做哪些修改才能像第二张图片中那样弹出。
所以我希望能够解决我的问题
您无法在 Android 位置权限弹出窗口中添加自定义消息,但您可以在 iOS 中添加,您还可以在 iOS 上看到您添加自定义消息的屏幕截图。 对于 iOS,您可以在
iOS/Runner/info.plist
中添加这些行,并且可以更改消息:
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to location in the background.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app needs access to location when in the background.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs access to location when open and in the background.</string
对于 Android,您可以做的是添加自定义对话框来向您显示消息,然后您可以打开默认弹出窗口。
这是不可能做到的。看看下面的文章,它完美地解释了这背后的原因。