diff --git a/packages/package_info_plus/package_info_plus/README.md b/packages/package_info_plus/package_info_plus/README.md index f93ef0261d..670d27c935 100644 --- a/packages/package_info_plus/package_info_plus/README.md +++ b/packages/package_info_plus/package_info_plus/README.md @@ -48,6 +48,49 @@ String version = packageInfo.version; String buildNumber = packageInfo.buildNumber; ``` +## Installer Store + +The `installerStore` property indicates which app store installed the application. This is useful for directing users to the appropriate store page for ratings or updates. + +```dart +String? installerStore = packageInfo.installerStore; +``` + +### iOS + +On iOS, the `installerStore` value is determined by checking the app store receipt path: + +| Environment | `installerStore` value | +|-------------|------------------------| +| App Store | `com.apple` | +| TestFlight | `com.apple.testflight` | +| Simulator | `com.apple.simulator` | + +### Android + +On Android, the value is the package name of the app store that installed the application, obtained via `PackageManager.getInstallSourceInfo()` (Android 11+) or `PackageManager.getInstallerPackageName()` (older versions). + +| Store | `installerStore` value | +|-------|------------------------| +| Google Play Store | `com.android.vending` | +| Amazon Appstore | `com.amazon.venezia` | +| Samsung Galaxy Store | `com.sec.android.app.samsungapps` | +| Huawei AppGallery | `com.huawei.appmarket` | +| Xiaomi GetApps | `com.xiaomi.mipicks` | +| OPPO App Market | `com.oppo.market` | +| VIVO App Store | `com.vivo.appstore` | +| Manual/ADB install | `null` | + +**Note:** Some stores may not properly implement the installer package name API, which could result in `null` being returned even for store installations. + +### macOS + +On macOS, `installerStore` always returns `null` as there is no reliable way to detect the installation source. + +### Other Platforms + +On Linux, Windows, and Web, `installerStore` returns `null`. + ## Known Issues ### iOS