Latest 6.0.0
Homepage https://github.com/BoundlessAI/BoundlessKit-iOS
License MIT
Platforms ios 8.0
Frameworks Foundation, UIKit
Authors

Version
License
Platform

What is BoundlessKit?

BoundlessKit is a behavioral design SDK that provides personalized reinforcement schedules for user engagement.

Learn more at https://www.boundless.ai

Reinforcement Schedule Sample

Above is a sample reinforcement schedule with: [Reward, Reward, Neutral, Reward, Neutral]

Installing BoundlessKit

CocoaPods

To integrate into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'BoundlessKit'

Also if it is not already added, add [`use_frameworks!`](https://blog.cocoapods.org/CocoaPods-0.36/) to the top of the Podfile.

Carthage

To integrate into your Xcode project using Carthage, specify it in your Cartfile:

github "BoundlessAI/BoundlessKit-iOS"

Using BoundlessKit

Step 1: Setup

Import BoundlessKit in your application delegate:

Swift
import BoundlessKit
Objective-C
#import "BoundlessKit/BoundlessKit-Swift.h"


Then in your application delegate’s application(_:didFinishLaunchingWithOptions:) method, setup the SDK like so:

Swift
let bkConfig = BKConfiguration(appId: "YOUR_APP_ID",
                               versionId: "YOUR_VERSION_ID",
                               inProduction: IN_PRODUCTION,
                               devSecret: "YOUR_DEV_KEY",
                               prodSecret: "YOUR_PROD_KEY")
BKBoundlessKit.setup(configuration: bkConfig)
Objective-C
BKConfiguration* bkConfig = [[BKConfiguration alloc]
                               initWithAppId:@"YOUR_APP_ID"
                               versionId:@"YOUR_VERSION_ID"
                               inProduction: IN_PRODUCTION
                               devSecret:@"YOUR_DEV_KEY"
                               prodSecret:@"YOUR_PROD_KEY"];
[BKBoundlessKit setupWithConfiguration: bkConfig];


Step 2: Reinforcement

Immediately after the reinforced action in your app, call the reinforce(actionName:metadata:) method:

Swift
BKBoundlessKit.shared.reinforce(actionName: "Workout Completed")
Objective-C
[BKBoundlessKit.shared reinforceWithActionName:@"appOpen"];


Then register for and receive the reinforcement notification from NSNotificationCenter:

Swift
NotificationCenter.default.addObserver(self,
                                       selector: #selector(reinforce(notification:)),
                                       name: BKConstant.ReinforcementReportNotification,
                                       object: nil)
...
@objc
func reinforce(notification: Notification) {
    guard notification.userInfo?[BKConstant.ReinforcementReportActionKey] as? String == "Workout Completed",
        let reinforcement = notification.userInfo?[BKConstant.ReinforcementReportDecisionKey] as? String else {
            return
    }
    print("Got reinforcement:(reinforcement)")
}
Objective-C
[NSNotificationCenter.defaultCenter addObserver:self
                                       selector:@selector(reinforce:)
                                           name:BKConstant.ReinforcementReportNotification
                                         object:nil];
...
- (void) reinforce:(NSNotification*) notification {
    if ([notification.userInfo[BKConstant.ReinforcementReportActionKey] isEqual: @"Workout Completed"]) {
        NSString* reinforcement = (NSString*) notification.userInfo[BKConstant.ReinforcementReportDecisionKey];
        NSLog(@"Got reinforcement:%@", reinforcement);
    }
}


Display a visual effect for a reinforcement decision, and display no effect for neutral reinforcement decisions to build anticipation! The variable schedule will engage that user, since reinforcement schedules are personalized to that user’s past actions!

Step 3: Track

Tracking actions and other user behaviors can be used to optimize reinforcement schedules, as well as measure changes in engagement for statistical significance.

Swift
BKBoundlessKit.shared.track(event: "foodItemAdded", metadata: ["calories": 400])
Objective-C
[BKBoundlessKit.shared trackWithEvent:@"foodItemAdded" metadata:@{@"calories": @400}];


Latest podspec

{
    "name": "BoundlessKit",
    "version": "6.0.0",
    "summary": "A framework to use BoundlessAI reinforcement for iOS",
    "description": "Make your iOS app habit-forming using BoundlessAI.nThis packages provides a framework for interacting with BoundlessAI from a Cocoa based iOS application. After you have received your API key and configured the actions and reinforcements relevant to your app on the Boundless Developer Dashboard, you may use this framework to place 'tracking', and 'reinforcement' calls from inside your app that will communicate directly with BoundlessAI.",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/BoundlessAI/BoundlessKit-iOS",
    "social_media_url": "https://twitter.com/boundlessAI",
    "authors": {
        "BoundlessAI": "[email protected]"
    },
    "source": {
        "git": "https://github.com/BoundlessAI/BoundlessKit-iOS.git",
        "tag": "6.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.2",
    "public_header_files": "BoundlessKit/Classes/**/*.h",
    "source_files": "BoundlessKit/Classes/**/*.{h,m,swift}",
    "resource_bundles": {
        "BoundlessKit": [
            "BoundlessKit/Assets/*.png"
        ]
    },
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This