Skip to content

Commit 129de8f

Browse files
authored
docs(firebase-firestore): update (#199)
* docs(firebase-dynamic-links): update * chore: update WIP * chore: update * chore: update * chore: update * chore: update * docs(firebase-firestore): update WIP * chore: update * chore: update * chore: update * chore: update * chore: update * chore: update
1 parent 9460777 commit 129de8f

File tree

2 files changed

+1209
-233
lines changed

2 files changed

+1209
-233
lines changed

packages/firebase-dynamic-links/README.md

Lines changed: 181 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,57 @@ For instructions to confirm that your Firebase project is properly configured to
7979

8080
### Create a dynamic link from parameters
8181

82-
You can create a dynamic link via the Firebase console, your app or even your custom API. To create a dynamic link from parameters with the plugin, call the [buildLink](#buildlink) method on the [DynamicLinks class](#dynamiclinks-class) instance passing it a literal object of parameters or an instance of [DynamiclinkParameters](#dynamiclinkparameters-class) returned by the [createLink](#createlink) or [createShortLink](#createshortlink) method.
82+
You can create a dynamic link via the Firebase console, your app or even your custom API. To create a dynamic link from parameters with the plugin, call the [buildLink](#buildlink) method on the [DynamicLinks class](#dynamiclinks-class) instance passing it a literal object of parameters or an instance of [DynamiclinkParameters](#dynamiclinkparameters) returned by the [createLink](#createlink) or [createShortLink](#createshortlink) method.
8383

84+
85+
#### ShortLinkType
86+
```ts
87+
enum ShortLinkType {
88+
DEFAULT = 'default',
89+
SHORT = 'short',
90+
UNGUESSABLE = 'unguessable',
91+
}
92+
```
93+
---
94+
#### buildLink()
8495
```ts
85-
const link = firebase().dynamicLinks().createShortLink('https://docs.nativescript.org', 'https://triniwiz.page.link');
96+
dynamicLinks = firebase().dynamicLinks()
8697

87-
link.social = new DynamicLinkSocialParameters();
88-
link.social.imageUrl = 'https://art.nativescript.org/logo/export/NativeScript_Logo_White_Blue_Rounded.png';
98+
link: string = dynamicLinks.buildLink(linkParameters)
99+
```
100+
Builds a dynamic link from parameters and returns the link as a `string`. Use the returned link to direct the user to your desired content.
101+
102+
| Parameter | Type | Description
103+
|-----------|------|------------
104+
| `linkParameters` | [DynamicLinkParameters](#dynamiclinkparameters-class) | The dynamic link parameters used to create a dynamic link.
89105

90-
firebase()
91-
.dynamicLinks()
92-
.buildLink(link)
93-
.then((link) => {
94-
console.log('link', link);
95-
})
96-
.catch((e) => {
97-
console.log('dynamicLinks: build error', e);
98-
});
106+
#### onLink()
107+
```ts
108+
dynamicLinks: DynamicLinks = firebase().dynamicLinks()
109+
listener = (link: DynamicLink | null, error: FirebaseError | null) => {
110+
// handle the link event
111+
}
112+
dynamicLinks.onLink(listener)
113+
```
114+
Allows you to add a callback function that gets called when your app's screen is launched by a dynamic link.
115+
116+
| Parameter | Type | Description
117+
|-----------|-----|------------
118+
| `listener` | [OnLinkListener](#onlinklistener-type)| The function to be called when the app's screen is launched by a dynamic link.
119+
120+
##### OnLinkListener type
121+
122+
```ts
123+
type OnLinkListener = (link: DynamicLink | null, error: FirebaseError | null) => void;
124+
```
125+
---
126+
#### resolveLink()
127+
```ts
128+
dynamicLinks: DynamicLinks = firebase().dynamicLinks()
129+
130+
dynamicLinks.resolveLink(link).then((dynamicLink: DynamicLink)=>{
131+
132+
})
99133
```
100134
### Create the parameters of a dynamic link
101135

@@ -172,7 +206,7 @@ dynamicLinks = firebase().dynamicLinks()
172206

173207
dynamicLinkParameters: DynamicLinkParameters = dynamicLinks.createLink(link, domainUri)
174208
```
175-
Creates parameters for a dynamic link and returns a [DynamicLinkParameters](#dynamiclinkparameters-class) object to be passed to the method to create a dynamic link.
209+
Creates parameters for a dynamic link and returns a [DynamicLinkParameters](#dynamiclinkparameters) object to be passed to the method to create a dynamic link.
176210

177211
| Parameter | Type | Description
178212
|-----------|------|------------
@@ -186,7 +220,7 @@ dynamicLinks = firebase().dynamicLinks()
186220

187221
dynamicLinkParameters: DynamicLinkParameters = dynamicLinks.createShortLink(link, domainUri, shortLinkType)
188222
```
189-
Creates parameters for a dynamic link and returns a [DynamicLinkParameters](#dynamiclinkparameters-class) object to be passed to the method to create a dynamic link.
223+
Creates parameters for a dynamic link and returns a [DynamicLinkParameters](#dynamiclinkparameters) object to be passed to the method to create a dynamic link.
190224

191225

192226
| Parameter | Type | Description
@@ -214,7 +248,7 @@ Builds a dynamic link from parameters and returns the link as a `string`. Use th
214248

215249
| Parameter | Type | Description
216250
|-----------|------|------------
217-
| `linkParameters` | [DynamicLinkParameters](#dynamiclinkparameters-class) | The dynamic link parameters used to create a dynamic link.
251+
| `linkParameters` | [DynamicLinkParameters](#dynamiclinkparameters) | The dynamic link parameters used to create a dynamic link.
218252

219253
#### onLink()
220254
```ts
@@ -376,6 +410,137 @@ utmParameters: Record<string, string> = link.utmParameters
376410

377411
For the description of this property, see the description of [getUtmParameters()](https://firebase.google.com/docs/reference/android/com/google/firebase/dynamiclinks/PendingDynamicLinkData#getUtmParameters()) on the PendingDynamicLinkData class documentation.
378412

413+
Resolves the passed string and returns it as a [DynamicLink](#dynamiclink-object) if it's valid. Otherwise, it returns an error.
414+
415+
| Parameter | Type | Description
416+
|-----------|------|------------
417+
| `link` | `string` | The string to be resolved.
418+
419+
---
420+
421+
### DynamicLinkAnalyticsParameters class
422+
Used to create Analytics parameters for a dynamic link.
423+
424+
#### ios
425+
```ts
426+
ios = dynamicLinkAnalyticsParameters.ios
427+
```
428+
429+
--
430+
#### android
431+
```ts
432+
android = dynamicLinkAnalyticsParameters.android
433+
```
434+
435+
---
436+
#### campaign
437+
```ts
438+
campaign: undefined | string = dynamicLinkAnalyticsParameters.campign
439+
```
440+
441+
---
442+
#### content
443+
```ts
444+
content: undefined | string = dynamicLinkAnalyticsParameters.content
445+
// or
446+
```
447+
448+
---
449+
#### source
450+
```ts
451+
source: undefined | string = dynamicLinkAnalyticsParameters.source
452+
```
453+
454+
---
455+
#### term
456+
```ts
457+
term: undefined | string = dynamicLinkAnalyticsParameters.term
458+
```
459+
460+
### DynamicLinkParameters class
461+
462+
#### analytics
463+
```ts
464+
dynamicAnalytics: DynamicLinkAnalyticsParameters = dynamicLinkParameters.analytics
465+
```
466+
467+
---
468+
#### android
469+
```ts
470+
dynamicLinkParametersAndroid: DynamicLinkAnalyticsParameters = dynamicLinkParameters.android
471+
```
472+
473+
---
474+
#### ios
475+
```ts
476+
dynamicLinkParametersIOS: DynamicLinkAnalyticsParameters = dynamicLinkParameters.ios
477+
```
478+
479+
---
480+
#### domainUriPrefix
481+
```ts
482+
dynamicDomainUriPrefix: string = dynamicLinkParameters.domainUriPrefix
483+
```
484+
485+
The URL prefix of the dynamic link.
486+
487+
---
488+
#### itunes
489+
```ts
490+
dynamicLinkITunesParameters: DynamicLinkITunesParameters = dynamicLinkParameters.itunes
491+
```
492+
493+
---
494+
#### navigation
495+
```ts
496+
dynamicLinkNavigationParameters: DynamicLinkNavigationParameters = dynamicLinkParameters.navigation
497+
```
498+
499+
Gets or sets navigation info parameters.
500+
501+
---
502+
#### social
503+
```ts
504+
dynamicLinkSocialParameters: DynamicLinkSocialParameters = dynamicLinkParameters.social
505+
```
506+
507+
---
508+
509+
### DynamicLink object
510+
This object represents data of the link received by your app.
511+
#### ios
512+
```ts
513+
linkIOS: FIRDynamicLink = link.ios
514+
```
515+
516+
---
517+
#### android
518+
```ts
519+
linkAndroid: com.google.firebase.dynamiclinks.PendingDynamicLinkData = link.android
520+
```
521+
522+
---
523+
#### minimumAppVersion
524+
```ts
525+
minimumAppVersion: string = link.minimumAppVersion
526+
```
527+
For the description of this property, see the description of [getMinimumAppVersion()](https://firebase.google.com/docs/reference/android/com/google/firebase/dynamiclinks/PendingDynamicLinkData#getMinimumAppVersion()) on the PendingDynamicLinkData class documentation.
528+
529+
---
530+
#### url
531+
```ts
532+
url: string = link.url
533+
```
534+
For the description of this property, see the description of [getUrl()](https://firebase.google.com/docs/reference/android/com/google/firebase/dynamiclinks/PendingDynamicLinkData#getLink()) on the PendingDynamicLinkData class documentation.
535+
536+
---
537+
#### utmParameters
538+
```ts
539+
utmParameters: Record<string, string> = link.utmParameters
540+
```
541+
542+
For the description of this property, see the description of [getUtmParameters()](https://firebase.google.com/docs/reference/android/com/google/firebase/dynamiclinks/PendingDynamicLinkData#getUtmParameters()) on the PendingDynamicLinkData class documentation.
543+
379544
## License
380545

381546
Apache License Version 2.0

0 commit comments

Comments
 (0)