Skip to content

Commit e99a189

Browse files
committed
feat: functions
1 parent e4b9ef1 commit e99a189

File tree

83 files changed

+1995
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1995
-7
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ npm start
1414
- @nativescript/firebase-database
1515
- @nativescript/firebase-dynamic-links
1616
- @nativescript/firebase-firestore
17+
- @nativescript/firebase-functions
1718
- @nativescript/firebase-in-app-messaging
1819
- @nativescript/firebase-installations
1920
- @nativescript/firebase-messaging

apps/demo-angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"@nativescript/firebase-performance": "file:../../dist/packages/firebase-performance",
1717
"@nativescript/firebase-installations": "file:../../dist/packages/firebase-installations",
1818
"@nativescript/firebase-dynamic-links": "file:../../dist/packages/firebase-dynamic-links",
19-
"@nativescript/firebase-messaging": "file:../../dist/packages/firebase-messaging"
19+
"@nativescript/firebase-messaging": "file:../../dist/packages/firebase-messaging",
20+
"@nativescript/firebase-functions": "file:../../dist/packages/firebase-functions"
2021
},
2122
"devDependencies": {
2223
"@nativescript/android": "8.0.0",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const routes: Routes = [
1616
{ path: 'firebase-database', loadChildren: () => import('./plugin-demos/firebase-database.module').then(m => m.FirebaseDatabaseModule) },
1717
{ path: 'firebase-dynamic-links', loadChildren: () => import('./plugin-demos/firebase-dynamic-links.module').then(m => m.FirebaseDynamicLinksModule) },
1818
{ path: 'firebase-firestore', loadChildren: () => import('./plugin-demos/firebase-firestore.module').then(m => m.FirebaseFirestoreModule) },
19+
{ path: 'firebase-functions', loadChildren: () => import('./plugin-demos/firebase-functions.module').then(m => m.FirebaseFunctionsModule) },
1920
{ path: 'firebase-in-app-messaging', loadChildren: () => import('./plugin-demos/firebase-in-app-messaging.module').then(m => m.FirebaseInAppMessagingModule) },
2021
{ path: 'firebase-installations', loadChildren: () => import('./plugin-demos/firebase-installations.module').then(m => m.FirebaseInstallationsModule) },
2122
{ path: 'firebase-messaging', loadChildren: () => import('./plugin-demos/firebase-messaging.module').then(m => m.FirebaseMessagingModule) },

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export class HomeComponent {
3333
{
3434
name: 'firebase-firestore'
3535
},
36+
{
37+
name: 'firebase-functions'
38+
},
3639
{
3740
name: 'firebase-in-app-messaging'
3841
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ActionBar title="firebase-functions" class="action-bar"> </ActionBar>
2+
<StackLayout class="p-20">
3+
<ScrollView class="h-full">
4+
<StackLayout>
5+
<Button text="Test firebase-functions" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6+
</StackLayout>
7+
</ScrollView>
8+
</StackLayout>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Component, NgZone } from '@angular/core';
2+
import { DemoSharedFirebaseFunctions } from '@demo/shared';
3+
import { } from '@nativescript/firebase-functions';
4+
5+
@Component({
6+
selector: 'demo-firebase-functions',
7+
templateUrl: 'firebase-functions.component.html',
8+
})
9+
export class FirebaseFunctionsComponent {
10+
11+
demoShared: DemoSharedFirebaseFunctions;
12+
13+
constructor(private _ngZone: NgZone) {}
14+
15+
ngOnInit() {
16+
this.demoShared = new DemoSharedFirebaseFunctions();
17+
}
18+
19+
}
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 { FirebaseFunctionsComponent } from './firebase-functions.component';
4+
5+
@NgModule({
6+
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: FirebaseFunctionsComponent }])],
7+
declarations: [FirebaseFunctionsComponent],
8+
schemas: [ NO_ERRORS_SCHEMA]
9+
})
10+
export class FirebaseFunctionsModule {}

apps/demo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"@nativescript/firebase-performance": "file:../../packages/firebase-performance",
2020
"@nativescript/firebase-installations": "file:../../packages/firebase-installations",
2121
"@nativescript/firebase-dynamic-links": "file:../../packages/firebase-dynamic-links",
22-
"@nativescript/firebase-messaging": "file:../../packages/firebase-messaging"
22+
"@nativescript/firebase-messaging": "file:../../packages/firebase-messaging",
23+
"@nativescript/firebase-functions": "file:../../packages/firebase-functions"
2324
},
2425
"devDependencies": {
2526
"@nativescript/android": "8.1.0",

apps/demo/src/app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import '@nativescript/firebase-messaging';
44
import '@nativescript/firebase-admob';
55
import '@nativescript/firebase-dynamic-links';
66
import '@nativescript/firebase-firestore';
7+
import '@nativescript/firebase-functions';
78

89
import {Messaging} from '@nativescript/firebase-messaging';
910
import {Admob} from '@nativescript/firebase-admob';
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Observable, EventData, Page } from '@nativescript/core';
2+
import { DemoSharedFirebaseFunctions } from '@demo/shared';
3+
import { } from '@nativescript/firebase-functions';
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 DemoSharedFirebaseFunctions {
11+
12+
}

0 commit comments

Comments
 (0)