Get Encrypt Ticket (GetEncryptUrl)
Gets 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.
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 inputs the original URL, returning the encrypted URL with login status.Users open web pages through the interface of the OpenUrl web view module.URL with additional parameter encodeparam will be passed to the backend API interface to obtain login status information.
The GetEncryptUrl interface requires login to return information on gameid and channelid.
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);
Parameter Explanation
| Parameters | Type | Description |
|---|---|---|
| url | String | Link address |
Composition of URL Parameters
Encrypted field encodeparam:
| Parameters | Type | Explanation |
|---|---|---|
| openid | string | Player Network SDK user identification |
| token | string | Player Network SDK user token |
| uid | string | Third-party channel OpenID |
Non-encrypted fields:
| Parameters | Type | Explanation |
|---|---|---|
| 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 | For login channels, please see Channel Definition |
| sdk_version | String | Player Network SDK version |
| user_name | string | Username |
| ts | string | Timestamp |
| seq | string | Sequence number |
The above fields do not need to be input; they can be obtained after Player Network SDK login.
Callback Handling
The callback interface is WebViewResultObserver.
The callback data structure is WebviewResult.
Callback ID is INTL_WEBVIEW_GET_ENCRYPT_URL.
Code Sample
string url = INTLAPI.GetEncryptUrl(MY_WEBVIEW_URL);