flatten dynamicLinkInfo to the top-level, move the mandatory keys validation to the javascript from the native modules and some minor fixes

This commit is contained in:
Omer Levy
2017-10-10 16:22:03 +03:00
parent adafa45380
commit fbdc733d53
7 changed files with 281 additions and 294 deletions

View File

@@ -25,8 +25,8 @@
- [Cloud Messaging](/modules/cloud-messaging)
- [Crash Reporting](/modules/crash)
- [Database](/modules/database)
- [Firestore (Beta)](/modules/firestore)
- [Dynamic Links](/modules/links)
- [Firestore (Beta)](/modules/firestore)
- [Remote Config](/modules/config)
- [Storage](/modules/storage)
- [Transactions](/modules/transactions)

View File

@@ -11,6 +11,7 @@ RNFirebase mimics [Firebase's REST API](https://firebase.google.com/docs/dynamic
The differences from the REST API are:
1. The input for the methods is a javascript object instead of a JSON object.
2. The response contains the URL string only.
3. There is no `dynamicLinkInfo` element. Instead, all of the elements under it were moved to be under the top-level.
### Methods
@@ -20,15 +21,13 @@ Creates a long dynamic link.
```javascript
firebase.links().createDynamicLink({
dynamicLinkInfo: {
dynamicLinkDomain: "abc123.app.goo.gl",
link: "https://example.com?param1=foo&param2=bar",
androidInfo: {
androidPackageName: "com.example.android"
},
iosInfo: {
iosBundleId: "com.example.ios"
}
dynamicLinkDomain: "abc123.app.goo.gl",
link: "https://example.com?param1=foo&param2=bar",
androidInfo: {
androidPackageName: "com.example.android"
},
iosInfo: {
iosBundleId: "com.example.ios"
}
}).
then((url) => {
@@ -41,15 +40,14 @@ then((url) => {
Creates a short dynamic link.
```javascript
firebase.links().createShortDynamicLink(dynamicLinkInfo: {
dynamicLinkDomain: "abc123.app.goo.gl",
link: "https://example.com?param1=foo&param2=bar",
androidInfo: {
androidPackageName: "com.example.android"
},
iosInfo: {
iosBundleId: "com.example.ios"
}
firebase.links().createShortDynamicLink({
dynamicLinkDomain: "abc123.app.goo.gl",
link: "https://example.com?param1=foo&param2=bar",
androidInfo: {
androidPackageName: "com.example.android"
},
iosInfo: {
iosBundleId: "com.example.ios"
}
}).
then((url) => {
@@ -62,35 +60,35 @@ Only the following parameters are currently supported:
```javascript
{
dynamicLinkInfo: {
dynamicLinkDomain: string,
link: string,
androidInfo: {
androidPackageName: string,
androidFallbackLink: string,
androidMinPackageVersionCode: string,
androidLink: string
},
iosInfo: {
iosBundleId: string,
iosFallbackLink: string,
iosCustomScheme: string,
iosIpadFallbackLink: string,
iosIpadBundleId: string,
iosAppStoreId: string
},
socialMetaTagInfo: {
socialTitle: string,
socialDescription: string,
socialImageLink: string
}
dynamicLinkDomain: 'string',
link: 'string',
androidInfo: {
androidPackageName: 'string',
androidFallbackLink: 'string',
androidMinPackageVersionCode: 'string',
androidLink: 'string',
},
iosInfo: {
iosBundleId: 'string',
iosFallbackLink: 'string',
iosCustomScheme: 'string',
iosIpadFallbackLink: 'string',
iosIpadBundleId: 'string',
iosAppStoreId: 'string',
},
socialMetaTagInfo: {
socialTitle: 'string',
socialDescription: 'string',
socialImageLink: 'string',
},
suffix: {
option: "SHORT" or "UNGUESSABLE"
}
option: 'string',
},
}
```
?> Please note that when using `androidInfo` or `iosInfo`, `androidPackageName` and `iosBundleId` are mandatory (respectively).
**please note:**
1. dynamicLinkDomain and link are mandatory fields. In addition, when using `androidInfo` or `iosInfo`, `androidPackageName` and `iosBundleId` are mandatory (respectively).
2. In oppose to the REST API, There is no `dynamicLinkInfo` element. Instead, all of the elements under it were moved to be under the top-level.
For more information [see reference](https://firebase.google.com/docs/reference/dynamic-links/link-shortener)