Skip to content

Commit

Permalink
fix(dynamicLinks): demo
Browse files Browse the repository at this point in the history
  • Loading branch information
triniwiz committed Dec 12, 2022
1 parent ebf5736 commit f8ef50c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions apps/demo/src/main-view-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export class MainViewModel extends Observable {
{
name: 'firebase-database',
},
{
name: 'firebase-dynamic-links',
},
{
name: 'firebase-firestore',
},
Expand Down
22 changes: 20 additions & 2 deletions apps/demo/src/plugin-demos/firebase-dynamic-links.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
import { Observable, EventData, Page } from '@nativescript/core';
import { DemoSharedFirebaseDynamicLinks } from '@demo/shared';
import { } from '@nativescript/firebase-dynamic-links';
import { firebase } from '@nativescript/firebase-core';
import '@nativescript/firebase-dynamic-links';
import { DynamicLinkSocialParameters } from '@nativescript/firebase-dynamic-links';

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

export class DemoModel extends DemoSharedFirebaseDynamicLinks {

constructor() {
super();
const link = firebase().dynamicLinks().createShortLink('https://docs.nativescript.org', 'https://triniwiz.page.link');

link.social = new DynamicLinkSocialParameters();
link.social.imageUrl = 'https://art.nativescript.org/logo/export/NativeScript_Logo_White_Blue_Rounded.png';

firebase()
.dynamicLinks()
.buildLink(link)
.then((link) => {
console.log('link', link);
})
.catch((e) => {
console.log('dynamicLinks: build error', e);
});
}
}

0 comments on commit f8ef50c

Please sign in to comment.