getBigPicture
Loads and returns the big picture image for expanded notification style.
This method downloads the image from the URL specified in the push payload's "pw_big_picture" attribute. The image is displayed when the user expands the notification. This method runs on a worker thread, so network operations are safe.
Image Requirements:
- Recommended size: 2:1 aspect ratio (e.g., 1024x512)
- Supported formats: JPEG, PNG
- The image should be optimized for mobile
Override this method to customize image loading, such as using a different image library (Glide, Picasso), applying transformations, or loading from local storage. Example - Custom image loading with caching:
protected Bitmap getBigPicture(PushMessage pushData) {
String imageUrl = pushData.getBigPictureUrl();
if (imageUrl == null) {
return null;
}
try {
// Use Glide with caching
return Glide.with(getApplicationContext())
.asBitmap()
.load(imageUrl)
.submit(1024, 512)
.get();
} catch (Exception e) {
Log.e("NotificationFactory", "Failed to load big picture", e);
return null;
}
}
Content copied to clipboard
Return
Bitmap to display in expanded notification, or null if URL is not specified or loading fails
Parameters
pushData
Push notification data containing the big picture URL