To use Omnicrow iOS SDK, you have to communicate with us through Mobillium
- iOS 9.0+
- Xcode 8.0+
- Swift 3.2+
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate Omnicrow into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'Omnicrow', '~> 1.0'
Then, run the following command:
$ pod install
You need to get app id for your application Mobillium
- OmnicrowAppID Will be provided by Mobillium
- OmnicrowSandbox true if you want to test in sandbox environment
In Xcode, secondary-click your project's .plist file and select Open As -> Source Code.
Insert the following XML snippet into the body of your file just before the final element.
If you already have same keys you need to merge them
<dict>
...
<key>OmnicrowAppID</key>
<string>exm123456</string>
<key>OmnicrowSandbox</key>
<true/>
AppDelegate.swift
import Omnicrow
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
Omnicrow.shared.active("Base_Url","Base_Url_For_Sandbox")
return true
}
import Omnicrow
Omnicrow.shared.setUserId("userId")
import Omnicrow
Omnicrow.shared.logOut()
import Omnicrow
Omnicrow.logEvent(.item(id: "product_id))
import Omnicrow
Omnicrow.showPopUp(self)
import Omnicrow
var contentId = contentId = "Category > \(category.name) > \(sub_category.name) > \("...")"
Omnicrow.logEvent(.category(path: contentId))
import Omnicrow
Omnicrow.logEvent(.cart(items: [OmnicrowProduct(id: "product_id, quantity: "product_quantity", price: "product_price)]))
import Omnicrow
Omnicrow.logEvent(.purchase(id: "order
_id", totalPrice: "order_total_price", items: [OmnicrowProduct(id: "product_id", quantity: "product_quantity", price: "product_price")]))
You must give location permission for detecting beacons.
In Xcode, secondary-click your project's .plist file and select Open As -> Source Code.
Insert the following XML snippet into the body of your file just before the final element.
<dict>
...
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string></string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
These options must be selected.
import Omnicrow
Omnicrow.registerPush("pushToken")
Omnicrow is available under the MIT license. See the LICENSE file for more info.