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 SDK enables you to:
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.
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.
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, });
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 – Retrieve app Launch Data section of now.gg Events Module Documentation.
appLaunchData
is only passed at App launch and cannot be passed when the App is running.Document Rev. 1.0