Skip to content

Latest commit

Β 

History

History
49 lines (29 loc) Β· 3.25 KB

Instructions-iOS.md

File metadata and controls

49 lines (29 loc) Β· 3.25 KB

πŸ‘©β€πŸ’» iOS Specific Instructions:

iOS dependencies are added using CocoaPods Podfile. After exporting the project to XCode, you need to run pod install. This can be automated by EDM4U plugin to be done on each export. You can always manually install pods by running pod install in the exported XCode project. Ensure to start .xcworkspace to build the game with dependencies.

  1. Set your Account Id (Project ID), Account token (Project Token), and other settings in the CleverTap Settings Assets > CleverTap Settings

CleverTap Settings

This is needed so the CleverTap Post Processor script can add those settings automatically in the Info.plist file.

πŸ“˜ IDFV Usage for CleverTap ID

Starting from CleverTap Unity SDK 2.1.2, you can optionally disable the usage of IDFV for CleverTap ID. We recommend this for apps that send data from different iOS apps to a common CleverTap account. By default, the CleverTapDisableIDFV checkbox is false.

Initialization

On iOS, the SDK initialization is done using [CleverTap autoIntegrate] in the application:didFinishLaunchingWithOptions: method using CleverTapUnityAppController overriding the default UnityAppController.

If you use your own UnityAppController override, inherit from the CleverTapUnityAppController or call the CleverTap methods.

Settings

Disable IDFV

Set the CleverTapDisableIDFV setting to true, to disable the usage of IDFV for CleverTap ID.

Use autoIntegrate

Initializes the iOS SDK using [CleverTap autoIntegrate]. This swizzles the application and push notification methods automatically. If you need to disable swizzling, set the CleverTapIOSUseAutoIntegrate setting to false.

Use UNUserNotificationCenter

The UNUserNotificationCenterDelegate is required so notifications can be handled correctly. It is needed regardless of using autoIntegrate or not. If you implement the delegate in your own class, you can disable the UNUserNotificationCenterDelegate to be set to CleverTapUnityAppController by unchecking the CleverTapIOSUseUNUserNotificationCenter setting. In this case, you must implement the UNUserNotificationCenterDelegate methods yourself and call the CleverTap methods.

Present notification on foreground

Whether to present remote notifications while app is on foreground. Default value is false. The UNNotificationPresentationOptionNone is used. The notification will be handled without presenting it, if it has a deeplink, it will be opened. If changed to true, notification will be presented as banner/alert using UNNotificationPresentationOptionBanner/Alert | UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound options.

  1. Set up EDM4U plugin to install CocoaPods automatically. Go to Assets > External Dependency Manager > iOS Resolver > Settings. You can also install manually using pod install.

iOS Resolver Settings

  1. Open the .xcworkspace project.
  2. To enable Push Notifications, ensure to add the Push Notifications capability to your Xcode project.
  3. Build and run your iOS project.