Notification Setinfo2 Extracting the tag problem

m643

Member
Licensed User
Longtime User
Hi all,

I have the following notification:
B4X:
myNotification.SetInfo2("Welcome", "Welcome", "tagtest", "Main")

When the notification is fired and the user clicks on it, it needs to run an activity. So I read in the documention to use the following code in the activity resume:
B4X:
    Dim in As Intent
    in = Activity.GetStartingIntent
    If in.HasExtra("tagtest") Then
        Log(in.GetExtra("tagtest")) 'Will log the tag
    End If

The problem is that it doesn't do anything. Do I something wrong?
 

barx

Well-Known Member
Licensed User
Longtime User
The extra will be called 'Notification_Tag' and contain the value 'tagtest'.

So use this code

B4X:
Dim in As Intent
in = Activity.GetStartingIntent
If in.HasExtra("Notification_Tag") Then
    Log(in.GetExtra("Notification_Tag")) 'Will log the tag
End If

tagtest should be logged
 
Upvote 0

m643

Member
Licensed User
Longtime User
The extra will be called 'Notification_Tag' and contain the value 'tagtest'.

So use this code

B4X:
Dim in As Intent
in = Activity.GetStartingIntent
If in.HasExtra("Notification_Tag") Then
    Log(in.GetExtra("Notification_Tag")) 'Will log the tag
End If

tagtest should be logged

Thank you very much!
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Your welcome.
 
Upvote 0
Top