Skip to content

Commit f8ef50c

Browse files
committed
fix(dynamicLinks): demo
1 parent ebf5736 commit f8ef50c

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

apps/demo/src/main-view-model.ts

+3
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
import { Observable, EventData, Page } from '@nativescript/core';
22
import { 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

57
export function navigatingTo(args: EventData) {
68
const page = <Page>args.object;
79
page.bindingContext = new DemoModel();
810
}
911

1012
export 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
}

0 commit comments

Comments
 (0)