Skip to main content
Version: 1.49.x

Web Store

Configure

To use 101XP Web Store please add the next key to your AndroidManifest.xml:

AndroidManifest.xml
<meta-data
android:name="com.platform101xp.sdk.web_store_project_name"
android:value="@string/web_store_project_name" />

Please, ask your release manager for parameter web_store_project_name.

Usage

To show 101XP Web Store please use the method:

void showWebStore(Map<String, String> properties);
OR
void showWebStore(Map<String, String> properties, List<String> allowedLocale);

properties - additional optional properties appending to the final 101XP Web Store url as "key=value"

allowedLocale - allowed locale for run Web Store, if current device locale not find in "allowedLocale" just use first element "allowedLocale".

Example

// Add your properties
Map<String, String> properties = new HashMap<String, String>();
properties.put("first_purchase_property", your_purchase_property);

// Show 101XP Web Store
Platform101XP.showWebStore(properties)

// OR any call with allowed locale
Platform101XP.showWebStore(properties, Arrays.asList("en","ru"));

if current device locale not find in your Arrays just use first element.

Handling an authorization error in onShowWebStoreResult() or onCheckMobilePurchase()

To properly work the web store, you have to call the authorization in the case of an authorization error like on the code snippet below:

@Override
public void onShowWebStoreResult(Platform101XPError error) {
if (error != null) {
// Handle an error
if (error.getErrorType() == Platform101XPError.ErrorType.ERROR_NOT_AUTHORIZED)
Platform101XP.authorize();
} else {
// Web Store shown successfully
}
}

@Override
public void onCheckMobilePurchase(String itemName, boolean bought, Platform101XPError error) {
if (error != null) {
// Handle an error
if (error.getErrorType() == Platform101XPError.ErrorType.ERROR_NOT_AUTHORIZED)
Platform101XP.authorize();
} else {
// Web Store result check bought param
}
}

Check purchase in Web Store

To check purchase in Web Store for user use method:

void checkMobilePurchase(String itemName);

The result of checkMobilePurchase() is sent to the method of listener.

void onCheckMobilePurchase(String itemName, boolean bought, Platform101XPError error);