pgyer document center

蒲公英 -凯发k8地址

registration application and get app id

app id: uniquely identifies an app id, each app has a unique app id, the developer on the pgyer can find it in the application manager home page.

adding framework by cocoapods

pod 'pgyer'
pod 'pgyupdate'

manually add framework

download pgyer’s sdk (contains the application usage statistics, exception reporting, user feedback, check for updates)。

1. add pgysdk.framework, pgyupdate.framework.

the pgysdk.framework pgyupdate.framework anpd drag it to your project in xcode, and check the "copy items if needed".

2. configure dependencies

after importing the sdk, switch to the build phases tab, add the following six systems in the framework of the link binary with libraries:


if only update checking, you do not need to add dependencies.

initialization and call the sdk

introduced header files in the appdelegate.m of project file:


in the application: didfinishlaunchingwithoptions call sdk:

//start the basic sdk
[[pgymanager sharedpgymanager] startmanagerwithappid:@"pgy_app_id"];
//start checking update sdk
[[pgyupdatemanager sharedpgymanager] startmanagerwithappid:@"pgy_app_id"];

pgy_app_id is equal to app id you get in pgyer.

automatic exception reporting crash

after calling the sdk, users use app crash information in the process will be sent to the pgyer. pgyer will count the number of errors that occur and users that impacted. meanwhile developers can also view the details of the crash in web,including error stacks, models, etc., to help developers quickly locate the error.

pgyer shows the error has not been symbolized before, if you need to view symbolic information through the stack, you need submit the code corresponding dsym on pgyer.

notice: if you use the xcode startup program, gdb / lldb will block the signal and stop the application from running during local debugging, so the crash information during debugging will not be uploaded to the pgyer.

manual reporting exception

in addition to automatic reporting crash which cause an exception in sdk, the developer can also manually reported exception.

- (void)reportexception
    @try {
        nsarray *array = [nsarray arraywithobjects:@"", nil];
        nsstring *value = [array objectatindex:10];
    @catch (nsexception *exception) {
        [[pgymanager sharedpgymanager] reportexception:exception];

user feedback

call the sdk, the default open user feedback function, the user can shake or three fingers to slide up to activate the user feedback function.

1、turn off user feedback (default on):

[[pgymanager sharedpgymanager] setenablefeedback:no];

2、customize user feedback activation mode (default is shake):

// set the user feedback interface activation mode for the three fingers drag
[[pgymanager sharedpgymanager] setfeedbackactivetype:kpgyfeedbackactivetypethreefingerspan];
// set the user feedback interface to activate the way to shake
[[pgymanager sharedpgymanager] setfeedbackactivetype:kpgyfeedbackactivetypeshake];

the above customizations must be set before[[pgymanager sharedpgymanager] startmanagerwithappid:@"pgy_app_id"]

3、customize user interface style

developers can change the interface style by setting the color theme of the user feedback interface. the color after setting will affect the background color of the title and the border color of the recording button. the default is 0x37c5a1 (green).

[[pgymanager sharedpgymanager] setthemecolor:[uicolor blackcolor]];

4、custom shake shake sensitivity

developers can customize the shake sensitivity, the default is 2.3, the smaller the value the higher the sensitivity.

[[pgymanager sharedpgymanager] setshakingthreshold:3.0];

5、in addition to using the "shake" and "three fingers drag" to activate user feedback, developers can also directly through the code to activate user feedback function:

[[pgymanager sharedpgymanager] showfeedbackview];

check updates

pgyer provides developers with the function of checking the version update. when this feature is enabled, if developers submits a new version on the pgyer, the old version can pop up an update prompt to prompt the user to update to the latest version. the version update function is turned on as follows:

include the header file in the file that needs to be checked for updates:


then call it

[[pgyupdatemanager sharedpgymanager] startmanagerwithappid:@"pgy_app_id"];   // replace pgy_app_id with the app's app id
[[pgyupdatemanager sharedpgymanager] checkupdate];

if there is a newer version will prompt the user to update, as shown:

if you need to customize the check update, you need to call

[[pgyupdatemanager sharedpgymanager] checkupdatewithdelegete:self selector:@selector(updatemethod:)];

where updatemethod checks the updated callback method. if there is a new version, the dictionary containing the new version information will be returned, otherwise the dictionary is nil. if you want to update the new version, you can call

[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:response[@"downloadurl"]]];

after processing the update information, you can call

[[pgyupdatemanager sharedpgymanager] updatelocalbuildnumber];

to update the local stored pgyer's build number. after the local build number is updated, the sdk will treat the local version as up-to-date. the update method for the current version invocation will no longer return the update information.