Skip to main content

GetEncryptUrl

AndroidiOSWindowsPS5
If you were looking for the method for use with Unreal Engine, see GetEncryptUrl for Unreal Engine SDK.

Encrypts the specified URL, adds the login state, and returns the encrypted URL. This synchronous interface does not require a result in the callback.

Use case

GetEncryptUrl is mainly used to open marketing campaign webpages and pass the login state to the webpages. Games call the interface and input 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 endpoint to get 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

public static string GetEncryptUrl(string url);

Input parameters

ParameterTypeDescription
urlstringURL

URL parameter structure

Encrypted fields encodeparam:

ParameterTypeDescription
openidstringPlayer Network SDK unique user ID
tokenstringPlayer Network SDK user token
uidstringThird-party channel OpenID

Unencrypted fields:

ParameterTypeDescription
osstringClient operating system
1 : Android
2: iOS
3: Web
4: Linux
5: Windows
6: Switch
gameidstringPlayer Network assigned game ID
channelidintThe specified login channel, see Channel Definition
sdk_versionstringPlayer Network SDK version
user_namestringUser name
tsstringTime stamp
seqstringSequence ID
info

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

Observers

The callback processing interface is WebViewResultObserver.
The callback data structure is WebviewResult.

The callback methodID is INTL_WEBVIEW_GET_ENCRYPT_URL.

Code sample

string url = INTLAPI.GetEncryptUrl(MY_WEBVIEW_URL);