Skip to content

Commit

Permalink
[notifications][android] Fix incorrect array to arraylist cast #949
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbianca committed Apr 10, 2018
1 parent 5127486 commit eb91523
Showing 1 changed file with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.RemoteInput;
import android.support.v4.content.LocalBroadcastManager;
Expand Down Expand Up @@ -341,7 +340,7 @@ private void displayNotification(Bundle notification, Promise promise) {
nb = nb.setOngoing(android.getBoolean("onlyAlertOnce"));
}
if (android.containsKey("people")) {
String[] people = android.getStringArray("people");
List<String> people = android.getStringArrayList("people");
if (people != null) {
for (String person : people) {
nb = nb.addPerson(person);
Expand Down Expand Up @@ -416,24 +415,6 @@ private void displayNotification(Bundle notification, Promise promise) {
nb = nb.setWhen(when.longValue());
}

// TODO: Big text / Big picture
/* String bigText = bundle.getString("big_text");
if(bigText != null){
notification.setStyle(new NotificationCompat.BigTextStyle().bigText(bigText));
}
String picture = bundle.getString("picture");
if(picture!=null){
NotificationCompat.BigPictureStyle bigPicture = new NotificationCompat.BigPictureStyle();
Bitmap pictureBitmap = getBitmap(picture);
if (pictureBitmap != null) {
bigPicture.bigPicture(pictureBitmap);
}
bigPicture.setBigContentTitle(title);
bigPicture.setSummaryText(bundle.getString("body"));
notification.setStyle(bigPicture);
} */
// Build any actions
if (android.containsKey("actions")) {
List<Bundle> actions = (List) android.getSerializable("actions");
Expand Down Expand Up @@ -522,7 +503,8 @@ private RemoteInput createRemoteInput(Bundle remoteInput) {
rb.setAllowFreeFormInput(remoteInput.getBoolean("allowFreeFormInput"));
}
if (remoteInput.containsKey("choices")) {
rb.setChoices(remoteInput.getStringArray("choices"));
List<String> choices = remoteInput.getStringArrayList("choices");
rb.setChoices(choices.toArray(new String[choices.size()]));
}
if (remoteInput.containsKey("label")) {
rb.setLabel(remoteInput.getString("label"));
Expand Down

0 comments on commit eb91523

Please sign in to comment.