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

in-app-updates-capacitor

v0.1.2

Published

Enables In App Updates on Android using the official APIs.

Readme

in-app-updates-capacitor

Enables In App Updates on Android using the official Android APIs.

This plugin integrates the official Android APIs to perform in app updates that were released in 2019: https://developer.android.com/guide/app-bundle/in-app-updates

Installation

npm i in-app-updates-capacitor
npx cap sync

Android

Register the plugin in your main activity:

import com.dwlrathod.inappupdates.InAppUpdatesPlugin;

public class MainActivity extends BridgeActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initializes the Bridge
    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
      // Additional plugins you've installed go here
      // Ex: add(TotallyAwesomePlugin.class);
      add(InAppUpdatesPlugin.class);
    }});
  }
}

iOS

iOS does not offer such functionality. If you call the methods above on an iOS device you'll run into a not-implemented exception.

Browser

If you call the methods above on a Browser you'll run into a not-implemented exception.

Usage

checkForUpdate()

Requests the update availability for the current app. This method need to call before calling startFlexibleUpdate or performImmediateUpdate.

import { Plugins } from "@capacitor/core";
const { InAppUpdatesPlugin } = Plugins;
import { AppUpdateInfo } from "in-app-updates";

InAppUpdatesPlugin.checkForUpdate().then(
    (updateInfo: AppUpdateInfo) => {
      console.log(updateInfo);
    },
    (error: any) => {
      console.error("error: " + error);
    }
  );

AppUpdateInfo interface:

  • updateAvailable: boolean;: Returns whether an update is available for the app.
  • immediateUpdateAllowed: boolean;: Returns whether the immediate is allowed.
  • flexibleUpdateAllowed: boolean; : Returns whether the flexible is allowed.
  • availableUpdateVersionCode: number; : If an update is available or in progress, this method returns the version code of the update.
  • availableUpdatePriority: number; : Returns the in -app update priority for this update, as defined by the developer in the Google Play Developer API.

startFlexibleUpdate()

Shows flexible update dialog. User will choose weather update or not.

InAppUpdatesPlugin.startFlexibleUpdate().then(
      () => {
        // Update downloaded complete and now you can start installing it. 
        // completeFlexibleUpdate()
      },
      (error: any) => {
        // User select No Thanks from update dialog.
        // error : user_canceled, no_update_found
      }
    );

flexibleUpdateStateChange listener will listen the status of downloading/downloaded update. You need to add the listener before calling startFlexibleUpdate.

import { FlexibleUpdateState } from "in-app-updates";

InAppUpdatesPlugin.addListener("flexibleUpdateStateChange", (info: FlexibleUpdateState) => {
      console.log("flexibleUpdateStateChange was fired  ", info.status);
      if (info.status) {
        this.appendEcho("status: " + info.status);
        this.appendEcho("bytesDownloaded: " + info.bytesDownloaded);
        this.appendEcho("totalBytesToDownload: " + info.totalBytesToDownload);
      }
    });

completeFlexibleUpdate()

For a flexible update flow, triggers the completion of the update. This method will only work with Flexible update and after update downloaded successfully.

InAppUpdatesPlugin.completeFlexibleUpdate().then(
      () => {
        // New update installation started succefully. 
      },
      (error: any) => {
        // error 
      }
    );

performImmediateUpdate()

Performs an immediate update.

InAppUpdatesPlugin.performImmediateUpdate().then(
      () => {
        // Immediate update started
      },
      (error: any) => {
        // error : user_canceled, no_update_found
      }
    );