File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ export class MainViewModel extends Observable {
1717 {
1818 name : 'firebase-database' ,
1919 } ,
20+ {
21+ name : 'firebase-dynamic-links' ,
22+ } ,
2023 {
2124 name : 'firebase-firestore' ,
2225 } ,
Original file line number Diff line number Diff line change 11import { Observable , EventData , Page } from '@nativescript/core' ;
22import { DemoSharedFirebaseDynamicLinks } from '@demo/shared' ;
3- import { } from '@nativescript/firebase-dynamic-links' ;
3+ import { firebase } from '@nativescript/firebase-core' ;
4+ import '@nativescript/firebase-dynamic-links' ;
5+ import { DynamicLinkSocialParameters } from '@nativescript/firebase-dynamic-links' ;
46
57export function navigatingTo ( args : EventData ) {
68 const page = < Page > args . object ;
79 page . bindingContext = new DemoModel ( ) ;
810}
911
1012export class DemoModel extends DemoSharedFirebaseDynamicLinks {
11-
13+ constructor ( ) {
14+ super ( ) ;
15+ const link = firebase ( ) . dynamicLinks ( ) . createShortLink ( 'https://docs.nativescript.org' , 'https://triniwiz.page.link' ) ;
16+
17+ link . social = new DynamicLinkSocialParameters ( ) ;
18+ link . social . imageUrl = 'https://art.nativescript.org/logo/export/NativeScript_Logo_White_Blue_Rounded.png' ;
19+
20+ firebase ( )
21+ . dynamicLinks ( )
22+ . buildLink ( link )
23+ . then ( ( link ) => {
24+ console . log ( 'link' , link ) ;
25+ } )
26+ . catch ( ( e ) => {
27+ console . log ( 'dynamicLinks: build error' , e ) ;
28+ } ) ;
29+ }
1230}
You can’t perform that action at this time.
0 commit comments