Appcelerator Blog

The Leading Resource for All Things Mobile

Using the iOS 10.3 Request Review Dialog

0 Flares 0 Flares ×

We’ve all used those apps that constantly popup an interface to ask you to review the app with “Not now” or “Remind me later” (or never) options. They’ll usually popup randomly and can all look slightly different. This week, Apple released iOS 10.3, which includes a new, official API for requesting ratings and reviews: SKStoreReviewController. Thanks to our own Hans Knöchel, you can use it now, both as a classic native module AND in Hyperloop!

For the Native Module

Download the stable release as a zip and drop it into the root of your project.

Next, update your tiapp.xml file to include:

<modules>
  <module platform="iphone">ti.reviewdialog</module>
</modules>

Finally, add the following code to your Alloy.js or Index.js file:

var ReviewDialog = require('ti.reviewdialog');
ReviewDialog.requestReview();

For a Hyperloop-Enabled Project

Use the following JavaScript code:

var SKStoreReviewController = require('StoreKit/SKStoreReviewController');
var UIDevice = require('UIKit/UIDevice');
var NSNumericSearch = require('Foundation').NSNumericSearch;
var NSOrderedAscending = require('Foundation').NSOrderedAscending;

function isRequestReviewSupported() {
    return UIDevice.currentDevice.systemVersion.compareOptions('10.3', NSNumericSearch) != NSOrderedAscending;
};

function requestReview() {
    SKStoreReviewController.requestReview();
};

if (isRequestReviewSupported() && !Ti.App.Properties.getBool('reviewDialogRequested', false)) {
   Ti.App.Properties.setBool('reviewDialogRequested', true);
   Review.requestReview();
}

We’ve made it super easy for you to add this in by creating a commonJS Hyperloop module over in our Hyperloop Examples repository. So, be sure to check that out, the demo code AND some other great examples of using Hyperloop in Titanium.

example-screen Code Strong!
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Donovan

    Great module. Loving TI. Keep up the good work!

    • Jason Kneen

      thank you!

Sign up for updates!

Become a mobile leader. Take the first step to scale mobile innovation throughout your enterprise.
Get in touch
computer and tablet showing Appcelerator software
Start free, grow from there.
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×