Skip to content

Commit 0534cd2

Browse files
docs(package_info_plus): add installerStore values documentation (#3721)
Co-authored-by: Volodymyr Buberenko <[email protected]>
1 parent 096fd4e commit 0534cd2

File tree

1 file changed

+40
-0
lines changed
  • packages/package_info_plus/package_info_plus

1 file changed

+40
-0
lines changed

packages/package_info_plus/package_info_plus/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,46 @@ String version = packageInfo.version;
4848
String buildNumber = packageInfo.buildNumber;
4949
```
5050

51+
### Installer Store
52+
53+
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.
54+
55+
```dart
56+
PackageInfo packageInfo = await PackageInfo.fromPlatform();
57+
String? installerStore = packageInfo.installerStore;
58+
```
59+
60+
#### iOS
61+
62+
On iOS, the `installerStore` value is determined by checking the app store receipt path:
63+
64+
| Environment | `installerStore` value |
65+
|-------------|------------------------|
66+
| App Store | `com.apple` |
67+
| TestFlight | `com.apple.testflight` |
68+
| Simulator | `com.apple.simulator` |
69+
70+
#### Android
71+
72+
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).
73+
74+
| Store | `installerStore` value |
75+
|-------|------------------------|
76+
| Google Play Store | `com.android.vending` |
77+
| Amazon Appstore | `com.amazon.venezia` |
78+
| Samsung Galaxy Store | `com.sec.android.app.samsungapps` |
79+
| Huawei AppGallery | `com.huawei.appmarket` |
80+
| Xiaomi GetApps | `com.xiaomi.mipicks` |
81+
| OPPO App Market | `com.oppo.market` |
82+
| VIVO App Store | `com.vivo.appstore` |
83+
| Manual/ADB install | `null` |
84+
85+
**Note:** Some stores may not properly implement the installer package name API, which could result in `null` being returned even for store installations.
86+
87+
#### Other Platforms
88+
89+
On MacOS, Linux, Windows, and Web, `installerStore` returns `null`.
90+
5191
## Known Issues
5292

5393
### iOS

0 commit comments

Comments
 (0)