Skip to content

Commit 2fda8e8

Browse files
feat: add @valor/nativescript-in-app-review (#9)
* feat: add in-app review popup * update com.google.android.play:core * fix typo * return promise Co-authored-by: Eduardo Speroni <[email protected]>
1 parent 699f95e commit 2fda8e8

28 files changed

+9309
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- [@valor/nativescript-barcodescanner](packages/nativescript-barcodescanner/README.md)
22
- [@valor/nativescript-feedback](packages/nativescript-feedback/README.md)
3+
- [@valor/nativescript-in-app-review](packages/nativescript-in-app-review/README.md)
34
- [@valor/nativescript-ngrx-devtools](packages/nativescript-ngrx-devtools/README.md)
45
- [@valor/nativescript-view-shot](packages/nativescript-view-shot/README.md)
56
- [@valor/nativescript-websockets](packages/nativescript-websockets/README.md)

apps/demo-angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"@valor/nativescript-ngrx-devtools": "file:../../dist/packages/nativescript-ngrx-devtools",
77
"@valor/nativescript-barcodescanner": "file:../../dist/packages/nativescript-barcodescanner",
88
"@valor/nativescript-feedback": "file:../../dist/packages/nativescript-feedback",
9-
"@valor/nativescript-view-shot": "file:../../dist/packages/nativescript-view-shot"
9+
"@valor/nativescript-view-shot": "file:../../dist/packages/nativescript-view-shot",
10+
"@valor/nativescript-in-app-review": "file:../../dist/packages/nativescript-in-app-review"
1011
},
1112
"devDependencies": {
1213
"@nativescript/android": "~8.3.0",

apps/demo-angular/src/app-routing.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const routes: Routes = [
99
{ path: 'home', component: HomeComponent },
1010
{ path: 'nativescript-barcodescanner', loadChildren: () => import('./plugin-demos/nativescript-barcodescanner.module').then((m) => m.NativescriptBarcodescannerModule) },
1111
{ path: 'nativescript-feedback', loadChildren: () => import('./plugin-demos/nativescript-feedback.module').then((m) => m.NativescriptFeedbackModule) },
12+
{ path: 'nativescript-in-app-review', loadChildren: () => import('./plugin-demos/nativescript-in-app-review.module').then((m) => m.NativescriptInAppReviewModule) },
1213
{ path: 'nativescript-ngrx-devtools', loadChildren: () => import('./plugin-demos/nativescript-ngrx-devtools.module').then((m) => m.NativeScriptNgRxDevtoolsDemoModule) },
1314
{ path: 'nativescript-view-shot', loadChildren: () => import('./plugin-demos/nativescript-view-shot.module').then((m) => m.NativescriptViewShotModule) },
1415
{ path: 'nativescript-websockets', loadChildren: () => import('./plugin-demos/nativescript-websockets.module').then((m) => m.NativescriptWebsocketsModule) },

apps/demo-angular/src/home.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export class HomeComponent {
1212
{
1313
name: 'nativescript-feedback',
1414
},
15+
{
16+
name: 'nativescript-in-app-review',
17+
},
1518
{
1619
name: 'nativescript-ngrx-devtools',
1720
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ActionBar title="nativescript-in-app-review" class="action-bar"> </ActionBar>
2+
<StackLayout class="p-20">
3+
<ScrollView class="h-full">
4+
<StackLayout>
5+
<Button text="Test nativescript-in-app-review" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6+
</StackLayout>
7+
</ScrollView>
8+
</StackLayout>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Component, NgZone } from '@angular/core';
2+
import { DemoSharedNativescriptInAppReview } from '@demo/shared';
3+
import {} from '@valor/nativescript-in-app-review';
4+
5+
@Component({
6+
selector: 'demo-nativescript-in-app-review',
7+
templateUrl: 'nativescript-in-app-review.component.html',
8+
})
9+
export class NativescriptInAppReviewComponent {
10+
demoShared: DemoSharedNativescriptInAppReview;
11+
12+
constructor(private _ngZone: NgZone) {}
13+
14+
ngOnInit() {
15+
this.demoShared = new DemoSharedNativescriptInAppReview();
16+
}
17+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2+
import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3+
import { NativescriptInAppReviewComponent } from './nativescript-in-app-review.component';
4+
5+
@NgModule({
6+
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: NativescriptInAppReviewComponent }])],
7+
declarations: [NativescriptInAppReviewComponent],
8+
schemas: [NO_ERRORS_SCHEMA],
9+
})
10+
export class NativescriptInAppReviewModule {}

apps/demo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"@valor/nativescript-websockets": "file:../../packages/nativescript-websockets",
99
"@valor/nativescript-barcodescanner": "file:../../packages/nativescript-barcodescanner",
1010
"@valor/nativescript-feedback": "file:../../packages/nativescript-feedback",
11-
"@valor/nativescript-view-shot": "file:../../packages/nativescript-view-shot"
11+
"@valor/nativescript-view-shot": "file:../../packages/nativescript-view-shot",
12+
"@valor/nativescript-in-app-review": "file:../../packages/nativescript-in-app-review"
1213
},
1314
"devDependencies": {
1415
"@nativescript/android": "~8.3.0",

apps/demo/src/main-page.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<Button text="nativescript-barcodescanner" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1010
<Button text="nativescript-feedback" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1111
<Button text="nativescript-view-shot" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
12+
<Button text="nativescript-in-app-review" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1213
</StackLayout>
1314
</ScrollView>
1415
</StackLayout>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Observable, EventData, Page } from '@nativescript/core';
2+
import { DemoSharedNativescriptInAppReview } from '@demo/shared';
3+
import {} from '@valor/nativescript-in-app-review';
4+
5+
export function navigatingTo(args: EventData) {
6+
const page = <Page>args.object;
7+
page.bindingContext = new DemoModel();
8+
}
9+
10+
export class DemoModel extends DemoSharedNativescriptInAppReview {}

0 commit comments

Comments
 (0)