Name
sn_mab_api.MobilePluginsInstallationStatusService
Description
Checks if the Mobile plugins are installed
Script
var MobilePluginsInstallationStatusService = Class.create();
MobilePluginsInstallationStatusService.prototype = {
initialize: function() {
this.glidePluginManagerService = new GlidePluginManager();
},
type: 'MobilePluginsInstallationStatusService',
getPluginsInstallationStatus: function() {
// Plugin registry keys
var MOBILE_CARD_BUILDER_KEY = 'com.glide.servicenow_now_mobile_card_builder';
var MOBILE_STUDIO_ITEM_VIEW_BUILDER_KEY = 'com.sn_mobile_studio_itemview_builder';
var MOBILE_CARD_BUI_KEY = 'sn_mobile_card_bui';
var MOBILE_OFFLINE_KEY = 'com.glide.sg.offline';
var MOBILE_LOCATION_TRACKING_ID = 'com.glide.sg.location.tracking';
try{
var installationStatus = {
isMobileCardBuilderInstalled: this.glidePluginManagerService.isActive(MOBILE_CARD_BUILDER_KEY) || this.glidePluginManagerService.isActive(MOBILE_STUDIO_ITEM_VIEW_BUILDER_KEY) || this.glidePluginManagerService.isActive(MOBILE_CARD_BUI_KEY),
isMobileOfflineInstalled: this.glidePluginManagerService.isActive(MOBILE_OFFLINE_KEY),
isMobileLocationTrackingInstalled: this.glidePluginManagerService.isActive(MOBILE_LOCATION_TRACKING_ID),
};
response.setStatus(200);
response.setBody({
result: installationStatus
});
} catch(err){
response.setStatus(500);
response.setBody({
result: 'error: ' + new global.JSON().decode(err),
});
}
}
};
Sys ID
250e550e736220105dcd25799ef6a73c