I used getIapClient(Context context)
in my app for object instantiation. The app could not work well with devices with older versions of HMS core.
How to make the app show a prompt for HMS core upgrade?
I used getIapClient(Context context)
in my app for object instantiation. The app could not work well with devices with older versions of HMS core.
How to make the app show a prompt for HMS core upgrade?
public static IapClient getIapClient(Activity activity)
As @Zinna said, the getIapClient(Activity activity) method is recommended for your app to obtain an IapClient instance. When the input parameter is not of the Activity type, if the HMS Core (APK) version is earlier than that requested for calling the APIs of IAP, the IAP SDK returns only the error code 907135003 and cannot display the upgrade wizard page.
If you call relevant APIs through an activity, the HMS Core SDK will automatically install or update HMS Core (APK), and you do not need to take any other actions. Please refer to the docs here.
<application ...>
<meta-data
android:name="com.huawei.hms.client.channel.androidMarket"
android:value="false" />
...
</application>
About Configuring Metadata, please refer to the docs.
Please use activity:
instead of context when calling this method.
More details on Huawei developer site