Salesforce Communities URL Endpoint with the Salesforce Mobile SDK & Xcode 6
Earlier this summer I was able to successfully (and quite easily) set up a hybrid_remote iOS application that pointed to a custom Salesforce community using the Salesforce Mobile SDK version 2.2. The only real change required after running the installer was a modification of the URL referenced from login.salesforce.com to custom-community.force.com, which is similar to what you’d need to do if you were testing in a sandbox environment with test.salesforce.com. However, the most recent time I needed to do this, I noticed that version 2.3 of the SDK was released, and had been rewritten a bit.
While the installation remained the same, some of the implementation details were a bit different. However, updating the [project]-info.plist file to set the SFDCOAuthLoginHost to my custom URL remained a consistent step. Unfortunately, I noticed that this wasn’t taking effect, and I was still seeing the login.salesforce.com domain when I ran the application.
I tried a variety of things, from deleting all the build files, deleting the derived data, deleting the app on the simulator, and finally recreating the project from scratch. None of these solutions worked, though to an extent they all have helped rectify issues I’ve had in Xcode or with the old SDK. I then tried to deploy to my actual phone, and lo and behold it worked! Finally posting to the GitHub repository’s issue tracker, I got a helpful result.
It turns out, there is something in the latest version of Xcode (6) that is likely not picking up the defined token correctly in the .plist file. While I am only speculating based on what I know about the SDK, the temporary solution noted was to open the iOS Simulator and reset it under iOS Simulator > Reset Content and Settings. Not the most ideal scenario, but something I can live with.