添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

本页告诉您如何开发基于 Unreal Engine ; 移植 Hive SDK ,或构建为 Android , iOS Windows 应用。

本指南基于以下环境。

Android

  • Hive SDK v4 UE4 Android + iOS 24.0.0
  • Unreal Engine 4.27 Plus
  • commit hash : 0db0b74ff0822a57a5ce49a4cd10c8672fc57a4b
  • JDK 8
  • AndroidStudio 4.1
  • Android NDK r21
  • Android SDK min 21版
  • Android SDK target 34版
  • Hive SDK v4 UE4 Android + iOS 24.0.0
  • Unreal Engine 4.27 Plus
  • commit hash : 0db0b74ff0822a57a5ce49a4cd10c8672fc57a4b
  • Xcode 15.1+
  • iOS Version 12.0+
  • macOS Ventura 14+
  • Windows

  • Windows 10+
  • Unreal Engine 4.27
  • 开发应用程序基于 Unreal Engine , 港口 Hive SDK as plugin 输入 Unreal Engine 开发环境。 如下描述,添加 Hive SDK 到开发环境并执行必要的设置和编码。

  • Build Unreal Engine
  • 添加 Hive SDK Unreal Editor as Plugin Type
  • 编辑 Unreal Engine 文件
  • 其他咨询 Settings
  • Hive Settings
  • Build Unreal Engine

    请参阅 先决条件 并下载 Unreal Engine 源代码和 build 它。

    激活 Rosetta 仿真器 macOS

    您需要使用 Rosetta 模拟器上的 Apple Silicon CPU -已安装 macOS 开发机。 查看 Product > Destination > Destination Architectures > Show Rosetta Destinations on Xcode .

    Adding Hive SDK to Unreal Editor

    Add Hive SDK 作为一个 plugin Unreal Editor . 如果您没有 Hive SDK Unreal Engine , 下载 Hive SDK Unreal Engine SDK 下载页面 .

    如果您已经下载了 Hive SDK Unreal Engine ,按照以下说明添加 Hive SDK 作为一个 plugin Unreal Editor :

    更新已安装的 Hive SDK 插件为 Unreal Engine ,您必须删除已安装的插件文件夹,然后按照以下说明重新安装插件。

  • 解压 Hive SDK Unreal Engine 下载自 Hive 开发人员站点,并复制中的所有项目 Plugin 从解压后的文件到文件夹 Plugins 你的根文件夹下的文件夹 Unreal Engine 游戏项目。
  • Add " HIVESDK " 到参数 PublicDependencyModuleNames . AddRange () 方法,该方法是在;/ Source / ;/ ; build . cs 文件,如以下示例代码。 替换为您的实际项目名称。
    public <project_name>;(TargetInfo Target) PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" , "HIVESDK"});
    1
    2
    3
    4
    5
    6
    7
    8
    9
    public class < project_name > ; : ModuleRules
    {
    public < project_name > ; ( TargetInfo Target )
    {
    PublicDependencyModuleNames . AddRange ( new string [ ] { "Core" , "CoreUObject" , "Engine" , "InputCore" , "HIVESDK" } ) ;
    . . .
    }
    . . .
    }
  • 您还可以 apply 的变化 Unreal Engine 通过编辑 Unreal Engine 源代码下载自 Github .
  • 如果你想下载 Unreal Engine Source Code ,请参阅 下载 Unreal Engine Source Code .
  • Android

    当游戏中屏幕方向设置为两个方向(水平和垂直)时 build ,需要修改下面的代码以实现屏幕自动旋转。

    转到/ Engine / Build / Android / Java / src / com / epicgames / ue4 / GameActivity . java . template .

    Add HiveActivity.onConfigurationChanged() API .

    public void onConfigurationChanged(Configuration newConfig) HiveActivity.onConfigurationChanged(this, newConfig); // Add super.onConfigurationChanged(newConfig); // forward the orientation boolean bPortrait = newConfig.orientation == Configuration.ORIENTATION_PORTRAIT; nativeOnConfigurationChanged(bPortrait);
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    @ Override
    public void onConfigurationChanged ( Configuration newConfig )
    {
    HiveActivity . onConfigurationChanged ( this , newConfig ) ; // Add
    super . onConfigurationChanged ( newConfig ) ;
    // forward the orientation
    boolean bPortrait = newConfig . orientation == Configuration . ORIENTATION_PORTRAIT ;
    nativeOnConfigurationChanged ( bPortrait ) ;
    }

    之间存在兼容性问题 Google Billing Library 使用的版本 5 Hive SDK Google Billing 内置功能 Unreal Engine ,导致 build 失败。 修改下面的代码来解决这个问题。

    转到/ Engine / Plugins / Online / Android / OnlineSubsystemGooglePlay / Source / OnlineSubsystemGooglePlay . Build . cs

    注释掉下面的代码

    //string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath); //AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "OnlineSubsystemGooglePlay_UPL.xml"));

    由于 Hive SDK iOS 开发于 Swift ,需要进行一些修改以实现之间的兼容性 Unreal Engine Swift ,以及修改 Unreal Engine 还需要使用由 Hive SDK .

    在下面的文件中,添加标记为 'Add' 评论。

    Engine / Source / Runtime / ApplicationCore / Public / IOS / IOSAppDelegate .h

    DECLARE_MULTICAST_DELEGATE_FourParams(FOnOpenURL, UIApplication*, NSURL*, NSString*, id); static FOnOpenURL OnOpenURL; // Add DECLARE_MULTICAST_DELEGATE_ThreeParams(FOnOpenURLwithOptions, UIApplication*, NSURL*, NSDictionary* ); static FOnOpenURLwithOptions OnOpenURLwithOptions; // End
    1
    2
    3
    4
    5
    6
    7
    8
    9
    DECLARE_MULTICAST_DELEGATE_FourParams ( FOnOpenURL , UIApplication* , NSURL* , NSString* , id ) ;
    static FOnOpenURL OnOpenURL ;
    // Add
    DECLARE_MULTICAST_DELEGATE_ThreeParams ( FOnOpenURLwithOptions , UIApplication* , NSURL* , NSDictionary* ) ;
    static FOnOpenURLwithOptions OnOpenURLwithOptions ;
    // End
    // parameters passed from openURL @property (nonatomic, retain) NSMutableArray* savedOpenUrlParameters; @property (nonatomic, retain) NSMutableArray* savedOpenUrlWithOptionsParameters; // Add extern bool GShowSplashScreen; FIOSCoreDelegates::FOnOpenURL FIOSCoreDelegates::OnOpenURL; FIOSCoreDelegates::FOnOpenURLwithOptions FIOSCoreDelegates::OnOpenURLwithOptions; // Add FIOSCoreDelegates::FOnWillResignActive FIOSCoreDelegates::OnWillResignActive; FIOSCoreDelegates::FOnDidBecomeActive FIOSCoreDelegates::OnDidBecomeActive; TArray<FIOSCoreDelegates::FFilterDelegateAndHandle> FIOSCoreDelegates::PushNotificationFilters;
    1
    2
    3
    4
    5
    6
    7
    8
    9
    extern bool GShowSplashScreen ;
    FIOSCoreDelegates :: FOnOpenURL FIOSCoreDelegates :: OnOpenURL ;
    FIOSCoreDelegates :: FOnOpenURLwithOptions FIOSCoreDelegates :: OnOpenURLwithOptions ; //   Add
    FIOSCoreDelegates :: FOnWillResignActive FIOSCoreDelegates :: OnWillResignActive ;
    FIOSCoreDelegates :: FOnDidBecomeActive FIOSCoreDelegates :: OnDidBecomeActive ;
    TArray < FIOSCoreDelegates :: FFilterDelegateAndHandle > FIOSCoreDelegates :: PushNotificationFilters ;
    #endif @synthesize savedOpenUrlParameters; @synthesize savedOpenUrlWithOptionsParameters; // Add @synthesize BackgroundSessionEventCompleteDelegate; for (NSDictionary* openUrlParameter in self.savedOpenUrlWithOptionsParameters) UIApplication* application = [openUrlParameter valueForKey : @"application"]; NSURL* url = [openUrlParameter valueForKey : @"url"]; NSDictionary<NSString*, id> * options = [openUrlParameter valueForKey : @"options"]; FIOSCoreDelegates::OnOpenURLwithOptions.Broadcast(application, url, options); self.savedOpenUrlWithOptionsParameters = nil; // clear after saved openurl delegate running // End for (NSDictionary* openUrlParameter in self.savedOpenUrlParameters) UIApplication* application = [openUrlParameter valueForKey : @"application"];
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    GShowSplashScreen = false ;
    } , TStatId ( ) , NULL , ENamedThreads :: ActualRenderingThread ) ;
    }
    // Add
    for ( NSDictionary* openUrlParameter in self . savedOpenUrlWithOptionsParameters )
    {
    UIApplication* application = [ openUrlParameter valueForKey : @ "application" ] ;
    NSURL* url = [ openUrlParameter valueForKey : @ "url" ] ;
    NSDictionary < NSString* , id > * options = [ openUrlParameter valueForKey : @ "options" ] ;
    FIOSCoreDelegates :: OnOpenURLwithOptions . Broadcast ( application , url , options ) ;
    }
    self . savedOpenUrlWithOptionsParameters = nil ; // clear after saved openurl delegate running
    // End
    for ( NSDictionary* openUrlParameter in self . savedOpenUrlParameters )
    {
    UIApplication* application = [ openUrlParameter valueForKey : @ "application" ] ;
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions // save launch options self.launchOptions = launchOptions; #if PLATFORM_TVOS self.bDeviceInPortraitMode = false; #else // use the status bar orientation to properly determine landscape vs portrait self.bDeviceInPortraitMode = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]); printf("========= This app is in %s mode\n", self.bDeviceInPortraitMode ? "PORTRAIT" : "LANDSCAPE"); #endif // check OS version to make sure we have the API OSVersion = [[[UIDevice currentDevice] systemVersion] floatValue]; if (!FPlatformMisc::IsDebuggerPresent() || GAlwaysReportCrash) // InstallSignalHandlers(); self.savedOpenUrlParameters = [[NSMutableArray alloc] init]; self.savedOpenUrlWithOptionsParameters = [[NSMutableArray alloc] init]; // Add self.PeakMemoryTimer = [NSTimer scheduledTimerWithTimeInterval:0.1f target:self selector:@selector(RecordPeakMemory) userInfo:nil repeats:YES]; #if !BUILD_EMBEDDED_APP
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    - ( BOOL ) application : ( UIApplication * ) application didFinishLaunchingWithOptions : ( NSDictionary* ) launchOptions
    {
    // save launch options
    self . launchOptions = launchOptions ;
    #if PLATFORM_TVOS
    self . bDeviceInPortraitMode = false ;
    #else
    // use the status bar orientation to properly determine landscape vs portrait
    self . bDeviceInPortraitMode = UIInterfaceOrientationIsPortrait ( [ [ UIApplication sharedApplication ] statusBarOrientation ] ) ;
    printf ( "========= This app is in %s mode\n" , self . bDeviceInPortraitMode ? "PORTRAIT" : "LANDSCAPE" ) ;
    #endif
    // check OS version to make sure we have the API
    OSVersion = [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] ;
    if ( ! FPlatformMisc :: IsDebuggerPresent ( ) || GAlwaysReportCrash )
    {
    //        InstallSignalHandlers();
    }
    self . savedOpenUrlParameters = [ [ NSMutableArray alloc ] init ] ;
    self . savedOpenUrlWithOptionsParameters = [ [ NSMutableArray alloc ] init ] ; //  Add
    self . PeakMemoryTimer = [ NSTimer scheduledTimerWithTimeInterval : 0.1f target : self selector : @ selector ( RecordPeakMemory ) userInfo : nil repeats : YES ] ;
    #if !BUILD_EMBEDDED_APP
    //### use option - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options #if !NO_LOGGING NSLog(@"%s", "IOSAppDelegate openURL options\n"); #endif NSString* EncdodedURLString = [url absoluteString]; NSString* URLString = [EncdodedURLString stringByRemovingPercentEncoding]; FString CommandLineParameters(URLString); // Strip the "URL" part of the URL before treating this like args. It comes in looking like so: // "MyGame://arg1 arg2 arg3 ..." // So, we're going to make it look like: // "arg1 arg2 arg3 ..." int32 URLTerminator = CommandLineParameters.Find( TEXT("://"), ESearchCase::CaseSensitive); if ( URLTerminator > -1 ) CommandLineParameters.RightChopInline(URLTerminator + 3, false); FIOSCommandLineHelper::InitCommandArgs(CommandLineParameters); self.bCommandLineReady = true; [self.CommandLineParseTimer invalidate]; self.CommandLineParseTimer = nil; // Save openurl infomation before engine initialize. // When engine is done ready, running like previous. ( if OnOpenUrl is bound on game source. ) if (bEngineInit) FIOSCoreDelegates::OnOpenURLwithOptions.Broadcast(app, url, options); #if !NO_LOGGING NSLog(@"%s", "Before Engine Init receive IOSAppDelegate openURL\n"); #endif NSDictionary* openUrlParameter = [NSDictionary dictionaryWithObjectsAndKeys : app , @"application", url, @"url", options, @"options", nil]; [savedOpenUrlWithOptionsParameters addObject : openUrlParameter]; return YES; // End FCriticalSection RenderSuspend; - (void)applicationWillResignActive:(UIApplication *)application
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    return YES ;
    }
    // Add
    //### use option
    - ( BOOL ) application : ( UIApplication * ) app openURL : ( NSURL * ) url options : ( NSDictionary < NSString* , id > * ) options
    {
    #if !NO_LOGGING
    NSLog ( @ "%s" , "IOSAppDelegate openURL options\n" ) ;
    #endif
    NSString* EncdodedURLString = [ url absoluteString ] ;
    NSString* URLString = [ EncdodedURLString stringByRemovingPercentEncoding ] ;
    FString CommandLineParameters ( URLString ) ;
    // Strip the "URL" part of the URL before treating this like args. It comes in looking like so:
    // "MyGame://arg1 arg2 arg3 ..."
    // So, we're going to make it look like:
    // "arg1 arg2 arg3 ..."
    int32 URLTerminator = CommandLineParameters . Find ( TEXT ( "://" ) , ESearchCase :: CaseSensitive ) ;
    if ( URLTerminator > - 1 )
    {
    CommandLineParameters . RightChopInline ( URLTerminator + 3 , false ) ;
    }
    FIOSCommandLineHelper :: InitCommandArgs ( CommandLineParameters ) ;
    self . bCommandLineReady = true ;
    [ self . CommandLineParseTimer invalidate ] ;
    self . CommandLineParseTimer = nil ;
    //    Save openurl infomation before engine initialize.
    //    When engine is done ready, running like previous. ( if OnOpenUrl is bound on game source. )
    if ( bEngineInit )
    {
    FIOSCoreDelegates :: OnOpenURLwithOptions . Broadcast ( app , url , options ) ;
    }
    else
    {
    #if !NO_LOGGING
    NSLog ( @ "%s" , "Before Engine Init receive IOSAppDelegate openURL\n" ) ;
    #endif
    NSDictionary* openUrlParameter = [ NSDictionary dictionaryWithObjectsAndKeys :
    app , @ "application" ,
    url , @ "url" ,
    options , @ "options" ,
    nil ] ;
    [ savedOpenUrlWithOptionsParameters addObject : openUrlParameter ] ;
    }
    return YES ;
    }
    // End
    FCriticalSection RenderSuspend ;
    - ( void ) applicationWillResignActive : ( UIApplication * ) application
    {
      申请时 Hive SDK v4.15.2.2 或更高版本,实施 application (_: supportedInterfaceOrientationsFor :) 中的方法 IOSAppDelegate . cpp 来自的文件 Unreal Engine 激活屏幕方向配置功能 iOS 。 该方法返回 UIInterfaceOrientationMask 在游戏中的使用价值。 它返回 landscape in landscape - 仅限游戏, portrait in portrait -仅限游戏,并且 landscape 以及 portrait 在所有类型支持的游戏中。

    • Add 以下代码到/ Engine / Source / Runtime / ApplicationCore / Private / IOS / IOSAppDelegate . cpp .
    • 1
      2
      3
      4
      5
      6
      < key > NSCameraUsageDescription < / key >
      < string > Approval required to take pictures . < / string >
      < key > NSPhotoLibraryUsageDescription < / key >
      < string > Approval required to upload image files . < / string >
      < key > NSUserTrackingUsageDescription < / key >
      < string > We need your permission to use the Advertising Identifiers ( IDFA ) for promotion targeting and tracking analysis . < / string >
      <string>fbshareextension</string> <string>mqqOpensdkSSoLogin</string> <string>mqqopensdkapiV2</string> <string>lineauth2</string> <string>mqqopensdkapiV3</string> <string>wtloginmqq2</string> <string>mqq</string> <string>mqqapi</string> </array>
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    < key > LSApplicationQueriesSchemes < / key >
    < array >
    < string > weixin < / string >
    < string > vk - share < / string >
    < string > vkauthorize < / string >
    < string > vk < / string >
    < string > weixinULAPI < / string >
    < string > fbapi < / string >
    < string > fb - messenger - api < / string >
    < string > fbauth2 < / string >
    < string > fbshareextension < / string >
    < string > mqqOpensdkSSoLogin < / string >
    < string > mqqopensdkapiV2 < / string >
    < string > lineauth2 < / string >
    < string > mqqopensdkapiV3 < / string >
    < string > wtloginmqq2 < / string >
    < string > mqq < / string >
    < string > mqqapi < / string >
    < / array >
    <!--For using Facebook. Input the Facebook App ID of your apps--> <dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLSchemes</key><array><string>fb926000000000000</string></array></dict> <!--For using Hive Deeplink. Input the Hive Deeplink key of your apps--> <dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLSchemes</key><array><string>com.com2us.misample.normal.freefull.apple.global.ios.universal</string></array></dict> <!--For using Google Sign-in. Input the Google Sign-in key of your apps--> <dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLSchemes</key><array><string>com.googleusercontent.apps.270000000000-0m7r8tb2co1q00000000000000000000</string></array></dict> <!--For using QQ Sign-in. Input the QQ key of your apps--> <dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLName</key><string>tencent</string> <key>CFBundleURLSchemes</key><array><string>tencent1106227203</string></array></dict> <!--For using WeChat Sign-in. Input the WeChat key of your apps--> <dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLName</key><string>weixin</string><key>CFBundleURLSchemes</key><array><string>wx78176cf0c698c0f9</string></array></dict> <!--For using VK Sign-in. Input the VK key of your apps--> <dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLName</key><string>vk6270065</string><key>CFBundleURLSchemes</key><array><string>vk6270065</string></array></dict> <!--For using Line Sign-in. Input the Line key of your apps--> <dict><key>CFBundleTypeRole</key><string>Editor</string> <key>CFBundleURLSchemes</key><array><string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string></array></dict> </array>
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    < key > CFBundleURLTypes < / key >
    < array >
    < ! -- For using Facebook . Input the Facebook App ID of your apps -- >
    < dict > < key > CFBundleTypeRole < / key > < string > Editor < / string > < key > CFBundleURLSchemes < / key > < array > < string > fb926000000000000 < / string > < / array > < / dict >
    < ! -- For using Hive Deeplink . Input the Hive Deeplink key of your apps -- >
    < dict > < key > CFBundleTypeRole < / key > < string > Editor < / string > < key > CFBundleURLSchemes < / key > < array > < string > com . com2us . misample . normal . freefull . apple . global . ios . universal < / string > < / array > < / dict >
    < ! -- For using Google Sign - in . Input the Google Sign - in key of your apps -- >
    < dict > < key > CFBundleTypeRole < / key > < string > Editor < / string > < key > CFBundleURLSchemes < / key > < array > < string > com . googleusercontent . apps . 270000000000 - 0m7r8tb2co1q00000000000000000000 < / string > < / array > < / dict >
    < ! -- For using QQ Sign - in . Input the QQ key of your apps -- >
    < dict > < key > CFBundleTypeRole < / key > < string > Editor < / string > < key > CFBundleURLName < / key > < string > tencent < / string >
    < key > CFBundleURLSchemes < / key > < array > < string > tencent1106227203 < / string > < / array > < / dict >
    < ! -- For using WeChat Sign - in . Input the WeChat key of your apps -- >
    < dict > < key > CFBundleTypeRole < / key > < string > Editor < / string > < key > CFBundleURLName < / key > < string > weixin < / string > < key > CFBundleURLSchemes < / key > < array > < string > wx78176cf0c698c0f9 < / string > < / array > < / dict >
    < ! -- For using VK Sign - in . Input the VK key of your apps -- >
    < dict > < key > CFBundleTypeRole < / key > < string > Editor < / string > < key > CFBundleURLName < / key > < string > vk6270065 < / string > < key > CFBundleURLSchemes < / key > < array > < string > vk6270065 < / string > < / array > < / dict >
    < ! -- For using Line Sign - in . Input the Line key of your apps -- >
    < dict > < key > CFBundleTypeRole < / key > < string > Editor < / string >
    < key > CFBundleURLSchemes < / key > < array > < string > line3rdp . $ ( PRODUCT_BUNDLE_IDENTIFIER ) < / string > < / array > < / dict >
    < / array >
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    < key > NSCameraUsageDescription < / key >
    < string > Approval required to take pictures . < / string >
    < key > NSContactsUsageDescription < / key >
    < string > You must agree to add friends from your Contacts . < / string >
    < key > NSPhotoLibraryUsageDescription < / key >
    < string > Approval required to upload image files . < / string >
    < key > NSUserTrackingUsageDescription < / key >
    < string > We need your permission to use the Advertising Identifiers ( IDFA ) for promotion targeting and tracking analysis . < / string >
    < key > FacebookAppID < / key >
    < string > 1809615065921877 < / string >
    < key > FacebookClientToken < / key >
    < string > c41e47ba5512ea3fb5bfb29d5cfeb244 < / string >
    < key > CFBundleURLTypes < / key >
    < array >
    < dict >
    < key > CFBundleTypeRole < / key >
    < string > Editor < / string >
    < key > CFBundleURLSchemes < / key >
    < array >
    < string > line3rdp . $ ( PRODUCT_BUNDLE_IDENTIFIER ) < / string >
    < / array >
    < / dict >
    < dict >
    < key > CFBundleTypeRole < / key >
    < string > Editor < / string >
    < key > CFBundleURLSchemes < / key >
    < array >
    < string > fb926000000000000 < / string >
    < / array >
    < / dict >
    < dict >
    < key > CFBundleTypeRole < / key >
    < string > Editor < / string >
    < key > CFBundleURLSchemes < / key >
    < array >
    < string > com . com2us . hivesdk . normal . freefull . apple . global . ios . universal < / string >
    < / array >
    < / dict >
    < dict >
    < key > CFBundleTypeRole < / key >
    < string > Editor < / string >
    < key > CFBundleURLSchemes < / key >
    < array >
    < string > com . googleusercontent . apps . 331526026701 - s41n272jsv6c0f72kt5o7of0jns350gl < / string >
    < / array >
    < / dict >
    < dict >
    < key > CFBundleTypeRole < / key >
    < string > Editor < / string >
    < key > CFBundleURLName < / key >
    < string > tencent < / string >
    < key > CFBundleURLSchemes < / key >
    < array >
    < string > tencent1106227203 < / string >
    < / array >
    < / dict >
    < dict >
    < key > CFBundleTypeRole < / key >
    < string > Editor < / string >
    < key > CFBundleURLName < / key >
    < string > weixin < / string >
    < key > CFBundleURLSchemes < / key >
    < array >
    < string > wx78176cf0c698c0f9 < / string >
    < / array >
    < / dict >
    < dict >
    < key > CFBundleTypeRole < / key >
    < string > Editor < / string >
    < key > CFBundleURLName < / key >
    < string > vk6270065 < / string >
    < key > CFBundleURLSchemes < / key >
    < array >
    < string > vk6270065 < / string >
    < / array >
    < / dict >
    < / array >
    < key > LSApplicationQueriesSchemes < / key >
    < array >
    < string > weixin < / string >
    < string > vk - share < / string >
    < string > vkauthorize < / string >
    < string > vk < / string >
    < string > weixinULAPI < / string >
    < string > fbapi < / string >
    < string > fb - messenger - api < / string >
    < string > fbauth2 < / string >
    < string > fbshareextension < / string >
    < string > mqqOpensdkSSoLogin < / string >
    < string > mqqopensdkapiV2 < / string >
    < string > lineauth2 < / string >
    < string > mqqopensdkapiV3 < / string >
    < string > wtloginmqq2 < / string >
    < string > mqq < / string >
    < string > mqqapi < / string >
    < / array >
    添加 Firebase 分析
  • 在 Firebase 控制台中注册应用程序后 (https://firebase.google.com/),把发布的 Google以下路径下的 Service-Info.plist 文件。

    /插件/HIVESDK/源码/HIVESDK/第三方/iOS/资源

    应用语言配置文件
  • 为了应用多种语言,需要添加语言配置文件。
  • 请复制本地化文件夹中的所有文件 配置文件 并将它们粘贴到以下路径中。

    /插件/HIVESDK/源码/HIVESDK/第三方/iOS/资源

    /////////////////////////////////////////////// ////////////// // Add IOSAppDelegate.h header #if PLATFORM_IOS #include "Runtime/ApplicationCore/Public/iOS/IOSAppDelegate.h" #endif /////////////////////////////////////////////// ////////////// /////////////////////////////////////////////// ////////////// // the added code body to modify AppDelegate #if PLATFORM_IOS UIApplication * dummyApplication = [UIApplication sharedApplication]; Class clzHIVEAppDelegate = NSClassFromString(@"HIVEAppDelegate"); SEL selApplicationDidFinishLaunchingWithOptions = NSSelectorFromString(@"application:didFinishLaunchingWithOptions:"); if( clzHIVEAppDelegate != nil && [clzHIVEAppDelegate respondsToSelector:selApplicationDidFinishLaunchingWithOptions] ) { NSMethodSignature *method = [clzHIVEAppDelegate methodSignatureForSelector:selApplicationDidFinishLaunchingWithOptions]; if (method != nil) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:method]; [invocation setSelector:selApplicationDidFinishLaunchingWithOptions]; [invocation setTarget:clzHIVEAppDelegate]; [invocation setArgument:(void*)&dummyApplication atIndex:2]; NSDictionary *localLaunchOptions = [IOSAppDelegate GetDelegate].launchOptions; if( localLaunchOptions != nil ) { [invocation setArgument:(void*)&localLaunchOptions atIndex:3]; [invocation invoke]; #endif /////////////////////////////////////////////// //////////////
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    /////////////////////////////////////////////// //////////////
    // Add IOSAppDelegate.h header
    #if PLATFORM_IOS
    #include "Runtime/ApplicationCore/Public/iOS/IOSAppDelegate.h"
    #endif
    /////////////////////////////////////////////// //////////////
    /////////////////////////////////////////////// //////////////
    // the added code body to modify AppDelegate
    #if PLATFORM_IOS
    UIApplication * dummyApplication = [ UIApplication sharedApplication ] ;
    Class clzHIVEAppDelegate = NSClassFromString ( @ "HIVEAppDelegate" ) ;
    SEL selApplicationDidFinishLaunchingWithOptions = NSSelectorFromString ( @ "application:didFinishLaunchingWithOptions:" ) ;
    if ( clzHIVEAppDelegate != nil && [ clzHIVEAppDelegate respondsToSelector : selApplicationDidFinishLaunchingWithOptions ] ) {
    NSMethodSignature * method = [ clzHIVEAppDelegate methodSignatureForSelector : selApplicationDidFinishLaunchingWithOptions ] ;
    if ( method != nil ) {
    NSInvocation * invocation = [ NSInvocation invocationWithMethodSignature : method ] ;
    [ invocation setSelector : selApplicationDidFinishLaunchingWithOptions ] ;
    [ invocation setTarget : clzHIVEAppDelegate ] ;
    [ invocation setArgument : ( void * ) & dummyApplication atIndex : 2 ] ;
    NSDictionary * localLaunchOptions = [ IOSAppDelegate GetDelegate ] . launchOptions ;
    if ( localLaunchOptions != nil ) {
    [ invocation setArgument : ( void * ) & localLaunchOptions atIndex : 3 ] ;
    }
    [ invocation invoke ] ;
    }
    }
    #endif
    /////////////////////////////////////////////// //////////////
    1
    2
    3
    4
    5
    public class YourProjectTarget : TargetRules
    { public YourProjectTarget ( TargetInfo Target ) : base ( Target )
    { // Force to execute ANSI allocator for the game client
    if ( Target . Platform == UnrealTargetPlatform . IOS )
    { GlobalDefinitions . Add ( "FORCE_ANSI_ALLOCATOR=1" ) ; } } }
  • 一个替代品 API 有些需要打电话 API因为调用时崩溃 plugin 接口应用于 STL .
  • 类和数组(例如 std :: vector ) return string JSON 对象和数组(分别)。
  • 下面是一个调用的例子 AuthV4 :: getPlayerInfo () API .
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    #if PLATFORM_IOS || PLATFORM_ANDROID
    PlayerInfo playerInfo = AuthV4 :: getPlayerInfo ( ) ;
    #else
    auto infoString = AuthV4GetPlayerInfo ( ) ;
    std :: string strInfo ( infoString ) ;
    //Char to JSon
    PlayerInfo playerInfo ;
    picojson :: value playerInfoJson ;
    std :: string err = picojson :: parse ( playerInfoJson , strInfo ) ;
    playerInfo . playerId = playerInfoJson . get ( "playerId" ) . get ( ) ;
    playerInfo . did = playerInfoJson . get ( "did" ) . get ( ) ;
    playerInfo . playerImageUrl = playerInfoJson . get ( "playerImageUrl" ) . get ( ) ;
    playerInfo . playerName = playerInfoJson . get ( "playerName" ) . get ( ) ;
    playerInfo . playerToken = playerInfoJson . get ( "playerToken" ) . get ( ) ;
    picojson :: object providerInfoData = playerInfoJson . get ( "providerInfoData" ) . get ( ) ;
    std :: map < hive :: ProviderType , hive :: ProviderInfo > ; mapProviderInfoData ;
    for ( picojson :: value :: object :: const _ iterator i = providerInfoData . begin ( ) ;
    i != providerInfoData . end ( ) ;
    ++ i ) {
    auto value = i -> ; second ;
    hive :: ProviderInfo __proInfo ;
    __proInfo . providerType = ( hive :: ProviderType ) value . get ( "providerType" ) . get ( ) ;
    __proInfo . providerUserId = value . get ( "providerUserId" ) . get ( ) ;
    mapProviderInfoData [ ( hive :: ProviderType ) ( stoi ( i -> ; first ) ) ] = __proInfo ;
    //std::cout << i->;first << ': ' << i->;second.to_str() << std::endl;
    }
    playerInfo . providerInfoData = mapProviderInfoData ;
    #endif
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    const char * AuthV4GetPlayerInfo ( ) ;
    void AuthV4ShowChatbotInquiry ( const char * additionalInfo , hive :: AuthV4 :: onShowChatbotInquiry showChatbotInquiryListener ) ;
    const char * AuthV4HelperGetIDPList ( ) ;
    const char * ConfigurationGetConfigurationJsonString ( ) ;
    void ConfigurationSetConfigurations ( hive :: HiveConfigType configType , const char * value ) ;
    const char * ConfigurationGetCompany ( ) ;
    const char * ConfigurationGetHIVECountry ( ) ;
    void ConfigurationSetGameLanguage ( const char * language ) ;
    void ConfigurationUpdateGameLanguage ( const char * newValue ) ;
    const char * ConfigurationGetHIVESDKVersion ( ) ;
    const char * ConfigurationGetReferenceSDKVersion ( ) ;
    const char * ConfigurationGetAppId ( ) ;
    void ConfigurationSetAppId ( const char * appId ) ;
    const char * ConfigurationGetServerId ( ) ;
    void ConfigurationSetServerId ( const char * serverId ) ;
    void ConfigurationUpdateServerId ( const char * serverId ) ;
    const char * ConfigurationGetMarket ( ) ;
    void IAPV4Purchase ( const char * marketPid , const char * additionalInfo , hive :: IAPV4 :: onPurchase listener ) ;
    void IAPV4TransactionFinish ( const char * marketPid , hive :: IAPV4 :: onTransactionFinishWithChar listener ) ;
    const char * PromotionSetEngagementReady ( bool isReady ) ;
    bool PromotionHIVEProcessURI ( const char * URI ) ;
    static void Promotion :: setEngagementHandler ( onEngagementString engagementHandler ) ; // picoJson ->; std::string (json format)
    const char * ResultAPIToString ( void * resultAPIPtr ) ;
    //4.15.8 Add
    void AuthV4SignInWithAuthKey ( const char * authKey , hive :: AuthV4 :: onSignIn signInListener ) ;
    typedef std :: function < void ( ResultAPI const & result , const char * value ) > ; onGetMetaDataChar ; // the replacement of std::string
    void ConfigurationGetMetaData ( const char * key , bool forceReload , hive :: Configuration :: onGetMetaDataChar listener ) ;
    void AnalyticsSendAnalyticsLog ( const char * logDataJsonString ) ;
    void AnalyticsSendUserEntryFunnelsLogs ( const char * funnelTrack , const char * optionTag ) ;
    //4.16.2 Add
    void AuthV4ConnectWithAuthKey ( const char * authKey , hive :: AuthV4 :: onConnect connectListener ) ;
    void AuthV4DisconnectWithName ( const char * providerName , hive :: AuthV4 :: onDisconnect disconnectListener ) ;
    //4.16.4 Add
    const char * ConfigurationGetChannel ( ) ;
    void ConfigurationSetChannel ( const char * channel ) ;
  • Add HiveStore = 15 hive :: IAPV4Type .
  • Add ErroCode : IAPSUCCESS = 90 Code : IAPV4HiveStoreSuccess = -6110000 Result API .
  • ConflictSingleViewInfo 类,
  • 参考示例项目, PlayerTestView . cpp ,并了解 激活/停用 IME (输入法 Editor ) 的调用 API 调用时如上 AuthV4 :: showInquiry , AuthV4 :: showMyInquiry , AuthV4 :: showDeviceManagement , AuthV4ShowChatbotInquiry AuthV4 :: showProfile API (用于 Windows ).
  • 应在调用之前和之后添加以下代码 SDK API .

  •