Skip to content

fedme/cordova-plugin-screen-pinning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova screen pinning plugin

Cordova plugin that exposes screen pinning APIs on Android (API 21+).

Installation

Run the following command inside your project's folder:

cordova plugin add cordova-plugin-screen-pinning

If you are using Ionic run the following command instead:

ionic cordova plugin add cordova-plugin-screen-pinning

Usage

enterPinnedMode()

Function that makes the app enter pinned mode. It accepts the following parameters:

  • successCallback: [Function optional] - Success callback function.
  • errorCallback: [Function optional] - Error callback function, takes the message string as the only parameter.
cordova.plugins.screenPinning.enterPinnedMode(successCallback, errorCallback);

Example

// Enter pinned mode
cordova.plugins.screenPinning.enterPinnedMode(
    function () {
        console.log("Pinned mode activated!");
    },
    function (errorMessage) {
        console.log("Error activating pinned mode:", errorMessage);
    }
);

exitPinnedMode()

Function that makes the app exit pinned mode. It accepts the following parameters:

  • successCallback: [Function optional] - Success callback function.
  • errorCallback: [Function optional] - Error callback function, takes the message string as the only parameter.
cordova.plugins.screenPinning.exitPinnedMode(successCallback, errorCallback);

Example

// Exit pinned mode
cordova.plugins.screenPinning.exitPinnedMode(
    function () {
        console.log("Pinned mode de-activated!");
    },
    function (errorMessage) {
        console.log("Error exiting pinned mode:", errorMessage);
    }
);

About

Cordova plugin exposing Android's screen pinning APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published