UNPKG

nativescript-plugin-botjet

Version:
42 lines 1.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var utils = require("tns-core-modules/utils/utils"); var botjet_common_1 = require("./botjet.common"); var BotJetSDK = (function (_super) { __extends(BotJetSDK, _super); function BotJetSDK() { return _super !== null && _super.apply(this, arguments) || this; } BotJetSDK.launchChatWithConfig = function (config) { var options = new ai.botjet.android.nativesdk.model.BotConfig(); options.setBotId(config.botId); options.setClientId(config.clientId); if (config.accentColor) { options.setAccentColor("#323b8c"); } if (config.title) { options.setTitle(config.title); } if (config.isAnonymous) { options.setAnonymous(config.isAnonymous); } if (config.botIcon) { options.setBotIcon(config.botIcon); } options.setHost(config.host || "https://qa.botjet.ai"); options.setLocationRequired(config.isLocationRequired || true); if (config.senderId) { options.setSenderId(config.senderId); } if (config.profileMeta) { options.setProfileMeta(config.profileMeta.toString()); } var intent = new android.content.Intent(utils.ad.getApplicationContext(), ai.botjet.android.nativesdk.activities.ChatActivity.class); intent.putExtra("BOT_CONFIG", options); intent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); utils.ad.getApplicationContext().startActivity(intent); }; return BotJetSDK; }(botjet_common_1.BotJetSDKCommon)); exports.BotJetSDK = BotJetSDK; //# sourceMappingURL=botjet.android.js.map