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

@titanium/review-dialog

v1.0.37

Published

⭐ Axway Amplify module to use the Apple's Store Review Dialog with Appcelerator Titanium SDK Framework

Downloads

7

Readme

👉    A group of Axway employees, ex-Axway employees, and some developers from Titanium community have created a legal org and now officially decide all matters related to future of these products.

API FAQ:

 

Click to watch on Youtube

  ↑ Watch video on YouTube ↑

 

@titanium/review-dialog

@titanium/review-dialog

Native module that allows you to use the Apple's Store Review Dialog in Axway Titanium native mobile apps. Uses the SKStoreReviewController from iOS 10.3+ in your Titanium application.

📝 Description

This is a repackaging of the compiled iOS module for ti.reviewdialog to allow for installation via npm.

🚀 Getting Started

Install @titanium/review-dialog in root of project

npm install @titanium/review-dialog

Sample code

const win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});

const btn = Ti.UI.createButton({
    title: 'Open Review Dialog!'
});

btn.addEventListener('click', function() {
    const ReviewDialog = require('@titanium/review-dialog');
    ReviewDialog.requestReview();
});

win.add(btn);
win.open();

✨Features

  • [x] Includes Titanium native iOS module: ti.reviewdialog 2.0.0-Beta-1
const dialog = require('@titanium/review-dialog');

Requirements

  • [x] Titanium Mobile SDK 6.0.0.GA or later
  • [x] iOS 10.3 or later
  • [x] Xcode 8.3 or later

Usage

There are some important notes on when to show the rating dialog (thanks to @skypanther:

  • The internal API itself will decide when, or if, to show the prompt
  • You should not show it more than once for a given version of your app
  • You should not show the dialog in response to user actions (like after a user clicks a button)
  • You should not show it on first app launch (even after an update) but should wait until the user has used your app for a "meaningful" amount.

The following (ES6+ based) example shows how to use it in a real world example. It relies on the semver module / http://gitt.io/component/semver to compare app versions. Apple's own example uses a simple launch count to determine "meaningful" amount of use, which is also used in this example. You should use something appropriate for your app (amount of time, completion of an action N times, etc.):

import semver from 'semver';
import Review from 'ti.reviewdialog';

// first, check that the user has used your app for a "meaningful" amount
// here, a simple count of some action
let countOfSomeUserAction = Ti.App.Properties.getInt('countOfSomeUserAction', 0);
countOfSomeUserAction += 1;

Ti.App.Properties.setInt('countOfSomeUserAction', countOfSomeUserAction);

if (countOfSomeUserAction >= 4) {
  // if they've done whatever action 4 or more times, check the app version
  const lastVersionPromptedForReview = Ti.App.Properties.getString('lastVersionPromptedForReview', '1.0.0');
  let appVersion = Ti.App.version;
  const appVersionAsArray = appVersion.split('.');
  if (appVersionAsArray.length > 3) {
    // the semver library supports max 3-part version numbers (per semver rules)
    appVersion = appVersionAsArray[0] + '.' + appVersionAsArray[1] + '.' + appVersionAsArray[2];
  }
  if (semver.gt(appVersion, lastVersionPromptedForReview)) {
    // if the current app version is greater-than the last time you prompted them
    // prompt them with the titanium-review-dialog alert
    Ti.App.Properties.setString('lastVersionPromptedForReview', appVersion);
      if (Review.isSupported()) {
          Review.requestReview();
      }
  }
}

Hyperloop

This module is also built in Hyperloop to demonstrate the native API access with JavaScript. You can simple require the ti.reviewdialog.js in your application and run it!

Example

Request a new review dialog:

const review = require('@titanium/review-dialog');

if (review.isSupported()) {
    review.requestReview();
}

Methods

  • [x] isSupported
  • [x] requestReview

Author

Hans Knoechel (@hansemannnn / Web)

Contributing

Code contributions are greatly appreciated, please submit a new pull request!

📚Learn More

📣 Feedback

Have an idea or a comment? Join in the conversation here!

©️ Legal

License

Apache 2.0