SDK Auto-Update Mechanism
How the Pgyer iOS and Android SDKs detect new versions, covering both the legacy and current comparison schemes.
The Pgyer SDK is no longer maintained. For new integrations, use the Pgyer API directly. This page is kept for projects that already integrated the SDK.
The Pgyer iOS and Android SDKs both support auto-update. This page explains how the SDK decides that a new version is available.
Background
Before reading further, get familiar with Pgyer's versioning concepts:
- App's own version numbers: on iOS these are
CFBundleShortVersionString/CFBundleVersion; on Android they areversionName/versionCode. - Pgyer's auto-incremented Build number: assigned by Pgyer each time you upload, and never written into the app itself.
See Display the correct Build number.
Comparison of Update Mechanisms
| Mechanism | Applies to | Decision Basis |
|---|---|---|
| New | Android 2.8.3+, iOS 2.8.9+ | Local App Version and Build vs. App Version and Build on Pgyer |
| Legacy | Android before 2.8.3, iOS before 2.8.9 | Local App Version and Pgyer's auto-incremented Build vs. online values |
Both schemes follow the rule "if any dimension shows the online version is newer, prompt for update."
New
- If local App Version is lower than App Version on Pgyer, prompt to update. This corresponds to
CFBundleShortVersionStringon iOS andversionNameon Android. - If local App Build is lower than App Build on Pgyer, prompt to update. This corresponds to
CFBundleVersionon iOS andversionCodeon Android.
Legacy
- If local App Version is lower than App Version on Pgyer, prompt to update.
- If local Pgyer auto-increment Build is lower than Pgyer auto-increment Build online, prompt to update.
Because Pgyer's auto-incremented Build is not written into the app, the SDK writes the latest online Build into a local file during the first install to use as a baseline for future comparisons.
Force Update
Android SDK V3.0.4 (2019.02.27) and above supports force updates. If the force-update setting does not take effect, check the SDK version first. The iOS SDK does not support force updates.
For iOS apps you plan to submit to the App Store, remove the auto-update code and SDK. Apple does not allow apps with self-update functionality on the App Store.