Adding SDK
To use the SDK into your project you can have 2 approaches:
- Adding the SDK via Cocoapod (Recommended)
- Manually adding the Smartech.framework
Adding the SDK via Cocoapod (Recommended)
#ProTip
The most convenient way to use Smartech SDK in your iOS project is with CocoaPods, which is a dependency manager for Swift and Objective-C projects.
Always commit your code before you add any new frameworks.
For more details visit the official docs here.
- To install CocoaPods in your system, run the below command in your terminal.
sudo gem install cocoapods
- If you’re using CocoaPods first time, run the below command in your terminal to create a local CocoaPods spec mirror, else you can go to step 4.
pod setup
- Close your Xcode project and navigate to the project’s root directory and initialize the CocoaPods by running the below command, this will create a new file named Podfile which will be used to manage your project dependency.
pod init
- Now open the
Podfile
in your preferred text editor or run the below command which will open in your default text editor.
open Podfile
- In the
Podfile
you need to add theSmartech-iOS-SDK
dependency.
pod 'Smartech-iOS-SDK'
- The complete
Podfile
can be found below. (Your Podfile may be different as we have only added one dependency).
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
#app target
target 'YourAppTarget' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
# Pods for YourAppTarget
pod 'Smartech-iOS-SDK'
end
#ProTip
Always specify the platform version on which you plan to target the app deployment which should be 10 or above 10. (Here in the example we have
platform :ios, '10.0'
)
- Run the following command to install the added pods in your Podfile.
pod install
Once your installation is complete, you will have to open the workspace file (YOUR-PROJECT-NAME.xcworkspace) that is created.
You can refer the below video for detailed steps for adding the framework via CocoaPods. If you are unable to view the video then you can download the steps in PDF format from here.
Note:
If you want to update only a pod you can use the following command:
pod update POD_NAMEAnd if want to update a pod to a specific version then you need to mention the version of that pod in the Podfile besides pod name, example:
pod 'POD_NAME', '1.1'
and then you can use the update command mentioned above to update that pod to the mentioned version.
Manually adding the Smartech.framework
Following are the steps you need to perform to add framework manually:
- You can download the Netcore Smartech SDK from our GitHub repository or GitHub Master Direct Link.
- Unzip the downloaded file. You can find the framework file in the following folder structure flow Smartech-iOS-SDK-master > Frameworks > Smartech > Smartech.framework.
- Now in your Xcode project right-click on Project Name in project inspector and select the 'Add Files' option.
- Navigate to the folder in your system where Smartech.framework is located.
- Make sure you have selected copy items if needed and the App target.
- Click on the Add Option.
- Click on the ‘+’ button under Development Assets, this section is below Frameworks, Libraries, and Embedded Content.
- Search for Smartech.framework, select it, and click on Add.
You can refer to the PDF for detailed steps for manually adding the framework in your project.
Updated over 4 years ago