Get Started with the iOS SDK Follow
The Meridian iOS SDK has all the tools you’ll need to build your own Meridian-powered app.
Once you’ve added maps, routes, placemarks, and campaigns to the Meridian Editor, you can use the Meridian SDK to integrate that content into your Meridian-powered iOS app.
Go here to download the Meridian iOS SDK and Reference documentation.
The Meridian Samples App
The Meridian Samples app is included with the iOS SDK to demonstrate common Meridian features and workflows.
Add the SDK to Xcode
In order to simplify using the Meridian SDK library with your Xcode iOS project, we’ve bundled the SDK into a universal iOS framework.
The Meridian SDK must be compiled with Xcode 11 or higher and iOS 11 or higher.
You can add the SDK to your project using CocoaPods, an Objective-C and Swift dependency manager.
Add the SDK with CocoaPods
Complete these steps to add the Meridian SDK to your iOS Xcode project with CocoaPods.
-
Install CocoaPods.
$ gem install cocoapods
-
CocoaPods uses a textfile named Podfile to list dependencies. In the Podfile, add:
pod 'MeridianSDK'
-
Install the dependencies.
$ pod install
-
CocoaPods creates an
.xcworkspace
file. Make sure you use this to access your Xcode project.
Add SDK without CocoaPods
Complete these steps to add the Meridian SDK to your iOS Xcode project without CocoaPods.
Don’t complete these steps if you’re using CocoaPods.
-
In your Xcode project, put the Meridian.framework folder into the Embedded Binaries section.
-
In Build Settings in the Other Linker Flags property, make sure the -ObjC flag has been added. If not, then add it.
Add Build Script
Add a new “Run Script Phase” in your app target’s “Build Phases” and paste the following in the Run Script text field:
bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Meridian.framework/strip-frameworks.sh"
Configure the SDK
In order to access the Meridian classes, in the relevant source files, add the line:
#import <Meridian/Meridian.h>
The MeridianSamples project has an example of what your finished project structure should look like.
Before you start using the SDK’s features, you’ll need to configure the SDK for your project. To do this, create an instance of MRConfig and set it in your application:didFinishLaunchingWithOptions: method.
MRConfig \*config = [MRConfig new]; [Meridian configure:config];
Add a Meridian Token
Meridian uses token-based authentication. In order for your Meridian-powered app to communicate with the Editor, you’ll need to add a Meridian token to your didFinishLaunchingWithOptions
method:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) - Bool { // configure the Meridian SDK let config = MRConfig() config.applicationToken = "YOUR_EDITOR_TOKEN"
Comments
0 comments
Please sign in to leave a comment.