Skip to main content

Get Encrypted Ticket (GetEncodeUrl)

[Player Network SDK & MSDK] Acquires encrypted ticket.Encrypts the specified URL, adds login status information, and returns the encrypted URL.This is a synchronous interface, no need to obtain the result in the callback.

Supported Platforms

Supports Android, iOS, Windows platform.
note

MSDK does not support Windows at this time.

Use Case

GetEncryptUrl is mainly used to open the marketing event webpage and pass the login status to the webpage. The game calls the interface and enters the original URL, which returns an encrypted URL with login status. Users open web pages through the interface of the OpenUrl web view module. The URL for additional parameters (encodeparam) is sent to the backend API to obtain login status information.

info

The GetEncryptUrl interface requires login before it can return gameid and channelid information.

Example of an encoded 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

ParametersTypeDescription
urlstringLink address

Composition of URL parameters

Encrypted field (encodeparam):

ParametersTypeDescription
openidstringAccount openid
tokenstringAccount token
uidstringThird-party channel openid

Non-encrypted fields:

ParametersTypeDescription
OSstringClient operating system
1 : Android
2: iOS
3: Web
4: Linux
5: Windows
6: Switch
gameidstringID assigned to the game by the SDK
channelidintLogin channel
sdk_versionstringSDK version
user_namestringUser Name
tsstringTimestamp
seqstringSequence number
info

The above fields do not need to be passed; they can be obtained after Player Network SDK login.

Callback Handling

The callback handling interface is GUAWebViewResultObserver.The callback data structure is GUAWebViewRet.

The callback event is WebViewRetEvents. Callback ID is GUA_WEBVIEW_GET_ENCRYPT_URL.

Code Example

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