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 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-consent-modern-plus

v0.1.2

Published

Standalone Cordova consent plugin for modern iOS and Android builds.

Readme

cordova-consent-modern-plus

Cordova consent plugin for current iOS and Android toolchains using Google's User Messaging Platform SDK.

Install

cordova plugin add cordova-consent-modern-plus

You can also persist it in config.xml:

<plugin name="cordova-consent-modern-plus" spec="0.1.2" />

Required app config

This plugin uses Kotlin on Android and App Tracking Transparency on iOS.

<platform name="android">
    <preference name="GradlePluginKotlinEnabled" value="true" />
    <preference name="GradlePluginKotlinVersion" value="2.1.0" />
</platform>

<platform name="ios">
    <edit-config file="*-Info.plist" mode="merge" target="NSUserTrackingUsageDescription">
        <string>This identifier will be used to manage consent and advertising preferences.</string>
    </edit-config>
</platform>

Global

The plugin exposes a global consent object after deviceready.

Basic example

document.addEventListener("deviceready", async () => {
  try {
    await consent.requestInfoUpdate();
    await consent.loadAndShowIfRequired();

    const canRequestAds = await consent.canRequestAds();
    console.log("canRequestAds:", canRequestAds);

    if (canRequestAds) {
      // Safe point to start your ad SDK.
    }
  } catch (err) {
    console.error("Consent flow failed", err);
  }
});

Full consent flow

document.addEventListener("deviceready", async () => {
  try {
    await consent.requestInfoUpdate({
      debugGeography: consent.DebugGeography.EEA,
      tagForUnderAgeOfConsent: false,
      testDeviceIds: []
    });

    console.log("form status:", await consent.getFormStatus());
    console.log("consent status:", await consent.getConsentStatus());

    await consent.loadAndShowIfRequired();

    console.log("privacy requirement:", await consent.privacyOptionsRequirementStatus());
    console.log("can request ads:", await consent.canRequestAds());
  } catch (err) {
    console.error(err);
  }
});

Show privacy options again

async function openPrivacyOptions() {
  try {
    await consent.showPrivacyOptionsForm();
  } catch (err) {
    console.error("Privacy options failed", err);
  }
}

Manual form loading

async function loadAndShowForm() {
  try {
    const form = await consent.loadForm();
    await form.show();
  } catch (err) {
    console.error("Manual form flow failed", err);
  }
}

iOS tracking authorization

These methods return false on non-iOS platforms.

async function requestTracking() {
  const current = await consent.trackingAuthorizationStatus();
  console.log("tracking status:", current);

  const updated = await consent.requestTrackingAuthorization();
  console.log("tracking result:", updated);
}

With cordova-ad-modern-plus

document.addEventListener("deviceready", async () => {
  try {
    await consent.requestInfoUpdate();
    await consent.loadAndShowIfRequired();

    if (await consent.canRequestAds()) {
      const info = await admob.start();
      console.log("AdMob started:", info.version);
    }
  } catch (err) {
    console.error(err);
  }
});

Events

The plugin emits:

document.addEventListener("consent.ready", () => {
  console.log("Consent plugin ready");
});

API

await consent.requestInfoUpdate(options);
await consent.loadAndShowIfRequired();
await consent.showPrivacyOptionsForm();
await consent.canRequestAds();
await consent.getConsentStatus();
await consent.getFormStatus();
await consent.privacyOptionsRequirementStatus();
await consent.trackingAuthorizationStatus();
await consent.requestTrackingAuthorization();
await consent.reset();

const form = await consent.loadForm();
await form.show();

Build

npm install
npm run build

License

MIT.