B4A Library HMS (Huawei) - DRM verification

HMS v1.00 adds support for DRM verification.

It allows checking whether the app was purchased from the store or not.
It is very simple to integrate. Make sure to use the latest version of HMS and include the two new dependencies (drm and apptouch).

  1. Find the project DRM ID and key:



  2. Add to manifest editor:
    B4X:
    CreateResourceFromFile(Macro, hms.hms_drm)

  3. Call CheckDRM with:
    B4X:
    Wait For (hms.CheckDRM(Main.DRM_ID, Main.DRM_KEY)) Complete (Success As Boolean)
    If Success = False Then
    Log("Not purchased")
    'ExitApplication
    End If

It will show a dialog if the app was not purchased and take the user to the store page.

You can add a test account and it will be treated as if it was purchased from the store.

The CheckDRM method will only work in B4XPages projects.
 
Last edited:

CaptKronos

Active Member
Licensed User
Longtime User
The CheckDRM sub doesn't seem to be defined in the provided version of HMS.zip.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…