plugin_openinstall
OpenInstall 裂变 Flutter 插件
Getting Started
This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
第一步:
在 flutter 项目的 Android 项目下添加如下代码
1.(可选 )如果使用 ProGuard 混淆时,遇到相关的警告,可以在你的 proguard-rules.pro 文件中添加下面代码
-keep class io.openinstall.\*_ { _; }
2.在 manifest 标签中添加下面权限
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
3.在 application 中添加 appkey
<meta-data
android:name="com.openinstall.APP_KEY"
android:value="xxxx"/>
值可在 openinstall 对应的项目中找到 4.功能集成
一键拉起 在 manifest 的 MainActivity 中新增
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="xxxx"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="xxxxxxxx" />
</intent-filter>
第二步.项目中初始化
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await PluginOpeninstall.initOpenInstall();
await PluginOpeninstall.startOpenInstall();
runApp(const MyApp());
}
分享上报 目前插件中分享统计只有 Facebook Twitter Instagram Whatsapp Line Apple copy 其他的都会统计到Other 如果需要添加可以跟我反馈
PluginOpeninstall.reportShare("userId", "Platform")
获取从web网页中传递的动态参数时
PluginOpeninstall.getInstallParam()
目前只有Android端可以使用