Nativescript Kiip Wrapper
Setup
Add this to the app.js to run before application.start
if applicationios//iOSvar __extends = this__extends || {for var p in b if b dp = bp;{ thisconstructor = d; }__prototype = bprototype;dprototype = ;};var appDelegate = {;{_super;}appDelegateprototype {kiip;};appDelegateObjCProtocols = UIApplicationDelegate KiipDelegate;return appDelegate;}UIResponder;applicationiosdelegate = appDelegate;else//ANDROIDapplication;
iOS
Looks like kiip uses http, so in iOS we need to allow http in the info.plist per the guide
NSAppTransportSecurityNSAllowsArbitraryLoads
METHODS
var kiip = require("nativescript-kiip");
Save Moment
kiip.saveMoment({
id: "open_app"
}).then(function (args) {
if (args.poptart != null) {
if (app.android) {
var context = app.android.currentContext;
args.poptart.show(context); //<-- CRASH HERE
}else if(app.ios){
debugger;
args.poptart.show();
}
}
viewModel.debug = "Saved Moment " + new Date()
}, function (args) {
viewModel.debug = "Save Moment Failed";
});
OPTIONS
exports {kiip;}exports {kiip;}exports {kiip;}//iOS Onlyexports {kiip;}//iOS Onlyexports {kiip;}