Category Archives: Uncategorized

Announcing Mobile SDK for iOS 5.0.1

Is your Salesforce Mobile SDK app ready for iOS 10.3? We’ve got your back with the upcoming 5.0.1 patch. You’ll need this patch to support iOS 10.3 in Mobile SDK. This patch has no effect in iOS versions earlier than 10.3. Look for an announcement that the patch is posted on Thursday, February 16, in the SalesforceMobileSDK Google+ community.

Upgrading Mobile SDK for iOS

How you upgrade to Mobile SDK 5.0.1 depends on your project type.

Native apps:

Run pod update in the project folder.

Hybrid apps:

  1. Uninstall and then reinstall forceios:
$>sudo npm uninstall -g forceios
$>sudo npm install -g forceios

2. Recreate your app using the forceios create command.

3. Copy your app’s resources to the www/ folder.

4. If you add plug-ins, be sure to uninstall and then reinstall the Mobile SDK plug-in after adding your last plug-in:

$>cordova plugin add <your last plugin>
$>cordova plugin remove com.salesforce
$>cordova plugin add 
https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin --force

5. Run cordova prepare.

For questions or issues, please post on the SalesforceMobileSDK Google+ community.

Advertisements

Consuming Mobile SDK for Android Through Gradle

Late-Breaking Feature Addition! Beginning with Salesforce Mobile SDK 5.0, we’re providing native Android libraries on Bintray’s jCenter Maven repository. As a result, you can now consume any Mobile SDK library by adding a single line to the dependencies section of your app’s build.gradle file. 

What’s the value of this change? Upgrade ease! To upgrade a library, you simply change its version number in your build.gradle file to the updated version, and then resync your libraries.

The Details

Here’s how you do it. A typical dependencies section looks like this:

 dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
 }

To import libraries, you add a Gradle compile statement in this section. A compile statement takes the form

compile 'groupID:artifactID:version'

For Mobile SDK libraries:

  • Group ID is “com.salesforce.mobilesdk”
  • Artifact ID is “SalesforceSDK”, “SmartStore”, or “SmartSync”
  • Version is currently “5.0.0”

The compile statement imports not only the specified library, but also all its dependencies. This means that you never have to explicitly compile SalesforceAnalytics, for example, because every other library depends on it. It also means that you can get everything you need with just one statement.

To import Mobile SDK 5.0.0 libraries, add one of the following lines:

  • For the SalesforceSDK library:
     compile 'com.salesforce.mobilesdk:SalesforceSDK:5.0.0'
  • For the SmartStore library (also imports the SalesforceSDK library):
     compile 'com.salesforce.mobilesdk:SmartStore:5.0.0'
  • For the SmartSync library (also imports the SalesforceSDK and SmartStore libraries):
compile 'com.salesforce.mobilesdk:SmartSync:5.0.0'

Note:  SalesforceHybrid and SalesforceReact libraries are not currently available through Maven.
For more details on the Salesforce Mobile SDK packages on Maven, visit our repository at bintray.com/forcedotcom/salesforcemobilesdk.

Tips for Upgrading Mobile SDK Apps for iOS 9

iOS 9 is here, and we’ve got a couple of tips for how to update your Mobile SDK apps.

If at all possible, you should update your app to Mobile SDK 3.3.1 (or later), and then apply the fix in Tip #1. If you’re unable to update at this time, you should implement both Tip #1 and Tip #2.

Tip #1

In iOS 9, Apple introduces an Application Transport Security feature for secure network connections. See https://developer.apple.com/library/ios/technotes/App-Transport-Security-Technote/ for a list of their requirements.

Salesforce servers use TLS 1.2 but do not yet support forward secrecy. Until they do, Mobile SDK apps need to disable the forward secrecy requirement. If you created your app with Mobile SDK 3.3.1 or later, you don’t need to change anything. If your app is based on Mobile SDK templates from a version earlier than 3.3.1, add the following configuration to your application plist:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>salesforce.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>force.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>

To see these how we made these changes for Mobile SDK 3.3.1, check out https://github.com/forcedotcom/SalesforceMobileSDK-iOS/pull/1170.

Tip #2

iOS 9 introduces subtle behavior changes in the unarchiveObjectWithFile: method of NSKeyedUnarchiver. Due to these changes, users automatically get logged out after restarting any iOS Mobile SDK app built with Mobile SDK 3.3 or earlier. We’ve fixed this issue in the Mobile SDK 3.3.1 release. We urge all iOS developers to update to Mobile SDK 3.3.1 (or later). Otherwise, your application won’t behave properly on iOS 9 devices.

If for some reason you can’t upgrade to 3.3.1 (or later) at this time, you’ll need to edit the SDK source code and rebuild the SDK. Here are the details for manually addressing this issue:

The unarchiveObjectWithFile: message of the NSKeyedUnarchiver class now returns nil upon failure, instead of throwing an exception. You’ll need to update SFUserAccountManager.m manually as shown here:
https://github.com/forcedotcom/SalesforceMobileSDK-iOS/pull/1123/files

After making the change, rebuild the Mobile SDK libraries and then use them to rebuild your app.

Salesforce Mobile SDK 2.2.0 is Now Available

Salesforce Mobile SDK 2.2.0 is live!

Grab the latest here:

Android:
On GitHub – https://github.com/forcedotcom/SalesforceMobileSDK-Android/tree/v2.2.0
On npm – https://npmjs.org/package/forcedroid

iOS:
On GitHub – https://github.com/forcedotcom/SalesforceMobileSDK-iOS/tree/v2.2.0
On npm – https://npmjs.org/package/forceios

Release Notes:
Android – https://github.com/forcedotcom/SalesforceMobileSDK-Android#whats-new-in-22
iOS – https://github.com/forcedotcom/SalesforceMobileSDK-iOS#whats-new-in-22

Salesforce Mobile SDK Development Guide (browser download):
https://github.com/forcedotcom/SalesforceMobileSDK-Shared/blob/master/doc/mobile_sdk.pdf?raw=true