Skip to main content

GetEncryptUrl

AndroidiOSWindowsPS5
If you were looking for the method for use with Unity, see GetEncryptUrl for Unity 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

UFUNCTION(BlueprintCallable, Category = "INTLSDKAPI")
static FString GetEncryptUrl(const FString Url);

Input parameters

ParameterTypeDescription
UrlFStringURL

URL parameter structure

Encrypted fields encodeparam:

ParameterTypeDescription
openidFStringPlayer Network SDK unique user ID
tokenFStringPlayer Network SDK user token
uidFStringThird-party channel OpenID

Unencrypted fields:

ParameterTypeDescription
osFStringClient operating system
1 : Android
2: iOS
3: Web
4: Linux
5: Windows
6: Switch
gameidFStringPlayer Network assigned game ID
channelidint32The specified login channel, see Channel Definition
sdk_versionFStringPlayer Network SDK version
user_nameFStringUser name
tsFStringTime stamp
seqFStringSequence 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 kMethodIDWebviewGetEncryptURL.

Code sample

FString url = UINTLSDKAPI::GetEncryptUrl("http://www.facebook.com");