16.8 C
Canberra
Monday, February 24, 2025

Asking consumer to price or evaluate app in iOS – Swift Tutorial – iOSTutorialJunction


On this put up, we’ll discover tips on how to use the iOS SDK StoreKit framework to request app retailer scores. By leveraging SKStoreReviewController, we are able to immediate customers with a pop-up to price our iOS app with out requiring them to depart the app. Beforehand, we wanted to open the App Retailer and ask customers to price the app there. Let’s dive into tips on how to use the StoreKit framework to request app retailer scores seamlessly.

Issues to bear in mind whereas including app score pop up utilizing SKStoreReviewController

  1. The app score alert will be displayed as much as thrice inside a 365-day interval.
  2. Keep away from triggering the app score alert by way of a button click on, as it might not at all times present the alert.
  3. The app icon is managed by SKStoreReviewController and is retrieved out of your app particulars on the iOS App Retailer.
  4. SKStoreReviewController is obtainable ranging from iOS 10.3 and later variations.

Steps to point out app score alert in iOS utilizing SKStoreReviewController

Step 1: Import StoreKit framework

Step 2: Open your swift class, the place you need to implement this app score alert. Create a operate to request evaluate pop up usingSKStoreReviewController class. Under is the code for asking app score pop up.

import UIKit
import StoreKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        tremendous.viewDidLoad()
        // Do any further setup after loading the view.
       	self.requestAppReview()
    }
    
    func requestAppReview() {
        if #accessible(iOS 14.0, *) {
            if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
                SKStoreReviewController.requestReview(in: scene)
            }
        } else {
            SKStoreReviewController.requestReview()
        }
    }
}

Since requestReview is deprecated in IOS 14.0 and onward. So we’ll use, requestReview(in: scene) operate launched after iOS 14.0 and onward. That’s it and we’ve got applied app score pop up in our iOS app. You will notice a pop up in your app like this (please ignore the app icon because it’s taken from app that’s already on iOS app retailer).

Asking consumer to price or evaluate app in iOS – Swift Tutorial – iOSTutorialJunction



Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles