Introduce isPluginAvailable and selectPlugin
Summary: Introduced API to replace the deprecated `selectPlugin` in Sandy. The API can be used to navigate from `device plugin -> device plugin`, or` client plugin -> device / client plugin` Introduced `isPluginAvailable` as well, so that the user interaction an be fine tuned in case the plugin is not disabled. Reviewed By: jknoxville Differential Revision: D25422370 fbshipit-source-id: c6c603f1c68e6291280b3d0883e474448754ded1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
02a56da3f5
commit
52862f6083
@@ -201,9 +201,21 @@ client.addMenuEntry({
|
||||
})
|
||||
```
|
||||
|
||||
#### `isPluginAvailable`
|
||||
|
||||
Usage: `isPluginAvailable(pluginId: string): boolean`
|
||||
|
||||
Returns `true` if a plugin with the given id is available by for consumption, that is: supported by the current application / device, and enabled by the user.
|
||||
|
||||
#### `selectPlugin`
|
||||
|
||||
Usage: `selectPlugin(pluginId: string, deeplinkPayload?: unknown): void`
|
||||
|
||||
Opens a different plugin by id, optionally providing a deeplink to bring the target plugin to a certain state.
|
||||
|
||||
#### `supportsMethod`
|
||||
|
||||
Usage; `client.supportsMethod(method: string): Promise<Boolean>`
|
||||
Usage: `client.supportsMethod(method: string): Promise<Boolean>`
|
||||
|
||||
Resolves to true if the client supports the specified method. Useful when adding functionality to existing plugins, when connectivity to older clients is still required. Also useful when client plugins are implemented on multitple platforms and don't all have feature parity.
|
||||
|
||||
@@ -262,6 +274,14 @@ See the similarly named method under [`PluginClient`](#pluginclient).
|
||||
|
||||
See the similarly named method under [`PluginClient`](#pluginclient).
|
||||
|
||||
### `isPluginAvailable`
|
||||
|
||||
See the similarly named method under [`PluginClient`](#pluginclient).
|
||||
|
||||
### `selectPlugin`
|
||||
|
||||
See the similarly named method under [`PluginClient`](#pluginclient).
|
||||
|
||||
## Device
|
||||
|
||||
`Device` captures the metadata of the device the plugin is currently connected to.
|
||||
|
||||
Reference in New Issue
Block a user