#iOS SDK beacons proximity marketing platform
##Installation
###Manual
-
Add
Evokly.frameworkto Embedded binaries & Linked Frameworks and Libraries in target settingsGeneraltab. -
import Evoklyor@import Evokly;. -
In
Build Phasesadd run script phase:bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Evokly.framework/strip-frameworks.sh" -
Add SwiftProtobuf 1.1.0 framework to the project
For Obj-c target: under
Build Settings, in sectionBuild OptionssetEmbedded Content Contains Swift Codeto YES.
###CocoaPods
use_frameworks!
pod 'Evokly'
pod 'SwiftProtobuf', '~> 1.1.0'###Carthage
github "evokly/ios-sdk"
// and then
carthage checkout##Using Evokly
Get your Public API Key from https://evok.ly and pass it along with subdomain to register funcion.
In application(application:didFinishLaunchingWithOptions launchOptions:):
Evokly.register(subdomain: "mySweetDomain", publicApiKey: "Long api key")before iOS 9:
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
let handled = Evokly.handleURL(url, sourceApplication: sourceApplication)
//Custom logic here
return handled
}for iOS 9 and later:
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
let handled = Evokly.handleURL(url, sourceApplication: options["UIApplicationOpenURLOptionsSourceApplicationKey"] as? String)
//Custom logic here
return handled
}Right click your Info.plist and Open as Source Code. Paste the following code before the last</dict>.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>evokly-mySweetDomain</string>
</array>
</dict>
</array> Then in AppDelegate:
func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification) {
let handled = Evokly.handleNotification(notification)
//Cusom logic here
}###Analytics
By default Evokly use UIDevice.currentDevice().identifierForVendor to track users. If you want to use Advertising Identifier, you can pass it to Evokly before registering.
Evokly.setAdvertisingIdentifier(someAdvertisingIdentifier)###Debuging There is a debug screen to help you see what's going on in Evokly. Present it with parent view controller.
func someButtonAction() {
Evokly.presentDebugViewController(parent: self)
}###Location
Right click your Info.plist and Open as Source Code. Paste the following code before the last</dict>.
<key>NSLocationAlwaysUsageDescription</key>
<string>App needs your location to work with beacons.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>App needs bluetooth to work with beacons.</string>