npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-screen-pinner

v1.0.9

Published

Package for accessing the Screen Pinning API on android.

Downloads

4

Readme

WORK IN PROGRESS

Please note this repo is still in development and is not suggested for use yet. Please check back here for an updated version.

Screen Pinner

Screen Pinner allows you to utilise the Screen Pinning API for Android in Cordova projects.

Getting Started

Run the following command inside your Cordova Ionic project

ionic cordova plugin add cordova-plugin-screen-pinner

or if you're not using Ionic, then please run;

cordova plugin add cordova-plugin-screen-pinner

Integrating into Ionic Cordova Project;

To add into your Ionic cordova application, first install the plugin as advised above.

Once done, you will want to define the cordova variable within your respective page;

declare var cordova: any;

An example of this can be seen below;

import { Component } from '@angular/core';
import { AlertController } from '../../../node_modules/@ionic/angular';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { InAppBrowser, InAppBrowserObject } from '@ionic-native/in-app-browser/ngx';

declare var cordova:any;

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})

export class HomePage {

  public CustomerCode: string = "";
  public ButtonText: string = "Validate";
  public browser: InAppBrowserObject;

Methods

The following methods are available to call;

Start Screen Pinning

To start screen pinning, simply call the following;

cordova.plugins.screenPinner.start(() => { 
    alert('Screen pinning started'); 
}, (error) => { 
    alert('There was an error'); 
    console.log(error);
});

You will want to set the first function parameter to be the success call, which will be called in the event of the screen pinning being activated.

The second function parameter has an error message returned to it and allows you to see if there are any errors with calling the screen pinning API.

Stop Screen Pinning

To stop screen pinning, simply call the following;

cordova.plugins.screenPinner.stop(() => { 
    alert('Screen pinning stopped'); 
}, (error) => { 
    alert('There was an error'); 
    console.log(error);
});

You will want to set the first function parameter to be the success call, which will be called in the event of the screen pinning being stopped.

The second function parameter has an error message returned to it and allows you to see if there are any errors with calling the screen pinning API.

Is Screen Pinning Active

To see if screen pinning is currently active, you can call the following;

cordova.plugins.screenPinner.isPinned(() => { 
    alert('Screen pinning active'); 
}, () => { 
    alert('Screen pinning not active'); 
}, (error) => { 
    alert('There was an error'); 
    console.log(error);
});

You will want to set the first function parameter to be the success call, which will tell you that the screen pinning is currently active.

The second function paramter is if the screen pinning is not currently active.

The third function parameter has an error message returned to it and allows you to see if there are any errors with calling the screen pinning API.