IBM® Worklight® Foundation provides Objective-C client-side API to develop native apps on iOS, you can use the Worklight 6.2 Command Line Interface (CLI) to integrate Worklight features into your mobile App
Below video demonstrates how to use CocoaPod to add the Worklight or Bluemix API to your Mobile Application..
IBM Worklight API for Native iOS CocoaPod
Video demo:
How to use CocoaPod to add Worklight or Bluemix iOS API
Step 1: Install required software
Download Worklight Studio or CLI:
Download CocoaPods:
Step 2: Use local path or remote git url to add Worklight Pod
Using local path:
Create a new file Worklight.podspec inside your Worklight project For example:
/Users/username/myWorklightProject/apps/wlnativeios/Worklight.podspec
The contents of Worklight.podspec
should describe a pod with information on how to add the Worklight API
Pod::Spec.new do |s|
s.name = "Worklight"
s.version = "6.2.0.0"
s.summary = "IBM Worklight iOS Native API"
s.description = <<-DESC
The IBM Worklight iOS Native API for Worklight Foundation
DESC
s.homepage = "http://www.ibm.com/developerworks/mobile/worklight"
s.license = "IBM"
s.author = { "Carlos Santana" => "csantana@us.ibm.com" }
s.platform = :ios, "5.1.1"
s.source = { :git => "https://hub.jazz.net/git/csantana23/worklight-ios.git", :tag => s.version.to_s }
s.source_files = "WorklightAPI/include/*.h"
s.public_header_files = "WorklightAPI/include/*.h"
s.resources = ["WorklightAPI/Localizations.bundle"]
s.vendored_frameworks = 'WorklightAPI/Frameworks/sqlcipher.framework'
s.ios.vendored_library = 'WorklightAPI/libWorklightStaticLibProjectNative.a'
s.frameworks = "CoreData", "CoreLocation", "MobileCoreServices", "Security", "SystemConfiguration"
s.libraries = "stdc++.6", "z"
s.requires_arc = false
s.xcconfig = {'USER_HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Worklight/WorklightAPI/include"'}
end
Then edit Podfile (same directory as App.xcodeproj) to point to local path
platform :ios, '7.0'
pod 'Worklight', :path => '/Users/username/myWorklightProject/apps/wlnativeios'
Using remote git url:
You can host the Worklight API Pod in your own Git repository to be re-use by your organization.
Just copy the files from the Worklight Project into a Git repository in your's company network including the Worklight.podspec.
The repository should look like this repostory (https://hub.jazz.net/project/csantana23/worklight-ios), but this repository should not be use for production, it's only for demo purposes.
Then edit Podfile (same directory as App.xcodeproj) to point to git url
platform :ios, '7.0'
pod 'Worklight', :git => 'https://hub.jazz.net/git/csantana23/worklight-ios.git'
Step 3: Install the Pod
Now you can install the dependencies in your project:
$ pod install
Step 4: Open XCode Workspace (.xcworkspace) not Project (.pbxproj)
Make sure to always open the Xcode workspace instead of the project file when building your project:
$ open -a /Applications/Xcode.app App.xcworkspace
Step 5: Add the worklight.plist file from your Worklight Project
The worklight.plist is not included since it specific to your Worklight Project
-
Select your XCode Project for your App
-
Right click and select Add Files to "App"...
-
Find the location of worklight.plist
/Users/username/myWorklightProject/apps/wlnativeios/worklight.plist
-
Check box "Copy items into destination group's folder (if needed)"
-
Select "Create groups for any added fodlers"
-
Make sure App target is check in "Add to targets"
Step 6: There is no step 6 :-)
References
Tags: 
worklight