These docs are for v1.0. Click to read the latest docs for v2.0.

Adding SDK

To use the Smartech SDK into your project you can have 2 approaches:

  1. Adding the SDK via Cocoapod (Recommended)
  2. Manually adding the NetCorePush.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.
  1. To install CocoaPods in your system, run the below command in your terminal.
sudo gem install cocoapods
  1. 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
  1. 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
  1. Now open the Podfile in your preferred text editor or run the below command which will open in your default text editor.
open Podfile
  1. In the Podfile you need to add the Netcore-Smartech-iOS-SDK dependency for all targets.
pod 'Netcore-Smartech-iOS-SDK', '2.4.8'
  1. Add this line above the app target and below the platform.
source 'https://cdn.cocoapods.org/'
source 'https://github.com/NetcoreSolutions/Specs.git'
  1. 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, '9.0'

source 'https://cdn.cocoapods.org/'
source 'https://github.com/NetcoreSolutions/Specs.git'
 
#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 'Netcore-Smartech-iOS-SDK', '2.4.7'
end
 
#content extension target
target 'YourContentExtensionTarget' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!
  # Pods for 'YourContentExtensionTarget'
pod 'Netcore-Smartech-iOS-SDK', '2.4.7'
end
 
#service extension target
target 'YourServiceExtensionTarget' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!
  # Pods for 'YourServiceExtensionTarget'
pod 'Netcore-Smartech-iOS-SDK', '2.4.7'
end

📘

ProTip

Always specify the platform version on which you plan to target the app deployment. (Here in the example we have platform :ios, '9.0')

  1. Run the following command to install the Smartech SDK
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_NAME

And 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 NetCorePush.framework

Following are the steps you need to perform to add framework manually:

  1. You can download the Smartech SDK from our GitHub repository or GitHub Master Direct Link.
  2. Unzip the downloaded file.
  3. Search for the framework folder and right-click on it.
  4. Click on the Add Files to ‘Project Name’ in the list...
  5. Navigate to the folder where NetCorePush.framework is located.
  6. Select All three targets.
  7. Click on the Add Option.
  8. Click on the ‘+’ button under Development Assets, this section is below Frameworks, Libraries, and Embedded Content.
  9. Search for NetCorePush.framwork, select it and click on Add.

You can refer to the PDF for detailed steps for manually adding the framework in your project.