GetEncryptUrl
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.
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
Parameter | Type | Description |
---|---|---|
url | string | URL |
URL parameter structure
Encrypted fields encodeparam
:
Parameter | Type | Description |
---|---|---|
openid | string | Player Network SDK unique user ID |
token | string | Player Network SDK user token |
uid | string | Third-party channel OpenID |
Unencrypted fields:
Parameter | Type | Description |
---|---|---|
os | string | Client operating system 1 : Android 2: iOS 3: Web 4: Linux 5: Windows 6: Switch |
gameid | string | Player Network assigned game ID |
channelid | int | The specified login channel, see Channel Definition |
sdk_version | string | Player Network SDK version |
user_name | string | User name |
ts | string | Time stamp |
seq | string | Sequence ID |
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);