If the applications will live on the QIYU store, the Online Subsystem QIYU must be enabled. Otherwise, the application will be refused when uploading to QIYU platform.
If you want to use the functions of QIYU platform, you must initialize QIYU SDK, please refer to the figure 5.1.
Please write the parameters into Plugins-Online Subsystem QIYU-Platform.
Fig 5.1 Platform Initializaiton
Parameters description:
App ID, App Secret: Please log in to the adventure developer website and click "Release management - Application Management" to create your application. The system will generate a unique App ID and App Secret for each application.
After created the application, press the API to check the App ID and App Secret.
Configuration Files
To use Online Subsystem QIYU Plugin, the AndroidEngine.ini should be found at YourProjectDir/Config/Android/, and add or modify the following information below:
The following functions is to get the QIYU account information and status.
Blueprint
Function name
Blueprint
Introduction
Old Interface(Deprecated)
Is Logged In
Request the status of account login Input: In Player Controller :Player controller Output: True:Account is logged in False: Account is logged out
RequestisAccountLogin
GetQIYUIdentity
Request Account Information: Input: In Player Controller :User controller Output: Results: Return user information Error:Error code when fail to call Was Successful:Whether success to call the API
If you have two separate applications: for example, one single play game and one multiayer game. If you want to achieve deep link between the two applications, user can add the multiplayer game through the single game. Deep link needs to be integrated both in request and target application. Please refer to the following functions:
Blueprint
Function name
Blueprint
Introduction
Old Interface(Deprecated)
Deeplink
Gain the Deeplink information: Output: Result: Return DeepLink information Code: Return Code Was Successful: Call the APIs whether success or not Result node:
RequestDeepLinkParam
LaunchOtherApp
Launch to other application: Input: Appid : Deeplink APPID Key : Deeplink Key (Note: The arguments of Key are small letters.) Value : Deeplink value
RequestLaunchOtherApp
LaunchHome
Launch Home: Input: Key :The key of launch application(launch the login page when the key value is login) Value: The value transfer to home
RequestLauchHome
C++
Request get Deep Link Information
The APIs is Asynchronous, please refer to the following example:
Launch info page of the application which the appid is 123456
"login"
""
Launch login page
"dlc"
"123456"
Launch the page of DLC which SKU is 123456
Deeplink Return Code
Return Code
Reason
S0000
Success
S9000
System Error
# 5.4 Qiyu PlayerPrefs (A requirement to pass our QA Review)
If your APP has player prefs, please use QiyuPrefs. QiyuPrefs is a class that stores player preferences between game sessions - note that this is not related to Cloud Saving. QiyuPrefs also allows applications to retain existing Player preferences after version upgrades, uninstalls and reinstalls. Please remember to call the Prefs_Save() function when exiting the game or when you need it.
Function name
Blueprint
Introduction
Prefs_GetFloat(FString Key,float DefaultValue)
Return the float value of key, if not exit, return defValue
Prefs_GetInt(FString Key,int32 DefaultValue)
Return the Int value of key, if not exit, return defValue
Prefs_GetString(FString Key,FString DefaultValue)
Return the String value of key, if not exit, return defValue
Prefs_SetFloat(FString Key,float Value)
Set the float value of Key
Prefs_SetInt(FString Key,int32 Value)
Set the Int value of Key
Prefs_SetString(FString Key,FString Value)
Set the String value of Key
Prefs_HasKey(FString Key)
If the Key is exit return True Otherwise, return False
Prefs_Save()
Save should be called when finishing the modification
Prefs_DeleteAll()
Delete all the PlayerPrefs
Prefs_DeleteKey(FString Key)
Delete the Key in the PlayerPrefs
Note:
QIYU devices support multiple accounts, so when using the PlayerPrefs solution, the Prefs data should be linked with the Qiyu Account's UserID to achieve the right Prefs data for each user.
In-APP purchases (IAP) allow users to purchase content including visual products, game currency, additional levels, blood strip and so on. Developer can define the item for Purchase on QIYU platform, and then integrate into the game via SDK APIs. IAP allow users to purchase content including visual products, currencies and so on. Developer can define the item for Purchase on QIYU platform, and then integrate into the application via SDK APIs. IAP only support 'application' but not 'game'.
QIYU purchase is using SMS link to finish the payment with Wechat pay or Ali-pay, the main flow chart is shown below, you can refer to QIYU SDK Demo to finish the IAP integration.
Get items list: Input: Product Identifiers: Items sku array, the all items will be outputted when the array is null Output: In APP Offer Information:Return item array including all the informance of items.
Items information: offer id:Item SKU Title:Item title Regular Price:Item discount price (Minimum Unit is cents) Numeric Price:Item original price (Minimum Unit is cents) Dynamic Dields:Item extra attribute, which is mapping type, and the value of ItemType is item type, For example:
C++
void FTestStoreInterface::Test(UWorld* InWorld, const TArray<FString>& InOffersIds)
{
auto OnlineSub = Online::GetSubsystem(InWorld, TEXT("QIYU"));
if (OnlineSub != nullptr)
{
if (OnlineSub->GetIdentityInterface().IsValid())
{
LocalUserId = OnlineSub->GetIdentityInterface()->GetUniquePlayerId(0);
}
if (LocalUserId.IsValid())
{
if (OnlineSub->GetStoreV2Interface().IsValid())
{
for (const FString& OfferId : InOffersIds)
{
RequestOfferIds.Add(FUniqueOfferId(OfferId));
}
OnlineSub->GetStoreV2Interface()->QueryOffersById(*LocalUserId, RequestOfferIds,
FOnQueryOnlineStoreOffersComplete::CreateRaw(this, &FTestStoreInterface::OnQueryOnlineStoreOffersComplete));
}
}
}
}
Note: The unit of items price should be minimum, for example, the price should be set as 12.00 RMB rather than 12 RMB, and developers can exchange the unit by requirement in coding.
Order Result: Input: In Order Id: The order id will be returned when successful order output: Results: Return order details Code: the return code Was Successful: Check the result
Order details: Output: Order Id: Order ID Pay Date: Payment time Sku: the item sku Order Status: Order status Paid Amount: Minimum unit is cent
Note: The unit of items price should be minimum, for example, the price should be set as 12.00 RMB rather than 12 RMB, and developers can exchange the unit by requirement in coding.
Check the history order: Input: In Sku Id: The item Sku which need to be checked In Page: Check page In Page Size: the mount pages Output: Results: Return order details array Was Successful: Check whether successful or not Code: Return code
Order details: Order Id: Order ID Pay Date: Payment time Sku: Paid item sku Order Status: Order status Paid Amount: Minimum unit is cent
Note: The unit of items price should be minimum, for example, the price should be set as 12.00 RMB rather than 12 RMB, and developers can exchange the unit by requirement in coding.
The DLC can be created, configured and edited on QIYU Developer Portal (opens new window)(opens new window), and integrated into games via SDK APIs. After passing the content review, the DLC can be sold on QIYU store. Users can purchase virtual coins, new missions, maps or media sources in the QIYU store. After entering the game, the new mission will be unlocked and the new resource will be downloaded. you can refer to the following flow chart to finish the DLC integration.
SDK provides the following APIs, supports application to verify and download the DLC:
Initialization
Function Name
Blueprint
Introduction
Init QIYUDLC
Initialize DLC out: Code: Return Code
Return Code
Reason
S0000
Success
S1000
Platform has not been initialized or the initialization is failed
S9000
System error
S9001
Parameter error
Get DLC List
Function Name
Blueprint
Introduction
Get Assets List
Get DLC List in: In Cur Page: Page number of paged query (The page number must bigger than 0, the default page is 1) In Page Size: Set amount of Add-ons per page (The number should be larger than 0, default number of DLCs per page is 10) out: Results: Return DLC Code: Return code
Sku: SKU code Name: DLC name Type:DLC type: 1 is Durable. 2 is Consumable ChargeType: payment type: 0 is Free. 1 is Paid IconUrl: DLC icon URL OriginalPrice: Original Price(Unit is cent in RMB) SalePrice: Sale price (Unit is cent in RMB) ShortDescription: DLC description
Return Code
Reason
S0000
Success
S1001
Not initialized
B1001
The result is null
S9000
System error
S9001
Parameter error
Get the status of DLC of current user (Applies to Durable DLC)
Function Name
Blueprint
Introduction
Get Assets Status
Get the status of DLC of current user (include check entitlement) in: In Sku: SKU of DLC out: Result: Callback Code: Return Code
Sku: SKU Type:DLC type: - 1 is Durable. - 2 is Consumable // Download status of current DLC DownloadStatus: - Available: able to download - InProgress: downloading - Downloaded: have already downloaded - Pause: pause Purchased: whether purchased or not FilePath: The path of downloaded DLC
Return Code
Reason
S0000
Success
S1001
Not initialized
B1001
The result is null
S9000
System errors
B4015
The entitlement check of Consumable DLC is not supported
B1003
The user account is expire
B4000
Fail to verify the application
B4013
Fail to verify the DLC
Download DLC
Function Name
Blueprint
Introduction
Download Asset
Download DLC (include check entitlement) in: In Sku: The SKU of DLC which is going to download out: Code: Return code
Return Code
Reason
S0000
Success
S1001
Not initialized
C1002
Memory space is inadequate
C1005
Resource does not exist
B4015
Not support the entitlement check for consumable DLC
B1003
The user account is expire
B4000
Fail to verify the application
B4013
Fail to verify the DLC
B3033
DLC version is wrong
Tips:
Please call the GetAssetStatus firstly to verify the user purchased or obtaion your DLC legitimately before call the download API. When a purchased DLC is not downloaded or new version is available, the result of downloadStatus is AVAILABLE, then you should remind users to download or update the DLC.
DLCs can be downloaded in the background when users turn off the home page (not exit the application). Downloading is interrupted when the application exits completely. After restarting the application, you may need to check status and decide whether to continue the download. if the download is not complete, please call the DownloadAsset to continue to download.
Get download progress
Function Name
Blueprint
Introduction
Set Download Update Notification
Set Download Update Notification in: Notifications: The event point
Downloaded notification, can be used in every second SKU: The SKU of downloading DLC Now: the size of downloaded file, Unit is MB Total: Target size, Unit is MB Code: Return code Path: If success to verify MD5, return the path of file
Return Code
Reason
S0000
Success
S1001
Fail to verify MD5
C1002
Fail to write, Memory space might be inadequate
C1003
Receiving data has been interrupted, the network could be disconnected
C1004
Fail to query connection with server
C1006
The DLC is downloading
C1007
Repeat downloading query
C1008
Verifying MD5
C1000
System error
Unzip File
Function Name
Blueprint
Introduction
Unzip File
Quary the unzipped format file in: InPath: The path of file which needs to be unzipped InDest: The target path to unzipped the file out: FilePaths: List all the paths of unzipped files Code: Return code
Return Code
Reason
S0000
Success to unzip
S1009
A unzipping task in process
C1000
Fail to unzip
Launch the DLC's page in the QIYU Store
Function Name
Blueprint
Introduction
Launch Home
Launch Home: in: Key: Launch the key of application Value: sku value
For the consumable DLC, QIYU platform will return the related result and uid to application server as data flow after the user complete to make a payment. Developers need to deal with those data and return the appropriate response.
If you choose to submit your add-ons for store review, meaning it will display in the store on an APP detail page, it must meet the store content requirements. For store content guidelines and best practices, please refer to the "Application Review Guidelines (opens new window)(opens new window)". Once launched, it will be available to all users in QIYU Store.
One resource file can be uploaded for each DLC. If a DLC includes multiple files, it needs to be compressed before uploading.
To unzipped the package, the third parts library are recommended.
For the Durable DLC, the entitlement check can be performed via client APIs. For the Consumable DLC, Since users can make repeated purchases, your game background should receive the order payment notice from the QIYU background to deliver the rights and maintain the order status.