1. Create a new swift project
  2. Import GameAnalytics.xcframework 4.10.2 to the project
  3. add dependencies
AppTrackingTransparency.framework (only required for XCode 12 and higher)
AdSupport.framework
SystemConfiguration.framework
libsqlite3.tbd
libz.tbd
  1. In the “Build Settings” section add the following to “Other Linker Flags”: -lC++
  2. Init SDK as Doc says:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// ... other code from your project ...
// Enable implementation log (disable in production)
GameAnalytics.setEnabledInfoLog(true)
GameAnalytics.setEnabledVerboseLog(true)
// Set build version
GameAnalytics.configureBuild("1.0.0")
// Set available virtual currencies and item types
GameAnalytics.configureAvailableResourceCurrencies(["gems", "gold"])
GameAnalytics.configureAvailableResourceItemTypes(["boost", "lives"])
// Set available custom dimensions
GameAnalytics.configureAvailableCustomDimensions01(["ninja", "samurai"])
GameAnalytics.configureAvailableCustomDimensions02(["whale", "dolphin"])
GameAnalytics.configureAvailableCustomDimensions03(["horde", "alliance"])
// Initialize
GameAnalytics.initialize(withGameKey: "your_key", gameSecret: "your_Secret")
return true
}
Here is the log:
Info/GA/Analytics: Info logging enabled
Info/GA/Analytics: Verbose logging enabled
Info/GA/Analytics: Set build version: __NSCFConstantString
crash at
#0 0x0000000180086a08 in objc_opt_respondsToSelector ()
Thread 2: EXC_BAD_ACCESS (code=1, address=0x1ec41f6)
libobjc.A.dylib`objc_opt_respondsToSelector:
0x1800869f4 <+0>: cbz x0, 0x180086a18 ; <+36>
0x1800869f8 <+4>: mov x8, x1
0x1800869fc <+8>: tbnz x0, #0x3f, 0x180086a1c ; <+40>
0x180086a00 <+12>: ldr x9, [x0]
0x180086a04 <+16>: and x2, x9, #0x7ffffffffffff8
-> 0x180086a08 <+20>: ldrsh w9, [x2, #0x1e]
0x180086a0c <+24>: tbz w9, #0x1f, 0x180086a50 ; <+92>
0x180086a10 <+28>: mov x1, x8
0x180086a14 <+32>: b 0x1800625f4 ; class_respondsToSelector_inst
0x180086a18 <+36>: ret
0x180086a1c <+40>: adrp x9, 443242
0x180086a20 <+44>: add x9, x9, #0xa00 ; objc_debug_taggedpointer_classes
0x180086a24 <+48>: and x10, x0, #0x7
0x180086a28 <+52>: ldr x2, [x9, x10, lsl #3]
0x180086a2c <+56>: adrp x9, 443242
0x180086a30 <+60>: add x9, x9, #0x170 ; (void *)0x00000001ec3f0120: __NSUnrecognizedTaggedPointer
0x180086a34 <+64>: cmp x2, x9
0x180086a38 <+68>: b.ne 0x180086a08 ; <+20>
0x180086a3c <+72>: ubfx x9, x0, #55, #8
0x180086a40 <+76>: adrp x10, 443242
0x180086a44 <+80>: add x10, x10, #0x200 ; objc_debug_taggedpointer_ext_classes
0x180086a48 <+84>: ldr x2, [x10, x9, lsl #3]
0x180086a4c <+88>: b 0x180086a08 ; <+20>
0x180086a50 <+92>: adrp x9, 395193
0x180086a54 <+96>: add x1, x9, #0xfb0
0x180086a58 <+100>: mov x2, x8
0x180086a5c <+104>: b 0x18005f000 ; objc_msgSend