Integrating iOS SDK
Integrating with the Sample iOS App
Procedure
- Add and copy Discover.framework (within the DiscoverDynamic folder created on Desktop) to the project.
- Also add Discover.framework to the , Libraries, and Embedded Content section.
- Remove the library added by default in , within Libraries section.
-
Add
DCXCoreSettingsand DCFResources folder to the sample project so that you can play around with the settings values. These resource bundle files are available in the Discover project. -
In the Appdelegate file, add import Discover and one
line of code to make the SDK track events and user actions.
Add
DCFApplicationHelper.sharedInstance().enableDiscoverFramework()in applicationdidFinishLaunchingmethod. -
To enable debug logs in the console, add the following code in the
environment variables section of edit scheme:
DCX_DEBUG = 1 DCF_DEBUG = 1 IDEPreferLogStreaming = YES
Using Discover Framework Added to the Project
Procedure
- Make changes and pass values to the SDK through the files added in the DCXCoreSettings and DCFResources folder.
- Post the data from the sample app to the endpoint by adding the post URL in .
-
To take screenshot, change the values for params in
HCLGlobalScreenSettingsdictionary as shown in the following example:"takeScreenShot": true, "screenShotBlur" : 10 -
To blur the screenshot with a required value, complete the following
steps:
-
To take screenshots with different blur values for different screens,
complete the following steps:
-
To take screenshots without blur, pass
screenShotBlurvalue as 0 inHCLGlobalScreenSettingsor pass the blur value as 0 to theaddImageBlurValuemethod. -
In the
addImageBlurValue()method, pass the boolean value true to withScreenShotOnOffValue parameter to take the screenshot from code, and in theaddImageBlurValue()method, pass the boolean value false to the viewControllers parameter for not taking screenshot for a particular screen.
Creating Distribution Builds or Creating Archives
Procedure
-
To create an archive or install the sample app with SDK in an actual iOS
device, add
arm64architecture to Excluded Architectures section of debug and release the app. -
Make the earlier changes for the following targets:
- Discover, AutoPackageDiscover of Discover project
- Discover, DiscoverFatFrameworkBeta of DynamicFrameworks project