References

This document features the method references for now.gg Utility Module for Native Android and Unity.

Native Android

Public Class

public class UtilitySDK {
     private static UtilitySDK instance;

     private UtilitySDK() {
     }
 }

Public Methods

The following are the public methods associated with UtilitySDK class:

Method – Type  Usage Description
public static UtilitySDK getInstance() Returns an instance of the UtilitySDK class.
public boolean isRunningOnNowGG(Context application) Returns true if the application is running on now.gg.
public void openUrl(String url, Context context) Opens the given URL in a new browser window.
public DeviceType getDeviceType(Context application) Return the device type on which the application is running.
– Smartphone
– Tablet
– Desktop
– Unknown (Shown if the device type is not detected).

Definition

DeviceType

public enum DeviceType {
    SMARTPHONE,
    TABLET,
    DESKTOP,
    UNKNOWN
 }

Method References

This section illustrates the references related to now.gg Utility Module for Native Android.

openUrl()

The openUrl method is used to open the specified URL in a new browser window of the user’s device.

Returns – void.

Params Type Summary
url string Opens the provided URL in a new browser window.

isRunningOnNowGG()

The isRunningOnNowGG() method is used to detect whether the app is running on now.gg platform or not.

Method Type Summary
isRunningOnNowGG boolean Returns whether the app is running on the now.gg Platform or not.

getDeviceType

The getDeviceType() method is used to identify the user’s device type.

Params Type Summary
getDeviceType DeviceType Returns the user’s device type.
– SMARTPHONE
– TABLET
– DESKTOP
– UNKNOWN (Shown when the device type cannot be detected).



Unity

This section illustrates the references related to now.gg Utility Module for Unity.

Public Class

public class UtilitySDK {
     private static NowGGUtilitySdkManager instance;
 }

Public Methods

The following are the public methods associated with UtilitySDK class:

Method – Type  Usage Description
public static NowGGUtilitySdkManager Instance Returns an instance of the UtilitySDK class.
public boolean IsRunningOnNowGG() Returns true if the application is running on now.gg.
public void OpenUrl(string url) Opens the given URL in a new browser window.
public DeviceType GetDeviceType() Return the device type on which the application is running.
– SMARTPHONE
– TABLET
– DESKTOP
– UNKNOWN (Shown if the device type is not detected).

Definition

DeviceType

public enum DeviceType {
    SMARTPHONE,
    TABLET,
    DESKTOP,
    UNKNOWN
 }


Method References

OpenUrl()

The OpenUrl method is used to open the specified URL in a new browser window of the user’s device.

Returns – void.

Params Type Summary
url string Opens the provided URL in a new browser window.

IsRunningOnNowGG()

The IsRunningOnNowGG() method is used to detect whether the app is running on now.gg platform or not.

Method Type Summary
IsRunningOnNowGG string Returns whether the app is running on the now.gg Platform or not.

GetDeviceType

The GetDeviceType() method is used to identify the user’s device type.

Params Type Summary
GetDeviceType string Returns the user’s device type.
– SMARTPHONE
– TABLET
– DESKTOP
– UNKNOWN (Shown when the device type cannot be detected).
×

Document Rev. 1.0

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