File tree Expand file tree Collapse file tree 6 files changed +793
-627
lines changed
packages/nativescript-in-app-review Expand file tree Collapse file tree 6 files changed +793
-627
lines changed Original file line number Diff line number Diff line change 33 "version" : " 0.0.0" ,
44 "license" : " MIT" ,
55 "scripts" : {
6- "postinstall" : " husky install && npx ts-patch install" ,
7- "setup" : " npx rimraf node_modules package-lock.json dist tmp yarn.lock && yarn config set ignore-engines true && ns package-manager set npm && yarn " ,
6+ "postinstall" : " husky && npx ts-patch install" ,
7+ "setup" : " npx rimraf node_modules package-lock.json dist tmp yarn.lock && yarn" ,
88 "start" : " nps" ,
99 "add" : " nx g @nativescript/plugin-tools:add-package" ,
1010 "add-angular" : " nx g @nativescript/plugin-tools:add-angular" ,
7373 ]
7474 },
7575 "dependencies" : {
76- "@ngrx/operators" : " ^18 .0.0"
76+ "@ngrx/operators" : " ^19 .0.0"
7777 }
7878}
Original file line number Diff line number Diff line change 1- import { Application , Utils } from '@nativescript/core' ;
1+ import { Utils } from '@nativescript/core' ;
22import { InAppReviewCommon } from './common' ;
33
44export class InAppReview extends InAppReviewCommon {
@@ -31,11 +31,11 @@ export class InAppReview extends InAppReviewCommon {
3131 resolve ( ) ;
3232 }
3333 } ,
34- } )
34+ } ) ,
3535 ) ;
3636 } ,
37- } )
38- )
37+ } ) ,
38+ ) ,
3939 ) ;
4040 }
4141}
Original file line number Diff line number Diff line change 1- import { Application , Device } from '@nativescript/core' ;
1+ import { Application , Utils } from '@nativescript/core' ;
22import { InAppReviewCommon } from './common' ;
33
4+ let nscAppStore : NSCAppStore ;
5+
46export class InAppReview extends InAppReviewCommon {
57 static requestReviewPopup ( ) {
6- if ( + Device . sdkVersion < 14.0 ) {
8+ if ( Utils . SDK_VERSION >= 17 || __VISIONOS__ ) {
9+ if ( ! nscAppStore ) {
10+ nscAppStore = NSCAppStore . new ( ) ;
11+ }
12+ nscAppStore . requestReview ( ) ;
13+ } else if ( Utils . SDK_VERSION < 14 ) {
714 SKStoreReviewController . requestReview ( ) ;
815 } else {
916 SKStoreReviewController . requestReviewInScene ( ( Application . ios . window as UIWindow ) . windowScene ) ;
Original file line number Diff line number Diff line change 1+ import StoreKit
2+
3+ @objc public class NSCAppStore : NSObject {
4+ @MainActor
5+ @objc public func requestReview( ) {
6+ if #available( iOS 16 . 0 , * ) {
7+ let windowScene = UIApplication . shared. windows. first? . windowScene
8+ if ( windowScene == nil ) {
9+ guard let scene = UIApplication . shared. connectedScenes. first,
10+ let windowSceneDelegate = scene. delegate as? UIWindowSceneDelegate ,
11+ let window = windowSceneDelegate. window else {
12+ return
13+ }
14+ AppStore . requestReview ( in: window!. windowScene!)
15+ return
16+ }
17+
18+ AppStore . requestReview ( in: windowScene!)
19+ }
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ declare class NSCAppStore extends NSObject {
2+
3+ static alloc ( ) : NSCAppStore ; // inherited from NSObject
4+
5+ static new ( ) : NSCAppStore ; // inherited from NSObject
6+
7+ requestReview ( ) : void ;
8+ }
You can’t perform that action at this time.
0 commit comments