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

Unreal iOS

หลังจากที่เสร็จสิ้นการพัฒนาแอปด้วย Hive SDK Unreal iOS คุณต้องกำหนดค่ารายการต่อไปนี้เมื่อสร้างแอป

  1. ในเมนู Unreal Editor ให้คลิกEdit > Project Settings หน้าต่างการตั้งค่าโปรเจกต์จะปรากฏบนหน้าจอ
  2. ในหน้าต่างการตั้งค่าโปรเจกต์ ให้เลือกเมนู iOS ภายใต้ชื่อแพลตฟอร์มในแผงด้านซ้าย หน้าจอการตั้งค่า iOS จะปรากฏขึ้น ตั้งค่ารายการตามที่แนะนำโดยแต่ละกลุ่ม

การตั้งค่าตามกลุ่ม

นี่คือคำแนะนำการตั้งค่าตามกลุ่ม

  • ข้อมูลกลุ่ม Bundle: ป้อน AppID ของเกมของคุณในฟิลด์ Bundle Identifier.

  • ข้อมูล OS กลุ่ม: เริ่มต้นด้วย Unreal Engine 4.25, เวอร์ชัน OS ที่รองรับได้เปลี่ยนเป็น 11.0 หรือสูงกว่า ตั้งค่า Minimum OSVersion field value เป็น 11.0.

  • สร้างกลุ่ม: ป้อน -ObjC ในฟิลด์ Additional Non-Shipping Linker Flags และฟิลด์ Additional Shipping Linker Flags.

การตั้งค่ากลุ่มข้อมูล Plist เพิ่มเติม

กรอกบรรทัดโค้ตตามรายการการตั้งค่าที่ระบุไว้ด้านล่างในฟิลด์ข้อมูล PList เพิ่มเติม โค้ตทั้งหมดด้านล่างต้องกรอกในบรรทัดเดียว

การตั้งค่าคำขอสิทธิ์การเข้าถึง

ในการตั้งค่าคำขอสิทธิ์การเข้าถึง ให้เพิ่มโค้ดต่อไปนี้ในฟิลด์ข้อมูล PList เพิ่มเติม

<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>

การตรวจสอบสิทธิ์: การตั้งค่า Facebook, QQ VK, WeChat, Line

หากคุณกำลังใช้การรับรองความถูกต้องของ Facebook, QQ, VK, WeChat หรือ Line ให้เพิ่มโค้ดต่อไปนี้ลงในฟิลด์ข้อมูล PList เพิ่มเติมเพื่อกำหนดรายการที่อนุญาตของเซิร์ฟเวอร์

<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>

เมื่อใช้ Facebook ให้เพิ่ม Facebook AppID และ ClientToken โดยใช้โค้ดต่อไปนี้ อย่าลืมใส่ค่า Facebook AppID และ ClientToken สำหรับเกมของคุณ

<key>FacebookAppID</key><string>926000000000000</string>
<key>FacebookClientToken</key><string>d123783h7sdfyh8031h23unf81h3</string>

ตั้งค่า URL Scheme สำหรับแต่ละ IdP.

<key>CFBundleURLTypes</key>
<array>

<!--For Facebook usage. Please insert your app's Facebook App ID value-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLSchemes</key><array><string>fb926000000000000</string></array></dict>

<!--For using deep links on the Hive platform. Please insert your AppID value-->
<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 Google Sign-in. Please insert the Google Sign-in key value of your app-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLSchemes</key><array><string>com.googleusercontent.apps.270000000000-0m7r8tb2co1q00000000000000000000</string></array></dict>

<!--For QQ Sign-in. Please insert the QQ key value of your app-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLName</key><string>tencent</string>
<key>CFBundleURLSchemes</key><array><string>tencent1106227203</string></array></dict>

<!--For Wechat Sign-in. Please insert the Wechat key value of your app-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLName</key><string>weixin</string><key>CFBundleURLSchemes</key><array><string>wx78176cf0c698c0f9</string></array></dict>

<!--For VK Sign-in. Please insert the VK key value of your app-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLName</key><string>vk6270065</string><key>CFBundleURLSchemes</key><array><string>vk6270065</string></array></dict>

<!--For Line Sign-in-->
<dict><key>CFBundleTypeRole</key><string>Editor</string>
<key>CFBundleURLSchemes</key><array><string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string></array></dict>

</array>

ต่อไปนี้คือตัวอย่างของค่าข้างต้นที่แทรกเข้าไปในฟิลด์ข้อมูล PList เพิ่มเติม

<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>

การตั้งค่าเข้าสู่ระบบด้วย Apple

เพื่อสนับสนุนการเข้าสู่ระบบด้วย Apple ให้เพิ่มโค้ดต่อไปนี้ลงในไฟล์Project Folder > Config > DefaultEngine.ini

bEnableSignInWithAppleSupport=True

การตั้งค่าหลายภาษา

ในการให้บริการแอปของคุณในหลายภาษา คุณต้องเพิ่มไฟล์การตั้งค่าหลายภาษา ดาวน์โหลด ไฟล์การตั้งค่าหลายภาษา แตกไฟล์ออก และคัดลอกเนื้อหาจากโฟลเดอร์ localize ไปยัง /Plugins/HIVESDK/Source/HIVESDK/ThirdParty/iOS/resource