Document the new deeplink format [2/n]
Summary: Added docs on how to use deeplink. Note that not all features are implemented yet. Reviewed By: fabiomassimo Differential Revision: D29845044 fbshipit-source-id: 835fba8ce97c2106d160f347675e11d1ed749fba
This commit is contained in:
committed by
Facebook GitHub Bot
parent
38473121ba
commit
b757bff9f6
34
docs/extending/deeplinks.mdx
Normal file
34
docs/extending/deeplinks.mdx
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
id: deeplinks
|
||||||
|
title: Using deeplinks
|
||||||
|
---
|
||||||
|
|
||||||
|
Flipper supports opening Flipper through deeplinks, by using the `flipper://` protocol.
|
||||||
|
|
||||||
|
## open-plugin
|
||||||
|
|
||||||
|
The follow link format can be used to open Flipper, and open a specific plugin:
|
||||||
|
|
||||||
|
`flipper://open-plugin?plugin-id=<plugin-id>&client=<client>&devices=<devices>&payload=<payload>`
|
||||||
|
|
||||||
|
The parameters are specified as follows:
|
||||||
|
|
||||||
|
* `plugin-id` (required) the identifier of the plugin that needs to be opened, as specified by the `id` field in `package.json`.
|
||||||
|
* `client` (optional) the name of the application that should be opened. For device plugins, this doesn't need to be specified. If not set, the user will be prompted to select a client.
|
||||||
|
* `devices` (optional) comma separated list of device types that are acceptable. E.g. `iOS,Android` or `Metro`. If set, `client` and `plugin-id` must be running on this type of device.
|
||||||
|
* `payload` (optional) any additional string argument to pass to the plugin. Note that this argument should be properly URL encoded.
|
||||||
|
|
||||||
|
|
||||||
|
Using this deeplink format will make sure that:
|
||||||
|
|
||||||
|
* [FB-ONLY] The user is logged in & connected to Facebook.
|
||||||
|
* Verify that Flipper is up to date.
|
||||||
|
* [FB-ONLY] Install the specified plugin if not installed already.
|
||||||
|
* Make sure the plugin is available on the provided client / device, or will prompt the user for a valid device / client selection is made on which the plugin is available.
|
||||||
|
* Enable the plugin if not enabled already.
|
||||||
|
|
||||||
|
### Handling deeplinks in the plugin
|
||||||
|
|
||||||
|
If a plugin is opened through a deeplink, for which a `payload` was set, the [`onDeepLink`](flipper-plugin#ondeeplink) handler will be triggered directly after initializing and rendering the plugin.
|
||||||
|
|
||||||
|
Note that the same payload format can also be used to open other plugins programmatically from inside another plugin, by passing the payload as second argument to [`selectPlugin`](flipper-plugin#selectplugin).
|
||||||
@@ -105,6 +105,7 @@ module.exports = {
|
|||||||
'Desktop plugin APIs': [
|
'Desktop plugin APIs': [
|
||||||
'extending/flipper-plugin',
|
'extending/flipper-plugin',
|
||||||
'extending/styling-components',
|
'extending/styling-components',
|
||||||
|
'extending/deeplinks',
|
||||||
...fbInternalOnly([
|
...fbInternalOnly([
|
||||||
{
|
{
|
||||||
'QPL linting': ['fb/building-a-linter', 'fb/active-linters'],
|
'QPL linting': ['fb/building-a-linter', 'fb/active-linters'],
|
||||||
|
|||||||
Reference in New Issue
Block a user