CNISDKPMSKit 4.1.2

CNISDKPMSKit 4.1.2

TestsTested
LangLanguage Obj-CObjective C
License Custom
ReleasedLast Release Nov 2017

Maintained by Anton Domashnev, Anton Domashnev, mourad, Wladek Surala.


Downloads

Total8,183
Week0
Month444

Installs

Apps14
powered by Segment

GitHub

Stars2
Watchers7
Forks0
Issues0
Contributors4
Pull Requests0

Code

Files13
LOCLines of Code 156


 
Depends on:
CNISDKCoreKit= 4.1.2
CNISDKPaymentKit= 4.1.2
 

  • By
  • conichiGMBH

conichiSDK for iOS

Meta

Overview

conichiSDK for iOS is a tool that allows users to be recognized around the Beacon through Bluetooth Low Energy (BLE). Operated as a Software-as-a-Service (SaaS) solution, conichi’s features focus on personal guest recognition, fast-forwarding check-in, enabling mobile payment (thus check-out), identifying personal preferences, rewarding loyalty.

Kits

conichiSDK is following the idea of splitting functionality into different modules (so called kit) and now there are 4 modules available.

  • CNISDKCoreKit - provides beacon recognition, simple check-in/check-out, and guest personalization
  • CNISDKPaymentKit - provides abstract layer for managing of payment instruments, checkout request with payment
  • CNISDKPaylevenKit - provides abstract layer for managing payment through Payleven
  • CNISDKSumUpKit - provides abstract layer for managing payment through SumUp
  • CNISDKGeoFencingKit - provides conichi's venues tracking by apple geofencing
  • CNISDKPMSKit - provides mobile check-in/check-out with property management system integration

Getting Started

Installation

Install as a framework

To use Conichi SDK, head on over to the releases page, and download the CNISDK.framework.zip. Extract the zip file and drag and drop all frameworks to the Project target -> general -> Embedded Binaries.

Alt text

Install via CocoaPods

The preferred way to integrate CNISDKCoreKit is via CocoaPods. Add the following lines to your Podfile:

use_frameworks!

pod 'CNISDKCoreKit'

Run pod install, and you should now have the latest CNISDKCoreKit release.

Install via Carthage

To integrate CNISDKCoreKit via Carthage add the following line to your Cartfile:

github "conichiGMBH/conichi-ios-sdk"

Run carthage update, and you should now have the latest version of CNISDKCoreKit in your Carthage folder.

Partial Installation

Following the links below you can find the instructions in the Getting Started section on how to install a specific kit:

Update info plist

Then, you must add a NSLocationAlwaysUsageDescription key to your project’s Info.plist containing the message to be prompted to the user.

<key>NSLocationAlwaysUsageDescription</key>
<string>This app needs your location so you can be recognized in the conichi Hotel</string>

Be careful, if you use NSLocationWhenInUseUsageDescription instead, The app may not work properly.

Enable some capabilities

Conichi cares about the security and therefore the SDK stores the authorization information in the iOS Keychain, but to be able to read and write values even if the SDK is not running, iOS system requires the Keychain Sharing capability.

Target -> Capabilities -> Keychain Sharing - Turn the switch On.

Alt text

And you're off! Take a look at the public documentation and start building.

Initialization

Example below shows the simplest setup for conichiSDK CoreKit that points to our sandbox server.

Objective-C
  //Create a configuration for the sdk instance
  CNISDKConfiguration *configuration = [CNISDKConfiguration configurationWithBlock:^(id<CNISDKMutableConfiguration> \_Nonnull mutableConfiguration) {
    mutableConfiguration.logLevel = CNISDKLogLevelInfo;
    mutableConfiguration.apiKey = @"your-api-key";
    mutableConfiguration.apiSecret = @"your-api-secret";
    mutableConfiguration.kits = @[ ];
    mutableConfiguration.environment = CNISDKEnvironmentSandbox;
  }];

  //Setups the sdk delegate - it can be any object that conforms to CNISDKDelegate protocol
  id<CNISDKDelegate> delegate = [self yourMethodToSetupSDKDelegate];

  //Start the sdk with the given configuration
  [CNISDK startWithConfiguration:configuration delegate:delegate];
Swift
  //Create configuration for the sdk instance
  let config: CNISDKConfiguration = CNISDKConfiguration() {
    (mutableConfig: CNISDKMutableConfiguration) in
    mutableConfig.logLevel = CNISDKLogLevel.info
    mutableConfig.apiKey = "your-api-key"
    mutableConfig.apiSecret = "your-api-secret"
    mutableConfig.kits = []
    mutableConfig.environment = CNISDKEnvironment.sandbox
  }

  //Setups the sdk delegate - make sure that you conform to the CNISDKDelegate protocol
  let delegate: CNISDKDelegate = self

  //Start the sdk with given configuration
  CNISDK.start(with: config, delegate: delegate)

After this setup you have an access to the instance of the [CNISDK sharedInstance] in Obj-C or CNISDK.sharedInstance() in Swift.

Signup with an external id

You can use an external_id to authenticate with conichi.

CNISDKExternalSignUpRequestInfo *requestInfo = [CNISDKExternalSignUpRequestInfo
 New];
requestInfo.externalID = @”unique identifier”;
requestInfo.firstName = @”Mike”;
requestInfo.lastName = @”Brown”;
[[CNISDKAPIManager sharedManager] signUpWithExternalIDRequestInfo:requestInfo completion:^(CNISDKGuest *guest, NSError *error) {
  If (error) {
    // request failed
  }
  else if (guest) {
    // request succeeded
  }
}];

Authorization

To start any real actions with the guest, the sdk requires the guest to be authorized. All methods related to authorization are in CNISDKAPIManager+Authentication category. The example below shows how to do a sign up for a new guest.

Objective-C
  //Create a sign up request
  CNISDKSignUpRequestInfo *info = [[CNISDKSignUpRequestInfo alloc] init];
  info.firstName = @"Jenessa";
  info.lastName = @"Gretta";
  info.email = @"[email protected]";
  info.password = @"strongestpasswordever=)";

  //Perform sign up
  [CNISDKAPIManager manager] signUpWithRequest:info completion:^(CNISDKGuest *guest, NSError *error){
    if (error) {
      //handle error during the sign up
    }
    else {
      //handle authorized guest
    }
  }];
Swift
// Create a signup request
let info = CNISDKSignUpRequestInfo()
info.firstName = "Jenessa"
info.lastName = "Gretta"
info.email = "[email protected]"
info.password = "strongestpasswordever=)"

// Instantiate APImanager
let apiManager = CNISDKAPIManager()

// Perform signup
apiManager.signUp(withRequest: info) {
  (guest, error) in
  if let error = error {
    //handle error during the sign up
    return
  }
  //handle authorized guest
}

Tracking

If the guest is authorized, the following code will enable tracking

Objective-C

[[CNISDK sharedInstance] startMonitoring];

Swift

CNISDK.sharedInstance().startMonitoring()

Now, if a guest is near a beacon he should be tracked. Customization of the tracking behavior is possible with callbacks. All callbacks can be found in CNISDKDelegate.h

Documentation

Documentation for each kit is available at the following links:

Documentation about Push Notifications integration can be found here:

Changelog

To see what has changed in recent versions of conichiSDK, see the CHANGELOG.

License

Copyright (c) 2016-present, сonichi GmbH.
All rights reserved.