Skip to main content

GetEncodeUrl

[Player Network SDK & MSDK] Encrypts the specified URL, adds login state, and returns the encrypted URL. This synchronous interface does not require a result in the callback.

Supported Platform

Supports Android, iOS, Windows platform.
note

MSDK currently does not support Windows.

Use case

GetEncryptUrl is mainly used to open marketing campaign webpages and pass the login state to the webpages. Games call the interface and inputs the original URL, and the encrypted URL with login state is returned. The user opens the webpage through the OpenUrl interface of the WebView module. The URL with an additional parameter (encodeparam) is passed to the backend API to get the login state information.

info

GetEncryptUrl interface requires user login to return the gameid and channelid information.

Example of encrypted URL:

https://www.youtube.com/?gameid=11&os=1&ts=1597840414&version=0.1.000.0001&seq=11-42e0e9d2-2f0e-4b01-a1ab-6831cf9b6165-1597840414-11&encodeparam=4060E2A762B31B8B57A8D5A9BBAF10E8657A5A3A285B0DA7159417C2D6F0D801

Function Definition

string GetEncodeUrl(string url);

Input Parameters

ParameterTypeDescription
urlstringURL

URL parameter structure

Encrypted fields (encodeparam):

ParameterTypeDescription
openidstringAccount OpenID
tokenstringAccount token
uidstringThird-party OpenID

Unencrypted fields:

ParameterTypeDescription
osstringClient operating system
1 : Android
2: iOS
3: Web
4: Linux
5: Windows
6: Switch
gameidstringSDK assigned game ID
channelidintThe specified login channel
sdk_versionstringSDK version
user_namestringUsername
tsstringTime stamp
seqstringSequence ID
info

Do not enter the above fields. Player Network SDK will get the information after user login.

Callback Processing

The callback processing API is GUAWebViewResultObserver. The callback data structure is GUAWebViewRet.

The callback event is WebViewRetEvents. The callback methodID is GUA_WEBVIEW_GET_ENCRYPT_URL.

Code Sample

string url = UnionAdapterAPI.GetWebViewService().GetEncodeUrl("http://www.facebook.com");