Install
Trigger app install on Pgyer from your own systems: the generic install endpoint and iOS in-app install.
Two ways to trigger an install through the API: the generic install endpoint and iOS in-app install.
Install App
Use this endpoint to embed Pgyer's install capability into your own systems — you won't need to route users through Pgyer's download web page.
https://www.pgyer.com/apiv2/app/installCall with GET, and only from inside iOS or Android.
This is a paid endpoint. Each user gets 200 free requests per day; beyond that, each call costs ¥0.03 deducted from your Pgyer balance. When the balance runs out, the endpoint returns an error — keep the account topped up.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| _api_key | String | Yes | API Key — see auth |
| appKey | String | Conditionally | Accepts appKey or the app short URL; installs the latest version. appKey and buildKey cannot both be empty |
| buildKey | String | Conditionally | See buildKey — installs a specific version. appKey and buildKey cannot both be empty |
| buildPassword | String | No | Install password, if the app requires one |
Response
The endpoint auto-selects the right install flow based on the app's platform (iOS or Android).
Example
https://www.pgyer.com/apiv2/app/install?_api_key={_api_key}&buildKey={buildKey}&buildPassword={buildPassword}iOS In-App Install
iOS in-app install uses the itms-services:// URL scheme so users can trigger an install without leaving the app for a browser.
Public install URL:
itms-services://?action=download-manifest&url=https://www.pgyer.com/app/plist/{buildKey}Password install URL:
itms-services://?action=download-manifest&url=https://www.pgyer.com/app/plist/{buildKey}?password={password}Replace {buildKey} with the app's buildKey and {password} with the install password (without the braces).
Examples
Web link:
<a href="itms-services://?action=download-manifest&url=https://www.pgyer.com/app/plist/{buildKey}">Install</a>iOS client:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-services://?action=download-manifest&url=https://www.pgyer.com/app/plist/{buildKey}"]];Or hit the install endpoint directly:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.pgyer.com/apiv2/app/install?_api_key={_api_key}&buildKey={buildKey}&buildPassword={buildPassword}"]];