Backendless iOS SDK in CocoaPods

It would be very useful for iOS developers.

Thanks, we will look into it.

I’ll second this…

Duly noted, it is on our immediate roadmap.

I’ve created a Backendless.podspec that can be used with CocoaPods (http://cocoapods.org) in iOS to simplify an application using your SDK’s. It’s located in the official Specs located at

https://github.com/CocoaPods/Specs/tree/master/Backendless

It would make things better if you would make a couple of changes to your deployment process as follows:

  1. Create tags in the repository that are based upon Semantic Versioning ( http://semver.org ). Having the pod spec based upon a version tag is fully supported by CocoaPods and will provide better developer support as you evolve the SDKs. The pod spec above is based upon a specific commit ID.

  2. Use iOS static library naming conventions. Right now the standard Backendless archive is called backendless.a and Xcode needs it to be libBackendless.a. In the pod spec I use a shell script to create soft links to make it work (libBackendless.a -> backendless.a).

Enjoy! :slight_smile:

Thanks, Peter. We’ll make the changes as you suggested. Any chance you could describe how a developer would go about creating a dependency injection for Backendless in their app?

Regards,
Mark

If you’re talking about an example of how to use the Backendless pod in an app, you’ll want to do the following:

  1. Make sure you have the Cocoapods ruby gem installed your system. If you don’t please follow the directions at http://cocoapods.org, or just fire up a terminal window and run ‘sudo gem install cocoapods’

  2. Startup Xcode and create a new Single View application project.

  3. Using your favorite text editor create a Podfile that looks like this:

platform :ios, '7.0' 
inhibit_all_warnings! 


pod 'Backendless', '~>0.0.1'

and save it in the directory of your newly created project.

  1. In order to download the header files and the static libraries, from the command line and from within the project directory, you’ll run the ‘pod install’ command. Once all of the pod data is downloaded from the github repository, it will create an Xcode project workspace.

  2. The final step is to open up the project workspace and start using Backendless. :slight_smile:

I’ve attached a SimpleLogin app as an example project. Please note after you unzip the project you’ll need to run the pod install command from the project directory, open the workspace, change the app id’s / secret’s and run it.

The beauty and power of this setup is you can go from “I have an idea” to using your app to sign-in using Backendless in minutes… :slight_smile:

SimpleLogin.zip (67.21kB)