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

nativescript-store-update

v1.0.2

Published

Keep your {N} App updated.

Downloads

1,573

Readme

Nativescript-store-update

npm npm

NPM

This plugin allows you to define a notification strategy regarding your app updates. You are able to specify if you want to force, offer or ignore an update based on the new version available in the platform store.

For example, you could want to force all major version update, but offer the option to your user to chose to update or skip a minor or patch version.

You can also specify how many days after the update release you want to display the alert.

Prerequisites

You need to add appversion plugins for this one to work:

tns plugin add nativescript-appversion

Installation

tns plugin add nativescript-store-update

Usage

In your main.ts or app.ts file, before app start, call StoreUpdate.init with desired options like so:

    import { StoreUpdate, AlertTypesConstants } from "nativescript-store-update";

    StoreUpdate.init({
        notifyNbDaysAfterRelease: 1,
        majorUpdateAlertType: AlertTypesConstants.OPTION
    })

Localization

The plugin contains some default translations inside json files located in src/i18n folder and required by hand in the src/helpers/locales.helper.ts file. You can also specify a custom translation in the plugin initialization through the configuraiton options. If you want to contribute a regionalized translation, you must use the lang-regionCode format specified in Apple doc, but with the country lowercased (ex: fr-ca, en-us)

API

Configuration options

| Property | Default | Description | | --- | --- | --- | | majorUpdateAlertType | FORCE | Alert type for major version change (e.g: A.b.c.d) | | minorUpdateAlertType | OPTION | Alert type for minor version change (e.g: a.B.c.d) | | patchUpdateAlertType | NONE | Alert type for major version change (e.g: a.b.C.d) | | revisionUpdateAlertType | NONE | Alert type for revision version change (e.g: a.b.c.D) | | notifyNbDaysAfterRelease | 1 | Delays the update prompt by a specific number of days | | countryCode | en | country store code | | alertOptions | null | Customize alert dialog text, bypasses the Locale json |

Alert types

| Key | Value | Description | | --- | --- | --- | | FORCE | 1 | Show an alert that can't be skipped | | OPTION | 2 | Show an alert that can be skipped | | NONE | 3 | Don't display alert at all |

AlertOptions configuration (Optional)

| Property | Default | Description | | --- | --- | --- | | title | LocaleText | Dialog title, fallback to the locale json | | message | LocaleText | Dialog body text, fallback to the locale json | | updateButton | LocaleText | Dialog update button, fallback to the locale json | | skipButton | LocaleText | Dialog skip button, fallback to the locale json |

Development

Clone this repository, go in the src folder then run the command npm run setup You can then use:

  • npm run demo.ios or npm run demo.android to start the demo
  • npm run plugin.tscwatch to watch plugin file and start developing!

The repo contains 2 demos folder, one with angular, and one without. Demos use the bundleId com.bitstrips.imoji as their App version contains Major, Minor and Patch numbers, and they update their app really often. You can change parameters passed ton package init in main.ts or app.ts files and change app version in android app.gradle and ios info.plist config files to test the feature.

License

Apache License Version 2.0, January 2004

Contributors