Skip to content

zpasternack/RatingCounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FARatingCounter

A simple class to get the count of ratings for an iOS app. This is useful if you want to display how many ratings your app has, typically near the UI where one could tap to rate your app.

Usage

FARatingCounter has a single instance method, fetchNumberOfRatings

func fetchNumberOfRatings(appID: String, completion: @escaping fetchRatingsCompletion)

A default instance is provided via the default class property (or, in Objective-C, defaultCounter).

You'd use it like so:

FARatingCounter.default.fetchNumberOfRatings(appID: "391439366") {
    (success, number) in
    // Do something with number.
}

How's it work?

The App Store has a feed which provides, given an app ID, a bunch of information about that app. It vends JSON. FARatingCounter downloads this data (using NSURLSession), and parses it (via NSJSONSerialization) to get the app review count.

FARatingCounter is written in Swift 5. It can also be called from Objective-C.

Who's responsible for this?

I'm Zacharias Pasternack, lead developer for Fat Apps, LLC. You can check out my blog, or follow me on Twitter.

License

The code is provided under a Modified BSD License. See the LICENSE file for more info.

About

A simple Swift class to get App Store ratings count

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages