add app_review

This commit is contained in:
2026-01-14 21:48:38 -08:00
parent 9840f9082b
commit dad9b1207e
170 changed files with 61232 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
.idea/
.vagrant/
.sconsign.dblite
.svn/
.DS_Store
*.swp
profile
DerivedData/
build/
GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m
.generated/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.moved-aside
*.pyc
*sync/
Icon?
.tags*
/Flutter/Generated.xcconfig
@@ -0,0 +1,4 @@
#import <Flutter/Flutter.h>
@interface AppReviewPlugin : NSObject<FlutterPlugin>
@end
@@ -0,0 +1,8 @@
#import "AppReviewPlugin.h"
#import <app_review/app_review-Swift.h>
@implementation AppReviewPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
[SwiftAppReviewPlugin registerWithRegistrar:registrar];
}
@end
@@ -0,0 +1,39 @@
import Flutter
import UIKit
import StoreKit
public class SwiftAppReviewPlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "app_review", binaryMessenger: registrar.messenger())
let instance = SwiftAppReviewPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
var appID = "com.apple.appstore" //Your App ID on App Store
if let bundleIdentifier = Bundle.main.bundleIdentifier {
appID = bundleIdentifier
}
switch (call.method) {
case "requestReview":
//App Store Review
if #available(iOS 10.3, *) {
SKStoreReviewController.requestReview() // Requesting alert view for getting rating from the user.
result("Later than iOS 10.3 the App will Request the App Review, Users can turn this off in settings for all apps, Apple will manage when to request the review from the user. In Debug it will always show. Requesting review for: " + appID)
} else {
// Fallback on earlier versions
result("Prior to iOS 10.3 App Review from App is not available. You should go to Store Page of App: " + appID + ". If the app is not published the app will not be found.")
}
case "isRequestReviewAvailable":
if #available(iOS 10.3, *) {
result("1")
} else {
result("0")
}
default:
result(FlutterMethodNotImplemented)
}
}
}
@@ -0,0 +1,22 @@
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'app_review'
s.version = '1.0.1'
s.summary = 'Request and Write Reviews and Open Store Listing for Android&#x2F;iOS in Flutter.'
s.description = <<-DESC
Request and Write Reviews and Open Store Listing for Android&#x2F;iOS in Flutter.
DESC
s.homepage = 'http://rodydavis.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.swift_version = "5"
s.ios.deployment_target = '11.0'
end