Pgyer Docs
SDK (Archived)

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 are versionName / 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

MechanismApplies toDecision Basis
NewAndroid 2.8.3+, iOS 2.8.9+Local App Version and Build vs. App Version and Build on Pgyer
LegacyAndroid before 2.8.3, iOS before 2.8.9Local 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

  1. If local App Version is lower than App Version on Pgyer, prompt to update. This corresponds to CFBundleShortVersionString on iOS and versionName on Android.
  2. If local App Build is lower than App Build on Pgyer, prompt to update. This corresponds to CFBundleVersion on iOS and versionCode on Android.

Legacy

  1. If local App Version is lower than App Version on Pgyer, prompt to update.
  2. 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.

On this page