Hi,
This is how we build the NB6 Notification. The 3rd parameter is the Tag
Checking the NB6 class, I understand that the 3rd parameter of nb.Build() is a String. I would like to pass few more information via Tag, may be a Map. For eg. in my app I receive few types of FCM Notifications. After receiving the FCM message on the device, the required activity will be called. For eg I will be sending a notification to the app user regarding an OFFER, While receiving the notification, an OFFER ID is also received. I would like to pass both information ie
The Notification type ie "OFFER"
OFFER ID for eg "123"
At present this is how the HomePage's Activity_Resume sub handles the Notification when it is received via the call
As of now, there is no provision to set the parent activity of the called Activity, called from the Notification (ie when the user press the back key, the activity to be called). So to overcome this limitation, we need to call the HomePage first and from the Activity_Resume of the HomePage activity we need to call the required activity.
Any help will be appreciated.
Thanks
This is how we build the NB6 Notification. The 3rd parameter is the Tag
B4X:
nb.Build(cSubject,cMsg,"Offers",HomePage).Notify(nNotificationCount)
Checking the NB6 class, I understand that the 3rd parameter of nb.Build() is a String. I would like to pass few more information via Tag, may be a Map. For eg. in my app I receive few types of FCM Notifications. After receiving the FCM message on the device, the required activity will be called. For eg I will be sending a notification to the app user regarding an OFFER, While receiving the notification, an OFFER ID is also received. I would like to pass both information ie
The Notification type ie "OFFER"
OFFER ID for eg "123"
At present this is how the HomePage's Activity_Resume sub handles the Notification when it is received via the call
B4X:
nb.Build(cSubject,cMsg,"Offers",HomePage).Notify(nNotificationCount)
B4X:
Sub Activity_Resume
Dim in As Intent = Activity.GetStartingIntent
If in.IsInitialized And in <> OldIntent Then
OldIntent = in
Dim intentExtra As String
If in.HasExtra("Notification_Tag") Then
intentExtra = in.GetExtra("Notification_Tag")
If intentExtra = "Offers" Then 'The tag 'Offer Notification
' What needs to be done here to get few more extra information passed via the notification
' tag ie the OFFER ID too, so that I can pass all the required info to the right Activity
Dim mapParameters As Map : mapParameters.Initialize
mapParameters.Put("OfferID","123")
mapParameters.Put("Title", "What ever Title")
CallSubDelayed2(MyActivityName,"StartWithParameter",mapParameters)
End If
End If
End If
End Sub
As of now, there is no provision to set the parent activity of the called Activity, called from the Notification (ie when the user press the back key, the activity to be called). So to overcome this limitation, we need to call the HomePage first and from the Activity_Resume of the HomePage activity we need to call the required activity.
Any help will be appreciated.
Thanks