Setup Multi-store Payments

now.gg Payments Module enables support for multi-store Payments when you leverage the multi-store publishing feature using nowStudio.

This document illustrates the steps required to enable multi-store payments.

Prerequisites

The following requirements must be met to enable multi-store Payments:

  • Payments Integration – Make sure you’ve integrated our Payments Module.
  • nowStudio Setup
    • Select the stores where you want to publish your app. Read more.

1. Supported Stores

The following stores are currently supported:

  • Powered by now.gg
    • BlueStacks Store
    • Cloud Store
  • Alternate Stores
    • Amazon Appstore
    • OnePlus OneStore
    • Xiaomi GetApps
    • Huawei AppGallery (Coming Soon)
    • Samsung Galaxy Store

2. Store-Specific Setup

Once you have integrated the Payments module, ensure that you include the following store-specific changes in your final build before providing us with the final APK.

Depending on your store selection, please refer to the following steps:

2.1 Amazon Appstore

The following steps are required to create an app build for Amazon Appstore.

2.1.1 PEM File

Amazon requires a PEM file that contains a unique app-specific public key to establish a secure communication channel between the Amazon Appstore and your app.

  • To get the PEM file, please reach out to us at dev-support@now.gg.
  • Include the PEM file based on the following instructions:
  • Native Android:
    • Paste the PEM file into the app/src/main/assets directory of your Android Studio project.
      Note: If your app doesn’t have an assets directory, you must create one and place the PEM file into it.
  • Unity:
    • In the Assets folder of your project, create a new folder named StreamingAssets.
      • Paste the PEM file in Assets/StreamingAssets.

2.1.2 Update AndroidManifest.xml

Add the following entry within your app’s AndroidManifest.xml:

<queries>
     <package android:name="com.amazon.sdktestclient" />
     <package android:name="com.amazon.venezia" />
 </queries>


2.2 OnePlus OneStore

The following steps are required to create an app build for OnePlus OneStore.

2.2.1 Add Dependencies

Add the following dependencies in the module/app level build.gradle:

implementation "com.onestorecorp.sdk:sdk-iap:21.01.00"

2.2.2 Update the root build.gradle / settings.gradle

Update the root build.gradle or settings.gradle based on the following:

pluginManagement {
    repositories {
        google {
            content {
                includeGroupByRegex("com\\.android.*")
                includeGroupByRegex("com\\.google.*")
                includeGroupByRegex("androidx.*")
            }
        }
	  maven { url "https://jitpack.io" }
	 maven { url = uri("https://repo.onestore.net/repository/onestore-sdk-public") }
        mavenCentral()
        gradlePluginPortal()
    }
 }
 dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
	  maven { url "https://jitpack.io" }
	  maven { url = uri("https://repo.onestore.net/repository/onestore-sdk-public") }
    }
 }

2.2.3 Update AndroidManifest.xml

Add the following entry within your app’s AndroidManifest.xml:

<queries>
    <intent>
        <action android:name="com.onestore.ipc.iap.IapService.ACTION" />
    </intent>
    <intent>
        <action android:name="android.intent.action.VIEW" />
	<data android:scheme="onestore" />
    </intent>
 </queries>

2.2.4 Add ProGuard Rules

Add the following rules to the ProGuard configuration only if ProGuard/R8 is enabled:

# Core proguard rules
 -keep class com.gaa.sdk.base.** { *; }
 -keep class com.gaa.sdk.auth.** { *; }

 # Purchasing proguard rules
 -keep class com.gaa.sdk.iap.** { *; }
 -keep class com.onestore.extern.licensing.** { *; }

Important

  • You should only add these rules if ProGuard/R8 is enabled.


2.3 Xiaomi GetApps

The following steps are required to create an app build for Xiaomi GetApps.

2.3.1 Add Dependencies

Add the following dependencies in the module/app level build.gradle:

implementation 'com.xiaomi.billingclient:billing:1.1.3'

2.3.2 Signed Empty APK

Xiaomi requires a signed empty APK for verification purposes.

1. now.gg Managed App Signing

If you opt for now.gg Managed App signing, you can skip this step. now.gg will sign your APK.

2. Sign with your Own Certificate

If you choose to sign the APK using your own certificate, follow the steps below:

  • Download the empty APK.
  • Sign it with your final signing certificate.
  • Share the signed empty APK on dev-support@now.gg with the subject line ‘Xiaomi – Signed Empty APK’.

Important Information

  • A signed empty APK is only required during initial submission.


2.4 Huawei AppGallery (Coming Soon)

The following steps are required to create an app build for Huawei AppGallery.

2.4.1 Native Android

1. Add Dependencies

Add the following dependencies in the module/app level build.gradle:

implementation 'com.huawei.agconnect:agconnect-core:1.5.2.300'
 implementation 'com.huawei.agconnect:agcp:1.9.1.303'
 implementation 'com.huawei.hms:iap:6.13.0.300'

2. Update the root build.gradle / settings.gradle

Update the root build.gradle or settings.gradle based on the following:

pluginManagement {
    repositories {
        google {
            content {
                includeGroupByRegex("com\\.android.*")
                includeGroupByRegex("com\\.google.*")
                includeGroupByRegex("androidx.*")
            }
        }
        maven {url 'https://developer.huawei.com/repo/'}
        mavenCentral()
        gradlePluginPortal()
    }
 }
 dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {url 'https://developer.huawei.com/repo/'}
    }
 }

3. Update AndroidManifest.xml

Add the following entry within your app’s AndroidManifest.xml:

<Application>
 <meta-data
     android:name="com.huawei.hms.client.appid"
     android:value="<HUAWEI_APP_ID>">
 </meta-data
 </Application>

Note: You can get the HUAWEI_APP_ID by reaching out to us at dev-support@now.gg.


4. Add ProGuard Rules

Add the following rules to the ProGuard configuration only if ProGuard/R8 is enabled:

-ignorewarnings
 -keepattributes *Annotation*
 -keepattributes Exceptions
 -keepattributes InnerClasses
 -keepattributes Signature
 -keepattributes SourceFile,LineNumberTable
 -keep class com.huawei.hianalytics.**{*;}
 -keep class com.huawei.updatesdk.**{*;}
 -keep class com.huawei.hms.**{*;}

Important

  • You should only add these rules if ProGuard/R8 is enabled.

2.4.2 Unity

Enable Custom Launcher Manifest.

To do this:

  • Go to Project Settings > Player > Build
  • Enable Custom Launcher Manifest Assets/Plugins/Android/LauncherManifest.xml, as shown below:
  • Update LauncherManifest.xml

    Add the following entry within your app’s LauncherManifest.xml:

    <Application>
     <meta-data
         android:name="com.huawei.hms.client.appid"
         android:value="<HUAWEI_APP_ID>">
     </meta-data
     </Application>
    

Note: You can get the HUAWEI_APP_ID by reaching out to us at dev-support@now.gg.



2.5 Samsung Galaxy Store

The following steps are required to create an app build for the Samsung Galaxy Store.

2.5.1 Update AndroidManifest.xml

Add the following entry within your app’s AndroidManifest.xml:

<uses-permission android:name="com.samsung.android.iap.permission.BILLING"/>
 <uses-permission android:name="android.permission.INTERNET"/>


3. Submit Final APK

After you prepare the final APK, upload your build to nowStudio.

To do this:

  • Create a Production Release.
  • Our operations team will review the app submission and contact you for any amendments/requirements.
  • Once verified, our team will upload your app build to various stores.
  • After the app is approved, you will be notified via email, and store-specific links will be available for reference under the release tab in nowStudio.

×
Text copied to clipboard
Link copied to clipbord
Questions? Please reach out to us at dev-support@now.gg