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
    • Cloud Store
    • BlueStacks Store
  • Alternative Stores
    • Samsung Galaxy Store
    • Xiaomi GetApps
    • ONE Store
    • Amazon Appstore
    • Huawei AppGallery (Coming Soon)

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 Samsung Galaxy Store

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

2.1.1 Add Libraries

From the nowSDK package that you downloaded, add the Samsung store-specific libraries to the libs directory of your project by following the steps below:
Note: The now.gg SDK package contains the Payments module, demo app, and sample code.

1. Extract the compressed nowSDK module and browse to Modules/Payments directory to locate the samsung_iap-release.aar file in the package:

 samsung_iap-release.aar

2. Add this provided .aar to the libs directory of your project:


2.1.2 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"/>


2.2 Xiaomi GetApps

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

2.2.1 Add Dependencies

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

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

2.2.2 Signed Build (Empty APK)

Xiaomi requires a signed empty APK for verification purposes. The following steps illustrate the process.

Important Information

  • A signed empty APK is only required during initial submission.
  • If your app is published on Google Play, it is recommended that you use the same keystore for build signing.
  • Unity Users: Unity integrates keystore signing via Edit > Project Settings > Player > Publishing Settings. Ensure the correct keystore and alias are set before building.
1. Download Empty APK

Click here to download the empty APK.

2. Generate a Keystore (if not already available)

The following sample command illustrates this process:

 keytool -genkey -v -keystore <your-release-key.keystore> -alias <your-key-alias> -keyalg RSA -keysize 2048 -validity 10000

Important Information

  • If your app is published on Google Play, it is recommended that you use the same keystore for build signing.
3. Sign the APK

The following sample command illustrates this process:

 jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore <your-release-key.keystore> <your-app.apk> <your-key-alias>
Flags Summary
-digestalg SHA-256 Ensures a strong hash algorithm for signing integrity.
-keystore your-release-key.keystore Uses the previously generated keystore for signing.
your-app.apk Replace with your actual APK filename.
your-key-alias This should match the alias used when generating the keystore.
4. Share Signed APK

Share the signed empty APK on dev-support@now.gg with the subject line ‘Xiaomi – Signed Empty APK’.



2.3 ONE Store

The following steps are required to create an app build for ONE Store.

2.3.1 Add Dependencies

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

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

2.3.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.3.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.3.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.5 Enable Global Publishing

ONE Store requires a signed output.zip to publish your app for regions outside Korea, including global distribution.

Workflow

  • We will provide you with an encryption key specific to your app.
  • You will use this key to generate output.zip by exporting and encrypting your private signing key.
  • Once generated, you’ll share the signed file with us for final deployment.
Follow the steps below to generate the output.zip:
1. Download the PEPK Tool

Download the Play Encrypt Private Key (PEPK) tool from one of the following:

Note: The PEPK tool is developed and provided by Google. It is intended for secure encryption of app signing keys and must not be modified or redistributed without proper attribution.

2. Generate output.zip

Run the following command to generate your encrypted output.zip file using the encryption key we provided. When prompted, enter your keystore and password:

$ java -jar pepk.jar --keystore=<your-keystore-file.keystore> --alias=<your-alias> --output=output.zip --include-cert --encryptionkey=<your-encryption-key>

Make sure to replace the following:

  • <your-keystore-file.keystore> – Your Java Keystore file
  • <your-alias> – Your key alias
  • <your-encryption-key> – The encryption key we provided
3. Share signed output.zip

Share the signed output.zip on dev-support@now.gg with the subject line ‘ONE Store – output.zip’.



2.4 Amazon Appstore

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

2.4.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.4.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.5 Huawei AppGallery (Coming Soon)

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

2.5.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.5.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.xmlAdd 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.



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