Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Change android client module to pass keys as string[] instead of json #90

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,13 @@ public void registerAllFlagsListener(final String listenerId, final String envir
LDAllFlagsListener listener = new LDAllFlagsListener() {
@Override
public void onChange(List<String> flagKeys) {
WritableArray flagKeysArray = Arguments.createArray();
for (String flagKey: flagKeys) {
flagKeysArray.pushString((flagKey));
}
Comment on lines +777 to +780
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasnt sure about using the for each loop or using

flagKeys.forEach(flagKeysArray:: pushString)

the above gave me a warning in android studio about sdk versions so I decided going to basic option would be most compatible.


WritableMap result = Arguments.createMap();
result.putString("flagKeys", gson.toJson(flagKeys));
result.putArray("flagKeys", flagKeysArray);
result.putString("listenerId", multiListenerId);

getReactApplicationContext()
Expand Down