Class NotificationBundle
- 
                    
                    
- All Implemented Interfaces:
 
public final class NotificationBundleWrapper with helpers to load data from the bundle received with a notification sent using Marigold Platform
 
- 
                
                    
                    
- 
                                
                            
                                
Field Summary
Fields Modifier and Type Field Description public final static StringEXTRA_NOTIFICATION_IDpublic final static StringBUNDLE_KEY_PAYLOADpublic final static StringBUNDLE_KEY_PAYLOAD_IMAGEpublic final static StringBUNDLE_KEY_PAYLOAD_VIDEOpublic final static StringBUNDLE_KEY_PAYLOAD_MIDpublic final static StringBUNDLE_KEY_COLLAPSE_KEYpublic final static StringBUNDLE_KEY_DEEP_LINKpublic final static StringBUNDLE_KEY_ALERTpublic final static StringBUNDLE_KEY_BADGEpublic final static StringBUNDLE_KEY_SOUNDpublic final static StringBUNDLE_KEY_CATEGORYpublic final static StringBUNDLE_KEY_TITLEpublic final static StringBUNDLE_KEY_CHANNEL_IDpublic final static StringBUNDLE_KEY_ACTIONSprivate final Bundlebundle 
- 
                                
                            
                                
Constructor Summary
Constructors Constructor Description NotificationBundle(RemoteMessage remoteMessage)Construct a new instance of NotificationBundle, from the provided RemoteMessageNotificationBundle(Bundle bundle) 
- 
                                
                            
                                
Method Summary
Modifier and Type Method Description final BundlegetBundle()final IntegergenerateAndroidNotificationID()Build an id to be used to identify the notification while calling android.app.NotificationManager.notify. final IntegergenerateAndroidNotificationActionID(String actionName)Generates unique IDs for Notification Actions to so that unique PendingIntents can be created for them. final BooleanisDeepLinkNotification()final StringgetDeepLink()final StringgetTitle()final StringgetSound(String defaultValue)final StringgetChannelId()final StringgetAlert()final StringgetMessageIdFromPayload()final StringgetImageUrlFromPayload()final StringgetVideoUrlFromPayload()final StringgetCategory()final StringgetNotificationId()final StringgetBadge()final JSONObjectgetActions()final StringgetActionLink(ActionTapped actionTapped)Retrieves any custom links/deeplinks for this action from the notification payload and returns as a string. final BundlegetRemoteInputBundle()Return bundle containing remote input results. final UnitsetRemoteInputBundle(Bundle remoteInputBundle)Set the bundle containing the remote input results. Booleanequals(Object other)IntegerhashCode()- 
                    
                    
                    
- 
                                
                            
                                
Constructor Detail
- 
                                        
NotificationBundle
NotificationBundle(RemoteMessage remoteMessage)
Construct a new instance ofNotificationBundle, from the provided RemoteMessage- Parameters:
 remoteMessage- an FCM RemoteMessage
 
- 
                                        
NotificationBundle
NotificationBundle(Bundle bundle)
 
 - 
                                        
 
- 
                                
                            
                                
Method Detail
- 
                                        
generateAndroidNotificationID
final Integer generateAndroidNotificationID()
Build an id to be used to identify the notification while calling android.app.NotificationManager.notify. This ID is used by the Android OS to collapse notifications, if necessary.
- Returns:
 hashcode of: the
collapse_keywhen available, otherwise the Marigold notification ID (guaranteed to be unique), and if that's not available generates a random id
 
- 
                                        
generateAndroidNotificationActionID
final Integer generateAndroidNotificationActionID(String actionName)
Generates unique IDs for Notification Actions to so that unique PendingIntents can be created for them.
- Parameters:
 actionName- the name of the action- Returns:
 hashcode of the Marigold notification ID and the action name.
 
- 
                                        
isDeepLinkNotification
final Boolean isDeepLinkNotification()
 
- 
                                        
getDeepLink
final String getDeepLink()
 
- 
                                        
getChannelId
final String getChannelId()
 
- 
                                        
getMessageIdFromPayload
final String getMessageIdFromPayload()
 
- 
                                        
getImageUrlFromPayload
final String getImageUrlFromPayload()
 
- 
                                        
getVideoUrlFromPayload
final String getVideoUrlFromPayload()
 
- 
                                        
getCategory
final String getCategory()
 
- 
                                        
getNotificationId
final String getNotificationId()
 
- 
                                        
getActions
final JSONObject getActions()
 
- 
                                        
getActionLink
final String getActionLink(ActionTapped actionTapped)
Retrieves any custom links/deeplinks for this action from the notification payload and returns as a string.
- Returns:
 String containing the link/deeplink for the action to route to.
 
- 
                                        
getRemoteInputBundle
final Bundle getRemoteInputBundle()
Return bundle containing remote input results.
- Returns:
 Remote input bundle
 
- 
                                        
setRemoteInputBundle
final Unit setRemoteInputBundle(Bundle remoteInputBundle)
Set the bundle containing the remote input results.
- Parameters:
 remoteInputBundle- Bundle containing remote input results.
 
 - 
                                        
 
 - 
                                
                            
                                
 
 - 
                    
                    
                    
 
 -