How to Implement a "Rate Us" Feature in a Phonegap App

How to implement a rate us feature in a phonegap app

I use navigator.notification.confirm and have it called when the user reaches a certain point or uses your app so much. Of course you need to add your own links in.

Note this snippet references other parts of my app so customize to meet your needs.

if (settings.core.rate_app_counter === 10) {
navigator.notification.confirm(
'If you enjoy using domainsicle, whould you mind taking a moment to rate it? It won\'t take more than a minute. Thanks for your support!',
function(button) {
// yes = 1, no = 2, later = 3
if (button == '1') { // Rate Now
if (device_ios) {
window.open('itms-apps://itunes.apple.com/us/app/domainsicle-domain-name-search/id511364723?ls=1&mt=8'); // or itms://
} else if (device_android) {
window.open('market://details?id=<package_name>');
} else if (device_bb){
window.open('http://appworld.blackberry.com/webstore/content/<applicationid>');
}

this.core.rate_app = false;
} else if (button == '2') { // Later
this.core.rate_app_counter = 0;
} else if (button == '3') { // No
this.core.rate_app = false;
}
}, 'Rate domainsicle', ['Rate domainsicle', 'Remind me later', 'No Thanks']);
}

How to Add Write a Review / Rate Us Feature to My App?

StoreKit API (iOS 10.3 and up)

As of iOS 10.3, the StoreKit API provides a way to request a review on the App Store without leaving your app. When called, the system may present the user with an alert that requests a review. The user may provide a star rating directly inside the alert, continue on to write a review, or dismiss the alert. StoreKit handles just about everything for you. To present the review request, make the following call where it is appropriate in your app:

// Objective-C
[SKStoreReviewController requestReview]

// Swift
SKStoreReviewController.requestReview()

As per Apple's instructions, you should not call these in response to a direct user-interaction (i.e. tapping a button that says "Write a Review") because it may not always display the alert. Indeed, the alert may only be displayed three times every 365 days.

Important Note: Although this seems fairly simple, you'll still need to write some kind of logic in order to space out your prompts. For example, to present the prompt only after X number of launches, days, or significant events.

If you fail to do this and just stick the review prompt anywhere (a viewDidAppear call, for example), your users will be rather annoyed because they'll see it pretty quickly and repeatedly. Then, either they leave a bad review (because they're annoyed) or aren't asked to review again for a whole year.

Below is an example of what the alert looks like. For more information, see Apple's documentation.

StoreKit rating / review prompt.


iRate (iOS 7.0 and up)

If your app runs on versions of iOS earlier than 10.3 or you need more robust control over requesting ratings from users, iRate is a good solution.

For devices with iOS 10.3 or greater, iRate uses the aforementioned StoreKit API. For devices running iOS 7.0 to 10.2, iRate uses a uialertview and storekit to ask the user for a rating (or to remind them later). Everything is customizable, from the title of the Cancel button to the interval at which it reminds the user.

By default, iRate automatically opens when certain requirements are met (e.g. app launched X number of times, user passed X number of levels), but you can also use a variety of methods and your own logic (with the help of iRate methods) to manually display an iRate popup.

Setup

To install, just drag the header file, the implementation file, and the .bundle (for localization) into your project.

  1. Import the header in your AppDelegate: #import "iRate.h"
  2. Add the StoreKit Framework to your project - More on StoreKit from Apple Documentation
  3. In your application: didFinishLaunchingWithOptions: method, set the following:

    // Configure iRate
    [iRate sharedInstance].daysUntilPrompt = 5;
    [iRate sharedInstance].usesUntilPrompt = 15;

Properties

The property below is useful for testing purposes. Set it to YES during testing to make sure the dialog appears properly. When set to YES it will appear immediately on startup, disregarding other display settings. Set this to NO for release versions of your app.

 [iRate sharedInstance].previewMode = NO;

The appStoreID property allows you to set the ID of your app. This is only required if you have both Mac and iOS apps with the same Bundle Identifier. The App ID set here must also match the Bundle ID set in Xcode and iTunes Connect:

[iRate sharedInstance].appStoreID = 555555555;

More Details are available on the iRate GitHub page.

Review this App link in Phonegap/Cordova

One interim approach could be to put in http based URL's (e.g. http://yourdomain.com/ios, http://yourdomain.com/android) to pages that you own, and replace with a redirect to URL's of the respective apps once they have been approved.

Alert a user to rate an application from iTunes

Use the Appirater library for doing this: https://github.com/arashpayan/appirater

Or iRate: https://github.com/nicklockwood/iRate

Using Phonegap for Native Application development

I've built a couple of applications using PhoneGap, and for what it provides, it's great. There are a couple of quick notes I would like to point out, which might help you.

Disable device-based features you're not using
The accelerometer, geolocation features are by default turned on. If you're not using them, I would turn them off, as your app will load faster (initialize) and run smoother.

onDeviceReady - This is the method that's called once phonegap has loaded and is ready. $(document).ready or whatever you're used to, doesn't really apply here - unless you're only doing interface/hard-coded HTML stuff. If you're interacting with iPhone features, like GeoLocation, you will need to do everything after onDeviceReady has been called.

Pick a UI/library
There are a ton of options for the interface/libraries, jquery-mobile, sencha touch, jqtouch, etc.. These each offer a unique approach, and feature-set. Do some research and use one, but avoid combining. You can read about some more options, tools here: http://www.phonegap.com/tool (link updated)

Also, more on just mobile development in general, with PhoneGap If you're looking to build apps, that are distributed through the Android market and iPhone App Store, I would read through their exhaustive lists for guidelines on how to develop your app. For example, in the tools link above, there is a "tool/plugin" called Easy APNS - while this is useful for Android - and technically doable on the iPhone, it violates the development agreement, as it states you must use the Apple notification network, etc.. This is just an example, but reading up on that stuff will save you a lot of headaches, if that's your end goal.

All in all, it's great for lightweight apps, especially if you come from a web development background. LocalStorage, GeoLocation, etc.. works really well.

Additional Edit:

I really think it comes down to what you want to do, and what you know how to do. Matt pointed out that developing native apps, for iOS is better, etc.. Yeah, if you have the time and knowledge to learn that - of course native will be better. But PhoneGap is made for web developers that can take their existing skillset and build apps. Also, PhoneGap allows you to build apps quickly, for iOS, Android, Symbian, Palm, Blackberry. With minor adjustments to your codebase for each.

App store link for rate/review this app

For versions lower than iOS 7 use the old one:

itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YOUR_APP_ID

This works on my end (Xcode 5 - iOS 7 - Device!):

itms-apps://itunes.apple.com/app/idYOUR_APP_ID

For iOS 8 or later:

itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YOUR_APP_ID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software

Code snippet (you can just copy & paste it):

#define YOUR_APP_STORE_ID 545174222 //Change this one to your ID

static NSString *const iOS7AppStoreURLFormat = @"itms-apps://itunes.apple.com/app/id%d";
static NSString *const iOSAppStoreURLFormat = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d";

[NSURL URLWithString:[NSString stringWithFormat:([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f)? iOS7AppStoreURLFormat: iOSAppStoreURLFormat, YOUR_APP_STORE_ID]]; // Would contain the right link

Cannot open Rating page in App Store from my App in iOS 10

The URL to your app would not be available until your app is in the store.

For iOS 10.3 upwards, Apple Provides a way to present a native app rating popup in your app, that sends the ratings straight to the store. It is their recommended way of requesting ratings.

To make it show up, you need to call this, in Swift:

if #available(iOS 10.3, *) {
SKStoreReviewController.requestReview()
}

If you still want to use the URL, the following will redirect you to the app in itunes https://itunes.apple.com/en/app/idxxxxxxxxx where the xxxxxxxxx is the App Id from itunes connect

You might also want to check this answer: ITunes review URL and iOS 7 (ask user to rate our app) AppStore show a blank page



Related Topics



Leave a reply



Submit