File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
android/src/main/java/com/pspdfkit/react/events Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,20 @@ public class PdfViewDataReturnedEvent extends Event<PdfViewDataReturnedEvent> {
2424
2525 private final WritableMap payload ;
2626
27- public PdfViewDataReturnedEvent (@ IdRes int viewId , int requestId , @ NonNull List <Annotation > annotations ) {
27+ public PdfViewDataReturnedEvent (@ IdRes int viewId , int requestId , @ NonNull List <Annotation > annotationsToSerialize ) {
2828 super (viewId );
2929 Map <String , Object > map = new HashMap <>();
3030 map .put ("requestId" , requestId );
3131 try {
3232 List <Map <String , Object >> annotationsSerialized = new ArrayList <>();
33- for (Annotation annotation : annotations ) {
33+ for (Annotation annotation : annotationsToSerialize ) {
3434 JSONObject instantJson = new JSONObject (annotation .toInstantJson ());
3535 annotationsSerialized .add (JsonUtilities .jsonObjectToMap (instantJson ));
3636 }
37- map .put ("result" , annotationsSerialized );
37+
38+ Map <String , Object > annotations = new HashMap <>();
39+ annotations .put ("annotations" , annotationsSerialized );
40+ map .put ("result" , annotations );
3841 } catch (JSONException e ) {
3942 map .put ("error" , e .getMessage ());
4043 }
You can’t perform that action at this time.
0 commit comments