Hi, I'm using Urban Airship SDK for push notifications. For big picture style notifications, I'm extending NotificationFactory, and adding the bitmap to it. Code is as follows (for createNotification method in MyNotificationFactory):
Intent intent = new Intent(mClickAction);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse(mClickAction));
PendingIntent pendingIntent = PendingIntent.getActivity(mContext, (int) System.currentTimeMillis() /* Request code */, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
String mImageUrl = pushMessage.getPushBundle().getString("image_url");
mNotificationBitmap = getBitmapFromURL(mImageUrl);
NotificationCompat.BigPictureStyle bigPicStyle = new NotificationCompat.BigPictureStyle();
bigPicStyle.bigLargeIcon(mNotificationBitmap);
bigPicStyle.bigPicture(mNotificationBitmap);
bigPicStyle.setSummaryText("Hi");
bigPicStyle.setBigContentTitle("Great");
NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext)
.setContentTitle(mContext.getResources().getString(R.string.app_name))
.setContentText("Hey there")
.setSmallIcon(R.drawable.ic_launcher)
.setContentIntent(pendingIntent)
.setAutoCancel(true);
builder.setStyle(bigPicStyle);
return builder.build();
The notification is successfully built, and is posted. On tapping the notification, nothing happens, even if I return false from onNotificationOpened (which should cause UA to launch the launcher activity). I've tried true and false both, but it just hits onNotificationOpened. Need help regarding this.
Comments
5 comments