Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.0",
"license": "MIT",
"scripts": {
"postinstall": "husky install && npx ts-patch install",
"setup": "npx rimraf node_modules package-lock.json dist tmp yarn.lock && yarn config set ignore-engines true && ns package-manager set npm && yarn",
"postinstall": "husky && npx ts-patch install",
"setup": "npx rimraf node_modules package-lock.json dist tmp yarn.lock && yarn",
"start": "nps",
"add": "nx g @nativescript/plugin-tools:add-package",
"add-angular": "nx g @nativescript/plugin-tools:add-angular",
Expand Down Expand Up @@ -73,6 +73,6 @@
]
},
"dependencies": {
"@ngrx/operators": "^18.0.0"
"@ngrx/operators": "^19.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/nativescript-in-app-review/index.android.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Utils } from '@nativescript/core';
import { Utils } from '@nativescript/core';
import { InAppReviewCommon } from './common';

export class InAppReview extends InAppReviewCommon {
Expand Down Expand Up @@ -31,11 +31,11 @@ export class InAppReview extends InAppReviewCommon {
resolve();
}
},
})
}),
);
},
})
)
}),
),
);
}
}
11 changes: 9 additions & 2 deletions packages/nativescript-in-app-review/index.ios.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Application, Device } from '@nativescript/core';
import { Application, Utils } from '@nativescript/core';
import { InAppReviewCommon } from './common';

let nscAppStore: NSCAppStore;

export class InAppReview extends InAppReviewCommon {
static requestReviewPopup() {
if (+Device.sdkVersion < 14.0) {
if (Utils.SDK_VERSION >= 17 || __VISIONOS__) {
if (!nscAppStore) {
nscAppStore = NSCAppStore.new();
}
nscAppStore.requestReview();
} else if (Utils.SDK_VERSION < 14) {
SKStoreReviewController.requestReview();
} else {
SKStoreReviewController.requestReviewInScene((Application.ios.window as UIWindow).windowScene);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import StoreKit

@objc public class NSCAppStore: NSObject {
@MainActor
@objc public func requestReview() {
if #available(iOS 16.0, *) {
let windowScene = UIApplication.shared.windows.first?.windowScene
if (windowScene == nil) {
guard let scene = UIApplication.shared.connectedScenes.first,
let windowSceneDelegate = scene.delegate as? UIWindowSceneDelegate,
let window = windowSceneDelegate.window else {
return
}
AppStore.requestReview(in: window!.windowScene!)
return
}

AppStore.requestReview(in: windowScene!)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare class NSCAppStore extends NSObject {

static alloc(): NSCAppStore; // inherited from NSObject

static new(): NSCAppStore; // inherited from NSObject

requestReview(): void;
}
Loading