iOS
- SDK 1.26 及之后版本
- SDK 1.26 之前的版本
UE4.21 ~ UE4.27 & UE5 ~ UE5.5
UE4.21 ~ UE4.27 & UE5 ~ UE5.4
前提条件
游戏使用的每个 SDK 插件的版本(包括游戏启动器使用的版本)必须保持一致。如果游戏需要同时访问多个版本的 Player Network SDK,或者只有一个组件需要升级,请联系 Player Network 助手。
步骤1:安装 SDK
1. 将 Player Network SDK 添加到您的项目
-
解压 SDK 软件包。
-
将
INTLSDK
文件夹复制到项目的Plugins
文件夹中。
如果项目中没有Plugins
文件夹,请创建一个。 -
打开项目的
{项目名称}.Build.cs
文件,并按照示例将 Player Network SDK 添加到 Unreal Engine 中。public INTLSample(ReadOnlyTargetRules Target) : base(Target)
{
PrivateDependencyModuleNames.AddRange(new string[] {
"INTLCore",
"INTLFoundation",
"INTLConfig",
});
}
Player Network SDK package
├─INTLSDK
│ ├─INTLSDK.uplugin // Player Network SDK plugins description files
│ ├─Resources // Player Network SDK resources
│ └─Source // Player Network SDK plugin modules. Each module contains its own Build.cs file, libraries, and interfaces.
│ ├─INTLApple
│ ├─INTLConfig // Player Network SDK configurations
│ ├─INTLCore // Player Network SDK Core module
│ ├─INTLDiscord
│ ├─INTLEpic
│ ├─INTLFacebook
│ ├─INTLFoundation
│ ├─INTLGoogle
│ ├─INTLKakao
│ ├─INTLLine
│ ├─INTLSteam
│ ├─INTLTwitter
│ └─INTLVK
├─LevelInfinite // LI PASS APIs
└─Symbols // Player Network SDK symbol table *.so files
INTLSDK/Source/INTLCore
└─INTLSDK
├─INTLSDK.uplugin
├─Resources
└─Source
├─INTLConfig
├─INTLCore
| ├─INTLCore.Build.cs // INTLCore Build.cs file
| ├─Libs // INTLCore libraries for different platforms which contain dll, lib, and other binary files.
| | ├─Android
| | ├─include
| | ├─iOS
| | ├─MacOS
| | └ ─Win
| ├─Private // Player Network SDK private folder
| └─Public // Player Network SDK public interfaces
| // INTLSDKAPI.h: Player Network SDK APIs
| // INTLSDKPluginObserver.h: Player Network SDK observer classes
| // INTLSDKPluginDefine.h: Player Network SDK data types
| // INTLSDKOutputUtility.h: Player Network SDK utility to process callbacks
| // INTLSDKBaseUserWidget.h: Player Network SDK base class for UserWidget which includes registration and deregistration APIs
├─INTLCustomer
├─INTLDiscord
├─INTLEpic
INTLSDK/Source/INTLConfig
└─INTLSDK
├─INTLSDK.uplugin
├─Resources
└─Source
├─INTLConfig
| ├─Configs // Player Network SDK configurations for different platform
| | ├─Android
| | | └─INTLConfig_APL.xml // Player Network SDK Android gradle configuration file
| | ├─iOS
| | | └─INTLConfig_UPL.xml
| | ├─Resources
| | | ├─APASConfig.ini // APAS device level configuration file
| | | └─INTLConfig.ini // Player Network SDK main configuration file
| ├─Encrypt
| ├─INTLConfig.Build.cs
| ├─INTLConfig.uplugin
| ├─Private
| ├─Public
| └─Resources
├─INTLCore
2. 加载所需的权限和插件
在配置文件中添加 Player Network SDK 相关配置。
例如,对于 Facebook 插件配置,应根据自己的游戏修改 Facebook 配置。
- SDK 1.18 及之后版本
- SDK 1.18 之前版本
根据 SDK 版本打开对应的文件进行修改:
- V1.24 及之后版本:
INTLSDK/Source/INTLFacebook/Libs/iOS/INTLFacebook_UPL.xml
- V1.18 至 V1.23:
INTLSDK/Source/INTLConfig/Configs/iOS/Plist/INTLFacebook.plist
<key>CFBundleURLSchemes</key>
<array>
<string>fb{INTL_FACEBOOK_APP_ID}</string>
</array>
进入 Unreal Engine > Settings > Project Settings > Platforms > iOS > Extra Plist Data 修改配置并在 PLIST 文件中添加 SDK。
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fb</string>
<string>fb-messenger-api</string>
<string>fbshareextension</string>
<string>fbauth2</string>
<string>fb-messenger-share-api</string>
<string>fbapi</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Facebook</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb{INTL_FACEBOOK_APP_ID}</string>
</array>
</dict>
</array>
iOS 使用说明
集成时,用户可根据自己的需要修改内容,并 与法律团队确认内容是否合规。如果没有修改,请用游戏名称替换 INTLSample。
根据 iOS 权限要求,在申请敏感权限时,当系统弹出提示用户填写信息时,填写 用途描述。
-
在
Plugins/INTLSDK/Source/INTLConfig/Configs/iOS/Plist/INTLCore.plist
中,以下权限已升级:<key>NSPhotoLibraryUsageDescription</key>
<key>NSCameraUsageDescription</key>
<key>NSLocationWhenInUseUsageDescription</key>
<key>NSPhotoLibraryAddUsageDescription</key>
<key>NSMicrophoneUsageDescription</key> -
在
Plugins/INTLSDK/Source/INTLConfig/Configs/iOS/Plist/INTLADTracking.plist
中,以下权限已升级:<key>NSUserTrackingUsageDescription</key>