Added additional parameters for logging
Summary: The navigation plugin supports logging of a date and the class name. This addition adds that support. I have kept the previoius method which I will remove once I update the fb4a navigation plugin integration. Reviewed By: danielbuechele Differential Revision: D17202996 fbshipit-source-id: eac95328a6e2278c3a27ca608b9b675c8efe4528
This commit is contained in:
committed by
Facebook Github Bot
parent
4e71d9b1ea
commit
a90422bf2f
@@ -12,6 +12,7 @@ import com.facebook.flipper.core.FlipperObject;
|
||||
import com.facebook.flipper.core.FlipperPlugin;
|
||||
import com.facebook.flipper.core.FlipperReceiver;
|
||||
import com.facebook.flipper.core.FlipperResponder;
|
||||
import java.util.Date;
|
||||
|
||||
public class NavigationFlipperPlugin implements FlipperPlugin {
|
||||
|
||||
@@ -21,9 +22,21 @@ public class NavigationFlipperPlugin implements FlipperPlugin {
|
||||
|
||||
private NavigationFlipperPlugin() {}
|
||||
|
||||
@Deprecated
|
||||
public void sendNavigationEvent(@Nullable String keyURI) {
|
||||
sendNavigationEvent(keyURI, null, null);
|
||||
}
|
||||
|
||||
public void sendNavigationEvent(
|
||||
@Nullable String keyURI, @Nullable String className, @Nullable Date date) {
|
||||
if (mConnection != null) {
|
||||
mConnection.send("nav_event", new FlipperObject.Builder().put("uri", keyURI).build());
|
||||
FlipperObject sendObject =
|
||||
new FlipperObject.Builder()
|
||||
.put("uri", keyURI)
|
||||
.put("date", date != null ? date : new Date())
|
||||
.put("class", className)
|
||||
.build();
|
||||
mConnection.send("nav_event", sendObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ export default class extends FlipperPlugin<State, any, PersistedState> {
|
||||
const {setPersistedState} = this.props;
|
||||
const navigationEvent: NavigationEvent = {
|
||||
uri: payload.uri === undefined ? null : decodeURIComponent(payload.uri),
|
||||
date: payload.date || new Date(),
|
||||
date: new Date(payload.date) || new Date(),
|
||||
className: payload.class === undefined ? null : payload.class,
|
||||
screenshot: null,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user