Steps to integrate the SDK within your iOS app
After setting up the SDK, you must integrate the BusinessMessagingSDK within your iOS app.
The following two ways can integrate this:
1. Automated integration using CocoaPods: This method involves using CocoaPods (dependency manager) to add third-party frameworks and libraries to Xcode projects.
2. Manual integration: Integrate BusinessMessagingSDK manually without any dependency manager
Automated integration using CocoaPods
To integrate the SDK on your app, you must create a Podfile for your project to use CocoaPods.
Follow the instructions below to generate a Podfile if you still need to.
1. In the Terminal, navigate to the top folder of your project (the folder with the xcodeproj file).
2. Execute the $ pod init command.
3. Open the Podfile in Xcode by executing the open -a Xcode Podfile command.
The content appears as follows:
# Uncomment this line to define a global platform for your project
# platform :ios, '13.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'My Sample App' do
end
4. If you use Swift, uncomment the use_frameworks! line.
You must include the BusinessMessagingSDK in the Podfile to install the SDK in your project.
Follow these instructions to accomplish this.
1. Include the SDK of your choice in the Podfile. Include the following code in the do block of the Podfile to integrate the BusinessMessagingSDK.
- target 'My Sample App' do
pod 'BusinessMessagingSDK'
end
2. Save the Podfile.
3. Execute the $ pod install command in the Terminal.
Before installation of CocoaPods, the file will be opened as xcodeproj.
After installation, close the xcodeproj file and open the xcworkspace file.
Manual integration
To integrate BusinessMessagingSDK, follow these steps:
1.
Download the SDK of BusinessMessagingSDK.
2. Decompress the downloaded zip file with
.XCFramework extension.
3. Drag and drop the respective framework file to your Xcode project bundle's Frameworks, Libraries, and Embedded Content section.
The BusinessMessagingSDK is compatible with iOS 13 and all later versions.
If you want to integrate the BusinessMessagingSDK, make sure to add the NSPhotoLibraryUsageDescription, NSCameraUsageDescription,NSLocationAlwaysUsageDescription,NSLocationWhenInUseUsageDescription and NSMicrophoneUsageDescription keys in the info.plist file of your app. Failing to add the keys mentioned above to the info.plist file will result in an app crash when launching the app or when the relevant view controller is presented, and Appstore validation may fail.