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

@gurukumparan/react-native-android-inapp-updates

v2.0.2

Published

TODO

Downloads

1,874

Readme

react-native-android-inapp-updates

npm PRs Welcome

React Native implementation of the Android In-App Update API. For more information on InApp Updates you can check the official documentation.

Build with ReasonML.

You will need to test the app via Internal App Sharing

Use internal app sharing to test in-app updates by performing the following steps:

  1. Make sure your test device has a version of your app installed that supports in-app updates and was installed using an internal app sharing URL.
  2. Follow the Play Console instructions to share your app internally. Upload a version of your app that uses a version code that is higher than the one you already have installed on the test device.
  3. On the test device, click the internal app sharing link for the updated version of your app but do not install the app from the Play Store page that appears after you click the link.
  4. Open the app from the device's app drawer or home screen. The update should now be available to your app, and you can test your implementation of in-app updates.

Project Milestone

  • [x] startUpdateFlow Basic implementation.
  • [x] Implement event emitter for flexible in-app updates download progress and downloaded status.
  • [x] Implement clientVersionStalenessDays check for startUpdateFlow.

Requirements

  • In-app updates works only with devices running Android 5.0 (API level 21) or higher.
  • In-app updates can only work when signed with the same signing key as your app on the play store.

Getting started

$ npm install @gurukumparan/react-native-android-inapp-updates --save

or

$ yarn add @gurukumparan/react-native-android-inapp-updates

For [email protected] or above

As [email protected] or above supports autolinking, so there is no need to run linking process. Read more about autolinking here.

Mostly automatic installation

$ react-native link @gurukumparan/react-native-android-inapp-updates

Usage

import {startUpdateFlow, UpdateFlow} from '@gurukumparan/react-native-android-inapp-updates';

try {
    const result = await startUpdateFlow(UpdateFlow.FLEXIBLE);
} catch (e) {
    console.log('error:', e);
}

Reference

Methods

startUpdateFlow()

promise string startUpdateFlow(appUpdateType,clientVersionStalenessDays)
Input

| Input | Description | Type | Default Value | ------------- | ------------- | ------------- | ------------- | | appUpdateType | Android In-app updates type | enum(flexible or immediate) | immediate | | clientVersionStalenessDays | If an update is available In-app modal will only triger after x number of days since the Google Play Store app on the user's device has learnt about an available update. | int | 0 |

Promise Resolve

| Value | Description
| ------------- | -------------
| Canceled | In-app modal canceled by user | Successful | User press the update button

Promise Reject

| Value | Description
| ------------- | -------------
| checkAppUpdate failure: | appUpdateInfoTask failed getting result. This can mean numerous reason check the log for more explanation. | No update available | There is no update available with the appUpdateType type.
| startUpdateFlow failure: | Failed starting the Google Play In-app updates modal.

checkUpdateAvailability()

promise string checkUpdateAvailability()
Promise Resolve

| Value | Description
| ------------- | -------------
| Update available | Application update is available

Promise Reject

| Value | Description
| ------------- | -------------
| checkAppUpdate failure: | appUpdateInfoTask failed getting result. This can mean numerous reason check the log for more explanation. | No update available | There is no update available

onCompleteUpdate()

promise string onCompleteUpdate()
Promise Resolve

| Value | Description
| ------------- | -------------
| success | Application update succeed

Promise Reject

| Value | Description
| ------------- | -------------
| Download is not completed | Application update process fail

❤️ From Indonesia