UNPKG

ca-mas-foundation-cordova

Version:
161 lines (117 loc) 9.81 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: MASPluginApplication.js</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Source: MASPluginApplication.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>/* * Copyright (c) 2016 CA, Inc. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * */ var MASPluginUtils = require("./MASPluginUtils"), MASPluginConstants = require("./MASPluginConstants"); var MASPluginApplication = function() { ///------------------------------------------------------------------------------------------------------------------ /// @name Constants ///------------------------------------------------------------------------------------------------------------------ this.MASAuthenticationStatus = { /** * MASAuthenticationStatusNotLoggedIn represents that the app has not been authenticated */ MASAuthenticationStatusNotLoggedIn: -1, /** * MASAuthenticationStatusLoginWithUser represents that the app has been authenticated with user */ MASAuthenticationStatusLoginWithUser: 0, /** * MASAuthenticationStatusLoginAnonymously represents that the app has been authenticated with client credentials */ MASAuthenticationStatusLoginAnonymously: 1 }; ///------------------------------------------------------------------------------------------------------------------ /// @name Properties ///------------------------------------------------------------------------------------------------------------------ /** * Checks if application is authenticated * @param {function} successHandler user defined success callback * @param {function} errorHandler user defined error callback */ this.isApplicationAuthenticated = function(successHandler, errorHandler) { return Cordova.exec(successHandler, errorHandler, "MASPluginApplication", "isApplicationAuthenticated", []); }; /** * Returns the authentication status of the application * @param {function} successHandler user defined success callback * @param {function} errorHandler user defined error callback */ this.authenticationStatus = function(successHandler, errorHandler) { return Cordova.exec(successHandler, errorHandler, "MASPluginApplication", "authenticationStatus", []); }; ///------------------------------------------------------------------------------------------------------------------ /// @name Enterprise App ///------------------------------------------------------------------------------------------------------------------ /** * Launches the selected enterprise App * @param {function} successHandler user defined success callback * @param {function} errorHandler user defined error callback * @param {string} appId app ID of the app that needs to be launched */ this.launchApp = function(successHandler, errorHandler, appId) { document.addEventListener("backbutton", MASPluginUtils.onBackKeyPressEvent, false); return Cordova.exec(successHandler, errorHandler, "MASPluginApplication", "launchApp", [appId]); }; /** * Retrieves all the enterprise apps in the form of JSON from the server. It includes both native and web apps * @param {function} successHandler user defined success callback * @param {function} errorHandler user defined error callback */ this.retrieveEnterpriseApps = function(successHandler, errorHandler) { return Cordova.exec(successHandler, errorHandler, "MASPluginApplication", "retrieveEnterpriseApps", []); }; ///------------------------------------------------------------------------------------------------------------------ /// @name Enterprise Browser ///------------------------------------------------------------------------------------------------------------------ /** * Initializes the Enterprise Browser window and populates it with the native and web apps registered in the MAG server * @param {function} successHandler user defined success callback * @param {function} errorHandler user defined error callback */ this.initEnterpriseBrowser = function(successHandler, errorHandler) { var result = Cordova.exec(function(result) { MASPluginUtils.MASPopupUI(MASPluginConstants.MASEnterpriseBrowserPage, function() {}, function() { displayApps(result); successHandler(true); }); }, errorHandler, "MASPluginApplication", "retrieveEnterpriseApps", []); return result; }; } module.exports = MASPluginApplication;</code></pre> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#active">active</a></li><li><a href="global.html#addresses">addresses</a></li><li><a href="global.html#authenticationStatus">authenticationStatus</a></li><li><a href="global.html#authorize">authorize</a></li><li><a href="global.html#cancelAuthentication">cancelAuthentication</a></li><li><a href="global.html#cancelGenerateAndSendOTP">cancelGenerateAndSendOTP</a></li><li><a href="global.html#cancelOTPValidation">cancelOTPValidation</a></li><li><a href="global.html#closePopup">closePopup</a></li><li><a href="global.html#completeAuthentication">completeAuthentication</a></li><li><a href="global.html#configFileName">configFileName</a></li><li><a href="global.html#deleteFromPath">deleteFromPath</a></li><li><a href="global.html#deregister">deregister</a></li><li><a href="global.html#emailAddresses">emailAddresses</a></li><li><a href="global.html#familyName">familyName</a></li><li><a href="global.html#formattedName">formattedName</a></li><li><a href="global.html#gatewayIsReachable">gatewayIsReachable</a></li><li><a href="global.html#generateAndSendOTP">generateAndSendOTP</a></li><li><a href="global.html#getCurrentDevice">getCurrentDevice</a></li><li><a href="global.html#getCurrentProviders">getCurrentProviders</a></li><li><a href="global.html#getDeviceIdentifier">getDeviceIdentifier</a></li><li><a href="global.html#getFromPath">getFromPath</a></li><li><a href="global.html#givenName">givenName</a></li><li><a href="global.html#grantFlow">grantFlow</a></li><li><a href="global.html#groupName">groupName</a></li><li><a href="global.html#groups">groups</a></li><li><a href="global.html#initEnterpriseBrowser">initEnterpriseBrowser</a></li><li><a href="global.html#initialize">initialize</a></li><li><a href="global.html#initWithInfo">initWithInfo</a></li><li><a href="global.html#isApplicationAuthenticated">isApplicationAuthenticated</a></li><li><a href="global.html#isAuthenticated">isAuthenticated</a></li><li><a href="global.html#isCurrentUser">isCurrentUser</a></li><li><a href="global.html#isDeviceRegistered">isDeviceRegistered</a></li><li><a href="global.html#isSessionLocked">isSessionLocked</a></li><li><a href="global.html#launchApp">launchApp</a></li><li><a href="global.html#lockSession">lockSession</a></li><li><a href="global.html#logout">logout</a></li><li><a href="global.html#members">members</a></li><li><a href="global.html#newGroup">newGroup</a></li><li><a href="global.html#owner">owner</a></li><li><a href="global.html#phoneNumbers">phoneNumbers</a></li><li><a href="global.html#photos">photos</a></li><li><a href="global.html#postToPath">postToPath</a></li><li><a href="global.html#putToPath">putToPath</a></li><li><a href="global.html#removeSessionLock">removeSessionLock</a></li><li><a href="global.html#resetLocally">resetLocally</a></li><li><a href="global.html#retrieveAuthenticationProviderForProximityLogin">retrieveAuthenticationProviderForProximityLogin</a></li><li><a href="global.html#retrieveEnterpriseApps">retrieveEnterpriseApps</a></li><li><a href="global.html#setCustomLoginPage">setCustomLoginPage</a></li><li><a href="global.html#setCustomOTPChannelsPage">setCustomOTPChannelsPage</a></li><li><a href="global.html#setCustomOTPPage">setCustomOTPPage</a></li><li><a href="global.html#start">start</a></li><li><a href="global.html#startWithDefaultConfiguration">startWithDefaultConfiguration</a></li><li><a href="global.html#startWithJSON">startWithJSON</a></li><li><a href="global.html#stop">stop</a></li><li><a href="global.html#unlockSession">unlockSession</a></li><li><a href="global.html#unlockSessionWithMessage">unlockSessionWithMessage</a></li><li><a href="global.html#useNativeMASUI">useNativeMASUI</a></li><li><a href="global.html#userName">userName</a></li><li><a href="global.html#validateOTP">validateOTP</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.0-dev</a> on Mon Mar 06 2017 16:30:10 GMT+0530 (IST) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>