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
添加Framework
获取 AppKey
初始化并调用 SDK
上报 Crash 异常
用户反馈
检查更新
1.您需要确保App有《隐私政策》,并且在用户首次启动App时就弹出《隐私政策》取得用户同意。
2.请您务必告知用户您选择蒲公英SDK服务,并在《隐私政策》中增加如下参考条款:
“我们的产品集成蒲公英SDK,蒲公英SDK需要收集您的设备Mac地址、唯一设备识别码以提供统计分析服务。
3.请您务必确保用户同意《隐私政策》之后,再初始化蒲公英SDK。
支持通过Cocoapods添加Framework或手工添加Framewrok两种方式
方式一:通过Cocoapods添加Framework
pod 'Pgyer'
pod 'PgyUpdate'
方式二:手工添加Framewrok
下载最新版蒲公英 SDK V2.8.9.1 (2018.5.24) (包含应用使用统计,异常上报,用户反馈功能,更新检查)。
更多版本
将 PgySDK.framework 和 PgyUpdate.framework 拖动到你的 Xcode 工程里,并勾选“Copy items if needed”。
导入 SDK 后,切换到 Build Phases选项卡中,在 Link Binary With Libraries 中添加如下六个系统 framework:
CoreTelephony.framework
OpenGLES.framework
CoreMotion.framework
AudioToolbox.framework
AvFoundation.framework
SystemConfiguration.framework
如果仅使用检查更新功能,则无需添加依赖项。
注册应用获取 App Key
App Key:唯一标识一个应用的 Key,在蒲公英上的每一个 App 都有一个唯一的 App Key,开发者可以在应用管理页面首页查看。
在项目的AppDelegate.m文件中引入头文件:
#import <PgySDK/PgyManager.h>
#import <PgyUpdate/PgyUpdateManager.h>
在application:didFinishLaunchingWithOptions 中调用 SDK:
//启动基本SDK
[[PgyManager sharedPgyManager] startManagerWithAppId:@"PGY_APP_ID"];
//启动更新检查SDK
[[PgyUpdateManager sharedPgyManager] startManagerWithAppId:@"PGY_APP_ID"];
其中PGY_APP_ID即在蒲公英上获取的App Key。
调用 SDK 后,用户在使用 App 的过程中的崩溃信息将会发送到蒲公英。蒲公英将会统计错误发生的次数,影响的用户,同时开发者还可以在后台查看崩溃的详细信息,包括错误堆栈,机型等,帮助开发者快速定位错误。
蒲公英后台显示的错误是未经过符号化过的,如果需要查看符号化过的堆栈信息,需将代码对应的 dSYM 文件在蒲公英上提交。
注意:在进行本地调试的时候,如果使用 Xcode 启动程序,gdb/lldb 会拦截到信号并停止应用运行,所以调试期间的崩溃信息不会被上传到蒲公英。
SDK除了可以自动上报导致Crash的异常之外,开发者还可以手动上报Exception。
- (void)reportException
{
@try {
NSArray *array = [NSArray arrayWithObjects:@"", nil];
NSString *value = [array objectAtIndex:10];
}
@catch (NSException *exception) {
[[PgyManager sharedPgyManager] reportException:exception];
}
}
调用 SDK 后,默认开启用户反馈功能,用户可以通过摇一摇或者三指向上滑动来激活用户反馈功能。
一、关闭用户反馈功能(默认开启):
[[PgyManager sharedPgyManager] setEnableFeedback:NO];
二、自定义用户反馈激活方式(默认为摇一摇):
// 设置用户反馈界面激活方式为三指拖动
[[PgyManager sharedPgyManager] setFeedbackActiveType:kPGYFeedbackActiveTypeThreeFingersPan];
// 设置用户反馈界面激活方式为摇一摇
[[PgyManager sharedPgyManager] setFeedbackActiveType:kPGYFeedbackActiveTypeShake];
上述自定义必须在调用 [[PgyManager sharedPgyManager] startManagerWithAppId:@"PGY_APP_ID"]
前设置。
三、自定义用户界面风格
开发者可以通过设置用户反馈界面的颜色主题来改变界面风格,设置之后的颜色会影响到Title的背景颜色和录音按钮的边框颜色,默认为0x37C5A1(绿色)。
[[PgyManager sharedPgyManager] setThemeColor:[UIColor blackColor]];
四、自定义摇一摇灵敏度
开发者可以自定义摇一摇的灵敏度,默认为2.3,数值越小灵敏度越高。
[[PgyManager sharedPgyManager] setShakingThreshold:3.0];
五、除了可以使用“摇一摇”和“三指拖动”来激活用户反馈,开发者还可以通过代码来直接激活用户反馈功能:
[[PgyManager sharedPgyManager] showFeedbackView];
蒲公英为开发者提供了检查版本更新的功能,当开启此功能后,开发者如果在蒲公英上提交了新版本,则老的版本中,可以弹出更新提示,来提示用户更新到最新版本。版本更新功能的开启方法如下:
在需要检查更新的文件中引入头文件:
#import <PgyUpdate/PgyUpdateManager.h>
然后调用
[[PgyUpdateManager sharedPgyManager] startManagerWithAppId:@"PGY_APP_ID"]; // 请将 PGY_APP_ID 换成应用的 App Key
[[PgyUpdateManager sharedPgyManager] checkUpdate];
如果有更新版本则会提示用户前往更新,如图所示:
如果需要自定义检查更新,则需要调用
[[PgyUpdateManager sharedPgyManager] checkUpdateWithDelegete:self selector:@selector(updateMethod:)];
其中updateMethod为检查更新的回调方法。如果有新版本,则包含新版本信息的字典会被回传,否则字典为nil。如果想更新新版本,可通过调用
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:response[@"downloadURL"]]];
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)