APP 跳转到Google Play或App Store应用商店
使用插件
launch_review
, 作为pubspec.yaml
文件中的依赖项
使用方法
- 引入最新版本的插件
launch_review
至pubspec.yaml
(当前最新版本就是 3.0.1),并进行flutter pub get
命令进依赖的下载。
launch_review: ^3.0.1
- 既要支持
iOS
,又要支持Andriod
版本,故分别进行配置,查看文档得到:插件本身支持Andriod
和低版本的iOS
。但是当前版本已经到iOS 16.1
,故需要在iOS
文件夹里面的Info.plist
文件里进行如下的配置:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>itms-beta</string>
<string>itms</string>
</array>
- 在需要的类里导入插件
import 'package:launch_review/launch_review.dart';
- 在页面所需处进行方法的调用
LaunchReview.launch(androidAppId: "com.xxx.xxxxx",iOSAppId: "00000000");
注意: 其中 androidAppId
在 android
文件夹里面进行查找, iOSAppId
在 APP Connect
创建 APP
信息的时候会创建,需要查看的时候去里面查看即可。
总结
- 引入依赖
- 为高版本
iOS
配置 - 导入类
- 调用并进行参数配置
参考文献: pub.dev/packages/la…