Pgyer internal test distribution service is a leading mobile application internal test distribution platform in China, dedicated to providing easy-to-use App internal test distribution services for mobile developers and test users.
Pgyer Developer Service Platform is committed to providing excellent upstream and downstream services for developers, addressing the various needs of developers throughout the developer life cycle.
Scan QR code to follow
Pgyer WeChat Official Account
Get the latest news, official benefits, promotions and other information
集成蒲公英 Android SDK
获取 FrontJS Token 和 Api key
在 Application 中集成
添加权限
上报异常和检查更新
1.您需要确保App有《隐私政策》,并且在用户首次启动App时就弹出《隐私政策》取得用户同意。
2.请您务必告知用户您选择蒲公英SDK服务,并在《隐私政策》中增加如下参考条款:
“我们的产品集成蒲公英SDK,蒲公英SDK需要收集您的设备Mac地址、唯一设备识别码以提供统计分析服务。
3.请您务必确保用户同意《隐私政策》之后,再初始化蒲公英SDK。
方式一:
repositories {
flatDir {
dirs 'libs' // jar目录
}
}
...
dependencies {
...
implementation files('libs/pgy_analytics_sdk.jar')
}
方式二:
allprojects {
repositories {
...
maven { url "https://frontjs-static.pgyer.com/dist/sdk/pgyersdk" } //主力仓库
maven { url "https://raw.githubusercontent.com/Pgyer/analytics/master" } //备用仓库(主力仓库下载不下来使用)
}
}
dependencies {
...
implementation 'com.pgyer:analytics:4.2.0'
}
import android.app.Application;
import com.pgyer.pgyersdk.PgyerSDKManager;
public class {当前应用的application} extends Application {
@Override
public void onCreate() {
super.onCreate();
}
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
//在attachBaseContext方法中调用初始化sdk
initPgyerSDK(this);
}
/**
* 初始化蒲公英SDK
* @param application
*/
private static void initPgyerSDK( {当前应用的application} application){
new PgyerSDKManager.Init()
.setContext(application) //设置上下问对象
.start()
}
}
在 AndroidManifest.xml 修改 android:name=“{当前应用的application}”(此处的名字对应继承上面 Application 的类名),并添加权限
<!-- 必选-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 获取网络状态 -->
<uses-permission
android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.INTERNET" /> <!-- 网络通信-->
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- 获取设备信息 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 获取网络信息权限-->
<!-- 用户手机设置中允许未知来源安装包安装状态为关;-->
<!-- Android8.0 以后,如果要安装 apk 需要额外添加权限:-->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<application
android:name=""{当前应用的application}"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="PGYER_API_KEY"
android:value="蒲公英后台申请的apikey"></meta-data>
<meta-data
android:name="PGYER_FRONTJS_KEY"
android:value="蒲公英后台申请的frontJSToken"></meta-data>
<!--添加新版本检测-->
<meta-data
android:name="PGYER_FEATURE_CHECK_UNPDATE"
android:value="true"></meta-data>
</application>
import com.pgyer.pgyersdk.PgyerSDKManager;
...
PgyerSDKManager.reportException(Exception e);
import com.pgyer.pgyersdk.PgyerSDKManager;
...
PgyerSDKManager.checkSoftwareUpdate(Activity act);
About Us
Product Services
Your account information is under review and can not be used temporarily; you can:
Check out the help documentation for common ways to work on the Pgyer's platform;
Check Pgyer's App Auditing , which must be viewed before uploading.
Currently, the real-name authentication has not been completed, and the number of downloads for each version is limited to 0 times/day, After real-name authentication, it can be extended to 500 times/day
TestFlight is only available to Professional users.(Click understand pgyer's price plan)
支付成功
Pgyer VIP User Group
(Please open WeChat - Sweep and join the group chat)