Skip to content

Commit

Permalink
Adding pointData support to UserFlow
Browse files Browse the repository at this point in the history
Summary:
Adding support to the pointData to Android React Native
Changelog: [internal]

Reviewed By: swillard13

Differential Revision: D24256346

fbshipit-source-id: b970f771047cff580d9ebe7d6e2ad737394d6416
  • Loading branch information
dmitry-voronkevich authored and facebook-github-bot committed Oct 16, 2020
1 parent 518c9a2 commit 1bbe40a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Libraries/Reliability/UserFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ export type FlowId = {
instanceKey: number,
};

export type PointData = $Shape<{
string: ?{[string]: string, ...},
int: ?{[string]: number, ...},
double: ?{[string]: number, ...},
bool: ?{[string]: boolean, ...},
string_array: ?{[string]: $ReadOnlyArray<string>, ...},
int_array: ?{[string]: $ReadOnlyArray<number>, ...},
double_array: ?{[string]: $ReadOnlyArray<number>, ...},
bool_array: ?{[string]: $ReadOnlyArray<boolean>, ...},
}>;

/**
* API for tracking reliability of your user interactions
*
Expand Down Expand Up @@ -79,12 +90,13 @@ const UserFlow = {
}
},

addPoint(flowId: FlowId, pointName: string): void {
addPoint(flowId: FlowId, pointName: string, data: ?PointData = null): void {
if (global.nativeUserFlowAddPoint) {
global.nativeUserFlowAddPoint(
flowId.markerId,
flowId.instanceKey,
pointName,
data,
);
}
},
Expand Down

0 comments on commit 1bbe40a

Please sign in to comment.