ข้ามไปที่เนื้อหา

ส่งคืนพารามิเตอร์การเรียกใช้งาน

ภาพรวม

การดึงข้อมูล พารามิเตอร์การดำเนินการ เป็นฟีเจอร์ของ Hive SDK ที่ได้รับค่าพารามิเตอร์การดำเนินการที่เพิ่มเข้าไปใน URI การดำเนินการเกมจากไคลเอนต์เกม คุณสามารถตรวจสอบพารามิเตอร์การดำเนินการที่ถูกส่งไปยังเกมเมื่อแอปถูกเปิดด้วย crossplay launcher

วิธีการสอบถาม

รับค่าพารามิเตอร์การดำเนินการที่ถูกส่งในรูปแบบสตริงต้นฉบับ

ตัวอย่างโค้ด

โค้ดตัวอย่างมีดังนี้

using hive;

PlatformHelper.getLaunchParameters((ResultAPI result, String parameters) => 
{
    if (result.success)
    {
        // API call successful
        // parameters: returned parameter value
    }
});
#include "HivePlatformHelper.h" 

FHivePlatformHelper::GetLaunchParameters(FHivePlatformHelperOnGetLaunchParametersDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FString& Parameters) {
    if (Result.IsSuccess()) {
        // API call succeeded
        // Parameters: returned parameter value
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

PlatformHelper::getLaunchParameters([=](ResultAPI const & result, string parameters) {
    if (result.isSuccess()) {
        // API call succeeded
        // parameters: returned parameter values
    }
});

ภาพรวม

พารามิเตอร์ launch เป็นฟีเจอร์ Hive SDK ที่อนุญาตให้ไคลเอนต์เกมดึงค่าพารามิเตอร์การเปิดตัวที่เพิ่มเข้าไปใน URI การเปิดตัวเกม คุณสามารถตรวจสอบพารามิเตอร์การเปิดตัวที่ถูกส่งไปยังเกมเมื่อแอปถูกเปิดผ่าน Crossplay Launcher

วิธีการคืน

ค่าพารามิเตอร์การเปิดตัวจะถูกส่งในรูปแบบสตริงต้นฉบับ

ตัวอย่างโค้ด

ตัวอย่างโค้ดมีดังนี้

using hive;

PlatformHelper.getLaunchParameters((ResultAPI result, String parameters) => 
{
    if (result.success)
    {
        // API call succeeded
        // parameters: returned parameter value
    }
});
#include "HivePlatformHelper.h"

FHivePlatformHelper::getLaunchParameters(FHivePlatformHelperOnGetLaunchParametersDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FString& Parameters) {
    if (Result.IsSuccess()) {
        // API call succeeded
        // Parameters: returned parameter value
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

PlatformHelper::getLaunchParameters([=](ResultAPI const & result, string parameters) {
    if (result.isSuccess()) {
        // API call succeeded
        // parameters: returned parameter value
    }
});