|
9 | 9 | * When a conflict occurs these methods may not be invoked. |
10 | 10 | * The solution provided by the AppsFlyer Unity Plugin is [Swizzling](https://medium.com/rocknnull/ios-to-swizzle-or-not-to-swizzle-f8b0ed4a1ce6). |
11 | 11 | * Starting from `v6.0.7` there is an option to enable swizzling automatically. |
| 12 | +We recommend using the macroprocessor option, which is the easiest one. This option is supported from version v6.5.3. |
| 13 | + |
| 14 | +To enable Swizzling, you have 3 options: |
| 15 | +- [Using info .plist](#info) |
| 16 | +- [Using a c# Script](#script) |
| 17 | +- [Using macroprocessor starting v6.5.3](#macro) |
| 18 | + |
| 19 | +#### <a id="info"> Using info .plist |
| 20 | + |
12 | 21 | * To enable swizzling, in the info.plist file, a boolean K/V called `AppsFlyerShouldSwizzle` should be set to 1 (true). |
13 | 22 | * This will automatically enable swizzling and solve conflicts with other plugins. |
14 | | -* This can also be accomplished on the c# side by following these steps: |
| 23 | +* Validate that the code in the [AppsFlyer+AppController](https://github.com/AppsFlyerSDK/appsflyer-unity-plugin/blob/master/Assets/AppsFlyer/Plugins/iOS/AppsFlyer%2BAppController.m) is called on the native side. |
| 24 | +* Comment out `IMPL_APP_CONTROLLER_SUBCLASS(AppsFlyerAppController)` in AppsFlyerAppController.mm. |
| 25 | + |
| 26 | +--- |
15 | 27 |
|
| 28 | +#### <a id="script"> Using a c# Script |
16 | 29 | 1. Create a new c# script. (we called ours AFUpdatePlist.cs) |
17 | 30 | 2. Place the script in a editor folder (Assets > Editor > AFUpdatePlist.cs) |
18 | 31 | 3. The code in the script should look like this: |
@@ -50,3 +63,11 @@ public class MyBuildPostprocessor { |
50 | 63 | 4. Validate that the code in the [AppsFlyer+AppController](https://github.com/AppsFlyerSDK/appsflyer-unity-plugin/blob/master/Assets/AppsFlyer/Plugins/iOS/AppsFlyer%2BAppController.m) is called on the native side. |
51 | 64 | 5. Comment out `IMPL_APP_CONTROLLER_SUBCLASS(AppsFlyerAppController)` in AppsFlyerAppController.mm. |
52 | 65 |
|
| 66 | +--- |
| 67 | + |
| 68 | +#### <a id="macro"> Using macroprocessor |
| 69 | +* Add the [preprocessor macro](https://stackoverflow.com/a/26928784) flag `AFSDK_SHOULD_SWIZZLE=1` to the build settings of the project. |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +* Validate that the code in the [AppsFlyer+AppController](https://github.com/AppsFlyerSDK/appsflyer-unity-plugin/blob/master/Assets/AppsFlyer/Plugins/iOS/AppsFlyer%2BAppController.m) is called on the native side. |
0 commit comments