instabug-cordova
Version:
The purpose of this plugin is to simplify the process of integrating the Instabug SDK in a hybrid application, as well as to provide an interface to interfacing with the SDK through JavaScript.
35 lines (29 loc) • 864 B
JavaScript
/*
* Instabug Chats module.
* @file chats.js
*/
var exec = require('cordova/exec');
/**
* Chats module
* @exports Chats
*/
var Chats = function() {};
/**
* Enables or disables all chats functionalities.
* @param {boolean} isEnabled
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
Chats.setEnabled = function(isEnabled, success, error) {
exec(success, error, 'IBGPlugin', 'setChatsEnabled', [isEnabled]);
};
/**
* Shows chats with the option of chats list or new chat.
* @param {boolean} withChatsList
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
Chats.show = function(success, error) {
exec(success, error, 'IBGPlugin', 'showChats');
}
module.exports = Chats;