Skip to content

mobillium/omnicrow-ios

Repository files navigation

Omnicrow iOS SDK

To use Omnicrow iOS SDK, you have to communicate with us through Mobillium

Requirements

  • iOS 9.0+
  • Xcode 8.0+
  • Swift 3.2+

Installation

CocoaPods

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

$ gem install cocoapods

Swift 3

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

App Id

You need to get app id for your application Mobillium

Usage

Configuration

  • 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/>

Initialize

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
}

Login

import Omnicrow

Omnicrow.shared.setUserId("userId")

LogOut

import Omnicrow

Omnicrow.shared.logOut()

Events

Product Views

import Omnicrow

Omnicrow.logEvent(.item(id: "product_id))

Show Pop-up

import Omnicrow

Omnicrow.showPopUp(self)

Category Views

import Omnicrow

var contentId = contentId = "Category > \(category.name) > \(sub_category.name) > \("...")"
Omnicrow.logEvent(.category(path: contentId))

Add to Cart Events

import Omnicrow

Omnicrow.logEvent(.cart(items: [OmnicrowProduct(id: "product_id, quantity: "product_quantity", price: "product_price)]))

Purchase Events

import Omnicrow

Omnicrow.logEvent(.purchase(id: "order
_id", totalPrice: "order_total_price", items: [OmnicrowProduct(id: "product_id", quantity: "product_quantity", price: "product_price")]))

Beacon

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.

Screenshots

Push

Push Register

import Omnicrow

Omnicrow.registerPush("pushToken")

License

Omnicrow is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published