Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): handle setDataProcessingOptions params correctly to avoid crash #256

Merged
merged 1 commit into from May 18, 2022

Conversation

oscb
Copy link
Contributor

@oscb oscb commented May 18, 2022

Fixes #255

  • Changed the argument types of setDataProcessingOptions method in the Android Native Module, replacing String[] for ReadableArray.
  • Removed @Nullable as the TS types don't support nullable
  • Removed setDataProcessingOptionsExtra and merged the country and state options into the base method as the setDataProcessingOptionsExtra is not being used in RN, yet the method supports country and state options.

Test Plan:

Verified in the generated Example app by adding the call the method after initialization:

// Ask for consent first if necessary
// Possibly only do this for iOS if no need to handle a GDPR-type flow
Settings.initializeSDK();

Settings.setDataProcessingOptions(['LDU'], 0, 0);

Verified the app compiles and runs, not crashing with the previous error.

@oscb oscb marked this pull request as ready for review May 18, 2022 01:18
Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

Looks great - thanks for patching this up. Just pending CI now but I am curious - does it work on iOS? I guess if the NSArray and NSStringArray types are compatible that one just works already?

@mikehardy mikehardy added the pending-merge Just waiting on clean CI test run. Any maintainer should feel free to merge if CI is passing. label May 18, 2022
@oscb
Copy link
Contributor Author

oscb commented May 18, 2022

I guess if the NSArray and NSStringArray types are compatible that one just works already?

Yea, I believe NSStringArray is a typedef to NSArray<NSString *> in the React Native code.

@mikehardy mikehardy changed the title fix: fix argument types in setDataProcessingOptions native java method fix(android): handle setDataProcessingOptions params correctly to avoid crash May 18, 2022
@mikehardy mikehardy merged commit 1426cf8 into thebergamo:master May 18, 2022
@mikehardy mikehardy removed the pending-merge Just waiting on clean CI test run. Any maintainer should feel free to merge if CI is passing. label May 18, 2022
github-actions bot pushed a commit that referenced this pull request May 18, 2022
### [8.0.5](v8.0.4...v8.0.5) (2022-05-18)

### Bug Fixes

* **android:** handle setDataProcessingOptions params correctly to avoid crash ([#256](#256)) ([1426cf8](1426cf8))
@github-actions
Copy link

🎉 This PR is included in version 8.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Got unknown argument class: String[] when calling Settings.setDataProcessingOptions (Android only)
2 participants