-
Notifications
You must be signed in to change notification settings - Fork 218
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 crash when using action buttons in Android #743
Conversation
247a611
to
4c61e83
Compare
The object names match iOS
16ed4ce
to
cb1a2b8
Compare
List<HashMap<String, Object>> convertedList = new ArrayList<HashMap<String, Object>>(); | ||
for (IActionButton actionButton : actionButtons) { | ||
HashMap<String, Object> hash = new HashMap<>(); | ||
hash.put("i", actionButton.getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't use creating the minited keys here, since these are the names the app developer will use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
HashMap<String, Object> hash = new HashMap<>(); | ||
hash.put("i", actionButton.getId()); | ||
hash.put("n", actionButton.getText()); | ||
hash.put("icon_type", actionButton.getIcon()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be icon
instead of icon_type
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
…ttons Fix crash when using action buttons in Android
Description
One Line Summary
Fix crash in Android when receiving a notification with action buttons.
Details
We were converting the ActionButtons to a map so we could not bridge to dart from Android native
Fixes OneSignal/OneSignal-Android-SDK#1815
Motivation
fix crash
Scope
android push notifications
Testing
Manual testing
tested with Android push and iOS push
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is