Expose more meta information for plugins

Summary: expose `appName`, `appId` and `device` to Sandy plugins. Will be used in next diff to migrate navigation plugin

Reviewed By: cekkaewnumchai

Differential Revision: D24857253

fbshipit-source-id: 03ac3d376d5d1950bcf3d78386a65ce167b517e3
This commit is contained in:
Michel Weststrate
2020-11-11 07:57:14 -08:00
committed by Facebook GitHub Bot
parent 9b4e7e873c
commit 1157976eef
7 changed files with 87 additions and 23 deletions

View File

@@ -36,6 +36,20 @@ export function plugin(client: PluginClient<Events, Methods>) {
The `PluginClient` received by the `plugin` exposes the following members:
### Properties
#### `device`
Returns the [`Device`](#device) this plugin is connected to.
#### `appName`
The name of the application, for example 'Facebook', 'Instagram' or 'Slack'.
#### `appId`
A string that uniquely identifies the current application, is based on a combination of the application name and device serial on which the application is running.
### Events listeners
#### `onMessage`