Additional Guides

This section contains additional guides associated with now.gg Cloud to help you configure our services and APIs conveniently.

Available Additional Guides

The following guides are available:




Cloud Storage Setup for Saving User State

Games typically save user’s progress locally on device files to maintain continuity across gaming sessions. now.gg provides this feature on the Cloud, ensuring seamless gaming experiences for users.

This section focuses on setting up the now.gg Cloud storage to save and restore the user’s game progress data by defining the save file path(s) and excluded file path(s).

Defining the ‘Save’ and ‘Excluded’ file path(s) is an essential practice that reduces the game’s loading time to enhance the user experience and ensure optimal usage of now.gg Cloud storage.

To set up the cloud storage, you should specify the following:

  • Save file path(s)
    Indicates the location of files or folders which should be saved on the cloud. Typically, the save files are stored in /data/data/<package_name>/<file_name>.
  • Excluded file path(s)
    Indicates the location of files and folders which you do not want to save on the cloud.

Configuring File Paths

You can configure this setting for any new app you release now.gg Cloud. In case your app is already released, you will need to release a new version of your app.

To configure the file paths:

  • Log in to the nowStudio.
  • You can either:
  • On the ‘App Contents’ tab:
    • Provide the Save File Path(s) and the Excluded File Path(s):
    • Click on Save.
  • Click on Release on the left navigation.

Note:

  • If you have multiple file paths, separate each of them with a new line instead of spaces or commas.
  • For save file paths, only the files and folders you specify will be saved and restored for the next user session.
  • For excluded file paths (Optional), the files and folders you specify will not be saved on the cloud.

Important Information

  • The game’s loading time depends on the size of the game data to be restored for the user session.
    • For a seamless app experience, we recommend an ideal save file(s) size of up to 15 MB.
      • The file size recommendation applies to a single file or the combined size of multiple files.
    • Including larger file(s) may impact the game’s loading time.
  • We recommend avoiding the usage of any Android identifiers, such as Android id, within the app, for a better experience.



Preparing App Files

Using this guide, you can prepare your app files to upload on nowStudio.

To create a release with nowStudio, you need to prepare your app files. We accept either a standalone APK or an APK and Assets Zip file.

You can prepare either of the following:

  • Standalone APK File
    • You can provide a full APK containing all Assets.
  • APK and Assets Zip Archive
    • Games typically download necessary assets at launch, causing delays in gameplay. With now.gg, you can provide a Zip containing the APK and Assets to significantly reduce the game loading time and enable instant gameplay for the user.

1. Prepare an APK File

This section provides instructions to prepare an APK file to upload on nowStudio.

Prepare an APK file that adheres to the following requirements:

  • A 64-bit Android app for ARM.
  • A full APK containing all Assets.

After you have prepared your APK, you can continue to add your app on nowStudio.


2. Prepare an APK and Assets Zip Archive

This section provides instructions to prepare the APK and Assets Zip archive for your app/game on nowStudio.

Games typically download necessary assets at launch, causing delays in gameplay. With now.gg, you can provide a Zip containing the APK and Assets to significantly reduce the game loading time and enable instant gameplay for the user.

Process

1. Create the Bundle (Zip Archive)

You should follow the specified format and contents below to create the zip archive of your App and Assets:

  • APK file
  • metadata.json
  • Assets directory
    • Asset1
    • Asset2
    • OtherAssets (file or directory)
  • Obb directory
    • main.<package version code>.<package name>.obb
    • patch.<package version code>.<package name>.obb
For your reference, here is a sample representation of the Game APK + Assets Bundle:

Important Information

  • The Assets folder in your App bundle can have multiple objects.
    • These can include any files or directories.
  • We recommend that you provide us with either Assets or Obb or both, depending on your preference. However, either one of these is mandatory to successfully process your upload.

2. Create Manifest File

The following sample JSON illustrates the required format for the manifest file metadata.json:

{
    "assets": [
        {    
            "name": "asset1.xyz",
            "location": "/data/media/0/Android/data/<packageName>/files"
        },
        {
            "name": "asset2.unity3d",
            "location": "/data/media/0/Android/data/<packageName>/files"
        },
        {
            "name": "OtherAssets",
            "location": "/data/data/<packageName>/files"
        }
    ]
}

3. Add Your App

After you have prepared the APK and Assets Zip archive, you can continue to add your app on nowStudio.




Add and Configure Custom Domain

This guide details the process of adding a custom domain for your apps if you want to host them on domains other than now.gg.

In addition to now.gg Cloud, you can also host your apps on other domains by adding a custom domain for your apps on nowStudio.

The following scenarios are explained:

  • Add a custom domain for a new app.
  • Add a custom domain for a published app.

1. Add a Custom Domain for a New App

This section explains the steps to add a custom domain for a new app.

To do so:

  • After you have added a new app.
  • Select your app from the All Apps section.
    • Click on View Details in front of your app name.
  • Within the Production section, click on Information.
  • Enter the custom domain address in the given field, as shown below:

    Note: Make sure you own the domain that you wish to add.
  • Please ensure you fill out the other required details.
  • Click on Save.
    • Our team will verify the domain details you have provided. Once the domain details have been verified, you can continue mapping your domain.
  • After you have provided all the required app information, you can continue to create a release for your app.
  • After receiving the mapping details, you can view them by clicking on ‘Mapping details’ within the ‘Information‘ tab, as shown below:
  • The domain mapping details are provided, as shown below:
  • You can configure your DNS provider using the provided details.
  • After you perform the provided configuration with your DNS provider, your game will be available on your domain.


2. Add a Custom Domain for a Published App

This section explains the steps to add a custom domain for an already published app.

To do so:

  • Select your app from the All Apps section.
    • Click on View Details in front of your app name.
  • Within the Production section on the left sidebar, click on Information.
  • Click on the Edit button in the bottom right.
    (This will enable you to edit the provided fields)
  • Enter the custom domain address in the given field, as shown below:

    Note: Make sure you own the domain that you wish to add.
  • Click on Save.
  • A confirmation will be displayed on-screen, as shown below:
  • Our team will verify the domain details you have provided. Once the domain details have been verified, you can continue mapping your domain.
  • After receiving the mapping details, you can view them by clicking on ‘Mapping details’ within the ‘Information‘ tab, as shown below:
  • The domain mapping details are provided, as shown below:
  • You can configure your DNS provider using the provided details.
  • After you perform the provided configuration with your DNS provider, your game will be available on your domain.



Upload App using Nowgg CLI

nowgg CLI is a command-line tool that lets you easily upload your app builds to nowStudio. This guide details this functionality.

Prerequisites

  • App ID
    • Used to identify the App on nowStudio.
    • Your App ID can be found under the App Details section of nowStudio.
  • Publisher Token
    • Used to identify the publisher company.
    • Your Publisher token is available under the Account Information section of nowStudio.

Using nowgg CLI

Open any terminal on macOS or Windows.

Install and Initialize

1. Install nowgg CLI tool

  pip install nowgg

2. Initialize nowgg CLI

  nowgg init --token "<your_publisherToken_from_nowStudio>"

Upload app to nowStudio using nowgg CLI

1. Upload App to App Library

  nowgg upload --app_id <your_app_id> --file_path "/directory/sample.apk" --apk_version <app_version_name> --version_code <app_version_code>

Note: Your app will be uploaded to the App Library within nowStudio.

2. Upload App to Test Track and Trigger Deployment

  nowgg upload --app_id <your_app_id> --file_path "/directory/sample.apk" --apk_version <apk_version> --version_code <app_version_code> --deploy 

Important Information

  • Each test track has a unique app_id that you can use to create a draft release on that test track.
    • For example, if your app_id is 1234, the app_id for test track 1 would be 1234_t1.
  • --deploy triggers the deployment process on the test track identified using app_id.

Help

  nowgg -h
   nowgg init -h
   nowgg upload -h

Important Information

  • While running the nowgg command, If you receive a ‘command not recognized’ error, consider adding <python directory>\<Scripts> to your PATH.
  • If you receive any ‘permission-related errors’, you should run the commands as an Administrator.



Understanding Subscriptions

The following document focuses on important aspects of the subscription capability offered by nowStudio.

Subscriptions are in-app products on now.gg that charge users a recurring fee for access to content or services within your app.

nowStudio offers a versatile ‘Subscriptions’ capability that enables you to create, manage, and sell subscriptions effortlessly. The primary distinction between an in-app product and a subscription product is that an in-app product incurs a one-time charge for the user, whereas subscriptions involve recurring charges.

To understand how to create and manage subscriptions in nowStudio:

To understand how to implement subscriptions in your app using now.gg Payments module, follow these guides:

Important: In addition to the information on this page, you should also refer to now.gg policy.

Overview of Subscriptions

This section introduces subscriptions.

  • Subscription
  • Billing Period
    • Auto Renewals
  • Benefits
  • Pricing
    • Price changes

Subscription

A subscription offers a set of benefits that users can access for a specified time period. You can have multiple subscriptions within the same app to represent different benefit sets or tiers of a single benefit set, such as ‘Gold’ and ‘Diamond’ packs. Users gain access to a subscription by purchasing it through your app on now.gg.


Billing Period

now.gg enables you to select the duration of the subscription. The available billing periods are:

  • Every 4 weeks
  • Monthly
  • Every 2 months
  • Every 3 months
  • Every 4 months
  • Every 6 months
  • Every 8 months
  • Yearly

Auto Renewals

now.gg subscriptions are auto-renewing. Users can purchase a subscription for a specified billing period, with automatic renewals at the end of each period, ensuring an uninterrupted subscription experience until cancelled. Subscriptions can be cancelled by the user, developer, or now.gg.


Benefits

You can add up to four benefits to your subscription, helping users understand what they will receive. You should highlight the core benefits relevant to your subscription.


Declined Payments

If a renewal payment is declined, now.gg will prompt the user to resolve the payment issue. If unresolved, the subscription will automatically expire.




Enable Cloud Gameplay on your Website with Embed Module

now.gg Embed Javascript Module provides a framework that enables you to seamlessly embed cloud gameplay on your website.

With now.gg Embed Module, you can:

  • Easily embed gameplay on any webpage.
  • Implement advanced functionality with embedding to enable event-driven communication between your app and the webpage where the gameplay is embedded.
  • Get better exposure for your games to increase user engagement and retention with embedded gameplay on your website.

Prerequisites

The following prerequisites must be met before integrating with now.gg Embed Module:

  • Whitelisted Domains – The now.gg Embedding will only work on Domains that are whitelisted by us. Please contact us at dev-support@now.gg with the list of Domains you wish to whitelist.
  • clientId – To get your clientId, please contact us at dev-support@now.gg.
  • appId – To get your appId, please follow the steps illustrated here.

Once the prerequisites are met, you can continue to the next section to embed gameplay on your webpage.


Implement Embed Module

To enable cloud gameplay on your website using now.gg Embed Module:

  1. Add Embed Module to your website.
  2. Start the game in an Iframe.
  3. Additionally, you can implement advanced functionality with embedding using the next section.

Important Information

  • Ensure your game is deployed on either the Testing or Production track and you have the game link for embedding.
  • You can follow the following links to create a release and deploy your app:

1. Add Embed Module

The first step is to add the Embed Module to your website.

To add the now.gg Embed Module to your website, add the Module resource javascript in a script tag, as illustrated below:

<script type="text/javascript" src="https://cdn.now.gg/external/sdk/ifp-sdk-1.0.0.min.js"></script>

2. Start the Game in an Iframe

After the now.gg Embed Module resource has been added, you can initialize the Module to embed gameplay on your website using now.gg Embedding.

To do this:

  • Start by defining the iframeParentElement, the appEventCallbackFunction, and the sdkEventCallbackFunction.
  • Now, call the init function of the NowIfp class along with the required parameters to start the cloud game, as illustrated below:
const iframeParentElement = document.getElementById("your_iframe_element");

// Callback function to handle events sent from the Android app.
const appEventCallbackFunction = (event) => {
    console.log(event.name); 
    console.log(event.data);
    // can do your event-based handling here
}; 

// Callback function to handle javascript Module events.
const sdkEventCallbackFunction = (event) => {
    console.log(event.name); 
    console.log(event.msg);
    // can do your event-based handling here
}; 


NowIfp.init({
    clientId: <"your_clientId"> ,
    appId: <"your_production_appId/your_test_track_appId"> , \\ appId example - Test Track: "1234_t1" | Production: "1234"
    iframeParentElement: iframeParentElement,
    customData: {} // for app-specific custom handling
    appLaunchData: {
        // pass launch arguments to Iframe, It will be serialized and passed to the app at launch intent.
        [key]: [value]
    } 
    appEventCallback: appEventCallbackFunction,
    sdkEventCallback: sdkEventCallbackFunction,
});

Get your appId

Using this section, you can locate your appId within nowStudio.

Important Information

  • appId is a unique identifier for your app on nowStudio.
  • nowStudio generates different appId for your app on testing and production environments.
    • For Testing tracks, appId will be visible only after the app is deployed.
    • For Production, appId is also available under the App Details section after you add your app.
1. appId for Test Track
  • To locate appId for test track:
  • Navigate to All Apps > Select your app > Test Track
    • appId is listed on the live test release, as shown below:
2. appId for Production
  • To locate appId for production track:
  • Navigate to All Apps > Select your app > Release.
    • appId is listed on the live production release, as shown below:

Parameters

Params Type Required Summary
clientId string Yes Unique client identifier.
appId string Yes App ID associated with your app/game on nowStudio. nowStudio generates different appId for production and testing environments. Example – Production appId: “1234″. Test Track appId: “1234_t1″.
iframeParentElement element Yes The iframeParentElement in which the embedded player will be rendered.
customData object No Any app-specific data that you wish to pass to now.gg backend.
appLaunchData object No Extra data that is sent as app launch intent extras. – ReferDefine appLaunchData section.
appEventCallback function No App Event callback function for App-related events handling. ReferStart Game in Iframe section.
sdkEventCallback function No Module Event callback function for Module-related events handling. ReferStart Game in Iframe section.

Your game is now embedded on your web page, powered by the now.gg Cloud.


Advanced Functionality with Embedding

This section explains the steps to implement advanced functionality with the embedded game on your website (HTML page).

To further enhance the gameplay experience of your embedded game, now.gg Embed Module enables you to:

  • Pass events and data from your App on now.gg Cloud to your HTML page, and
  • Pass app launch parameters to your App on launch.
Prerequisite
  • Please download and integrate the now.gg Events module with your Android App to enable the following functionality.

1. Pass Events from your App to your HTML page

After you have integrated with now.gg Events module, you can pass events and data from your App on now.gg Cloud to your HTML page where the game is embedded.

Please refer to:

  • Send Events and Data to the HTML Page section of now.gg Events Module Documentation.

2. Pass Parameters from your HTML page to your App on Launch

You can now pass app launch parameters to your App from your HTML page. We have provided sample code snippets to define appLaunchData that is passed to NowIfp.init and to retrieve it in your App.

a. Define appLaunchData

The appLaunchData is passed as a parameter to the NowIfp.init(), which passes it to the App as a launch intent parameter. The following code illustrates how to pass appLaunchData to NowIfp.init().

NowIfp.init({
     clientId: <"your_clientId"> ,
     appId: <"your_appId"> ,
     iframeParentElement: iframeParentElement,
     customData: {} // for app-specific custom handling
     appLaunchData: {
           [key]: [value]
     } 
      // pass launch arguments to Iframe as it's at launch, It will be serialized and passed to the app at launch intent.
     appEventCallback: appEventCallbackFunction,
     sdkEventCallback: sdkEventCallbackFunction,
 });
b. Retrieve appLaunchData in your App

With this step, your App can retrieve the appLaunchData, which was sent from your HTML page to your App.

The following code snippet showcases how to retrieve the value using key from your App, as illustrated below:

//Retrieves the value using key passed as app launch parameter
 string value = NowGGEventsSdkManager.Instance.GetAppLaunchDataProperty(key);

Please refer to:

Important Information

  • The appLaunchData is only passed at App launch and cannot be passed when the App is running.

Demo Project

This section showcases a demo HTML page for the now.gg Embed Module, and explains the end-to-end flow associated with the Embed Module.

Please go through the Embed Module demo by following the steps below:

  • Click here to launch now.gg Embed Module Demo
  • The Embed demo showcases:
  • App Launch Data
    • If you wish to add any appLaunchData with launch intent:
    • Click on the + button.
    • You can provide your input through the Key and Value fields.
  • Module Init
    • Click on the Initialize Embed Module button to initialize the Module and launch the cloud game.
    • The initialization events are captured by sdkEventCallback, as shown below.
    • After successful initialization, the embedded game starts running, as shown below:
  • Send Data from Unity to HTML(web client)
    • Open Link
      • The open link button will open the provided link in a new tab.
    • Browser Event
      • The browser event button will send the data from Unity to the HTML page, which you can handle as per your implementation.
      • The App events are captured by the appEventCallback function, as shown below:



×

Table of Contents

Additional Guides

Table of Contents

  • Getting Started
  • Additional Guides

Document Rev. 1.0

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