Following close on the heels of our 4.0 major release and 4.0.1 patch, the 4.0.2 patch for Mobile SDK (Android and iOS) is now available. This patch primarily affects CocoaPods podspecs for iOS developers. We’ve also republished both forceios and forcedroid to keep them on the same version. See the section below for more details on what’s new.
- Uninstall and reinstall forceios and forcedroid from npm.
- On iOS, rework your podspecs as described in the following section.
- If you use the GitHub repos, merge these tags:
In Mobile SDK for iOS 4.0.1, our podspec configuration didn’t exert enough control over external dependency versions. For 4.0.2, we’ve now removed the
SalesforceMobileSDK-iOS podspec and replaced it with a separate podspec for each Mobile SDK module. We’ve also added a new GitHub repo, https://github/forcedotcom/SalesforceMobileSDK-iOS-Specs, that serves as the archive for all versions of our podspecs.
The new podspecs are:
SalesforceSDKCore—Implements OAuth and passcodes. All other pods except
FMDB depend on this pod, either directly or indirectly.
SalesforceNetwork—Networking library (with transparent token refresh when session expires). Depends on
SalesforceRestAPI—REST API wrappers for accessing Salesforce data. Depends on
FMDB—The Mobile SDK fork of FMDB, a third-party Objective-C wrapper for SQLite. This fork implements customized logging and
imports SQLCipher with full-text search support.
SmartStore—Implements secure offline storage. Depends on
SmartSync—Implements offline synchronization. Depends on
Here’s how to update your Podfile for the 4.0.2 patch.
1. In your project’s Podfile, add the
SalesforceMobileSDK-iOS-Specs repo as a source before adding the CocoaPods source.
target 'YourAppName' do # must get SalesforceMobileSDK-iOS-Specs # source first (before CocoaPods)! source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git' source 'https://github.com/CocoaPods/Specs.git'
2. Declare each pod on a separate line.
pod 'SalesforceSDKCore' pod 'SalesforceNetwork' pod 'SalesforceRestAPI'
Or, thanks to dependency chains, this will work if you’re using the current release:
If you currently have a podspec that calls
pod SalesforceMobileSDK-iOS with subspecs for Mobile SDK modules, such as:
pod 'SalesforceMobileSDK-iOS', :subspecs =>[ 'SalesforceRestAPI' ]
Replace this call with individual
pod calls, as shown above.
Working with an Unstable Branch
To work with an upcoming release of Mobile SDK, you clone the unstable branch of the
SalesforceMobileSDK-iOS repo, and then pull resources from it.
- Clone github.com/forcedotcom/SalesforceMobileSDK-iOS locally at the desired commit.
- At the terminal window, run
./install.shin the root directory of your clone.
- To each pod call in your Podfile, add a
:pathparameter that points to your clone. Note that you shouldn’t skip dependencies if you’re specifying a path—you need to call the
podcommand individually for each module.
Here’s the previous example repurposed to pull resources from a local clone:
target 'YourAppName' do
# must get SalesforceMobileSDK-iOS-Specs # source first (before CocoaPods)! source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git' source 'https://github.com/CocoaPods/Specs.git' pod 'SalesforceSDKCore', :path => '/<path-to-clone-of>/SalesforceMobileSDK-iOS/' pod 'SalesforceNetwork', :path => '/<path-to-clone-of>/SalesforceMobileSDK-iOS/' pod 'SalesforceRestAPI', :path => '/<path-to-clone-of>/SalesforceMobileSDK-iOS/' end
For more information, see the Salesforce Mobile SDK Development Guide at https://github.com/forcedotcom/SalesforceMobileSDK-Shared/blob/master/doc/mobile_sdk.pdf?raw=true.