Skip to content

Installation

Tianyong Tang edited this page Mar 16, 2017 · 3 revisions

There are several ways to integrate LeanCloud Objective-C SDK to your project.

CocoaPods

CocoaPods is a popular dependency manager for Cocoa. You can install it with the following command:

$ gem install cocoapods # Maybe sudo permission is required.

CocoaPods 0.39.0+ is required to integrate LeanCloud Swift SDK. Please check the version after installation.

Then, specify AVOSCloud or other modules in your Podfile:

use_frameworks! # LeanCloud Swift SDK can only be integrated as a dynamic framework.

pod 'AVOSCloud'                  # The foundation module
pod 'AVOSCloudIM'                # The IM module
pod 'AVOSCloudCrashReporting'    # The crash reporting module

Finally, run the following command to integrate:

$ pod install

Integrate with Framework

If you do not want to use CocoaPods, you can manually integrate SDK using the pre-built frameworks.

You can use our pre-built frameworks can be found at releases page. You should select frameworks according to the platforms your app supported and the features you need. For example, if you want to enjoy IM on macOS, you should download AVOSCloud-macOS.framework.zip and AVOSCloudIM-macOS.framework.zip.

You can also build frameworks from scratch by yourself. Just clone the repository and execute command ruby build-framework.rb, then, you can find the product under AVOS/AVOSCloud.xcodeproj/build.

Then, Extract frameworks from zip files. Remove platform suffix of file name. For example, you should rename the AVOSCloud-iOS.framework to AVOSCloud.framework.

Drag frameworks in your project, and add them in "Linked Frameworks and Libraries" build phase.

Then, add system frameworks and libraries below that SDK depends on:

  • libz
  • libc++
  • libicucore
  • libsqlite3
  • SystemConfiguration.framework
  • MobileCoreServices.framework
  • CoreTelephony.framework
  • CoreLocation.framework

Set -ObjC flag in "Other Linker Flags" build setting.

Now, enjoy our SDK!