Client integration
This article describes the development environment that needs to be prepared before using the whiteboard SDK formally.
Prerequisites
- Xcode 10.10
- iOS 9.0
Get sdkToken
Read Access Preparation, register for an account, and get the sdk token.
Add SDK to the project
Option 1: Add with Cocoapods
If you have n’t come into contact with Cocoapods, we recommend that you go to docs;
If you find the above two articles cumbersome, you can install them directly according to the brief steps we provide.
- Brief steps: Open the terminal that comes with mac, and then enter and execute the following commands in order.
## Note: Ruby-China recommends 2.6.x, the actual ruby that comes with mac can also be used
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
gem sources -l
## Note: The above command should output the following, >>> means here is the output
>>> https://gems.ruby-china.com
## Note: Make sure only gems.ruby-china.com
sudo gem install cocoapods
## Note: Since we don't need to use the official library, we can not perform pod setup.
Using Podfile Integration
- Create a Podfile. Enter the project path in Terminal and enter the following command line. After inputting, a Podfile text file will appear under the project path.
`shell pod init
`
- Add SDK reference. Add the following to the Podfile in the project root directory. Note "Your App" is your target name
platform :ios, '9.0'
target 'Your App' do
pod 'Whiteboard'
end
- Install the SDK.
If you haven't pulled the pod repository for a long time, we may not be able to find our repo. At this time, it is recommended to use
pod repo update
to update the pod repository first.
pod install
If Terminal displays Pod installation complete !, the automatic library addition is complete. Click to open the project's YourApp.xcworkspace file, or enter the following command line to open it. Note that "Your App" is your Target name.
open YourApp.xcworkspace
Method 2: Add manually (not recommended)
- Download cocoapods released version.
- Switch to different branches according to the corresponding version installed. (It is recommended to choose the latest tag instead of the latest commit to ensure operability)
- Enter the
Example
folder, executepod install
, and then build the project. Under the Pod Project, find theProducts
folder, copy theWhiteboard.framework
file, and copy it to the corresponding file. - In the project to be integrated, select the Build Phases tab, find the
Link Binary with Libraries
item, and click the icon to start addingWebKit.framework
.