nativescript-launchkit
Integrate native launchkit iOS widgets into NativeScript
npm i --save nativescript-launchkit

Nativescript LaunchKitSDK Wrapper

#Setup LaunchKit Account#

Live Demo

Preview

Setup

Add this in your app.js

if (application.ios) {
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};

var appDelegate = (function (_super) {
__extends(appDelegate, _super);
function appDelegate() {
_super.apply(this, arguments);
}

appDelegate.prototype.applicationDidFinishLaunchingWithOptions = function (app, launchOptions) {
launchkit.initalize({
token: "OjMwhQZ5WgFFNZAQVBOYtWtAcXv1Kw2inxkzPEx_j6sK"
});
};

appDelegate.ObjCProtocols = [UIApplicationDelegate];
return appDelegate;
})(UIResponder);
application.ios.delegate = appDelegate;
}

API

var launchkit = require("nativescript-launchkit");
launchkit.initalize({
token: "", //From https://launchkit.io/sdk/install/,
debug: false //tells all methods that have debug flags to use them
});

isSuperUser: Returns bool

launchkit.isSuperUser();

setUser

launchkit.setUser({
id: "someid",
name: "steve",
email: "steve@launchkitsdk.com"
});

showOnboarding: Returns Promise (args: args)

launchkit.showOnboarding();

Onboarding needs to be called from a view, will fail in app.js due to there being no UIWindow yet

showReleaseNotes: Returns Promise (args: didPresent)

launchkit.showAppReviewCard({
page: page //args.object from your onNavigatingTo, or onPageLoaded events
});

showAppReviewCard: Returns Promise (args: didPresent, flowResult)

launchkit.showAppReviewCard({
page: page //args.object from your onNavigatingTo, or onPageLoaded events
});

Note: Unofficial plugin just wrapping the official iOS SDK