This my code is an example of the app template combining: B4XPages 2-page app for targetSdkVersion="34" Autostart Receiver Foreground service with notifications (for example, of FOREGROUND_SERVICE_MEDIA_PLAYBACK type, check the Manifest editor) Where notification of each page allows going to...
Sub Activity_Resume
Dim in As Intent
in = Activity.GetStartingIntent
If in.HasExtra("Notification_Tag") Then
Log(in.GetExtra("Notification_Tag")) 'Will log the tag
End If
End Sub
Notification1.SetInfo2("Title", Content, "page_ID", Main) 'The single Activity is always Main
Catching:
B4X:
Sub B4XPage_Appear
'(Intent) Intent { flg=0x10020000 cmp=apppackage.name/.main (has extras) }
If B4XPages.GetNativeParent(Me).GetStartingIntent.HasExtra("Notification_Tag") Then
Dim page_ID As String = B4XPages.GetNativeParent(Me).GetStartingIntent.GetExtra("Notification_Tag")
B4XPages.ShowPage(page_ID)
End If
End Sub
Not solved. After showing a page - impossible to go back, the starting intent is always the same as from the notification, with the same extra "Notification_Tag".
Not solved. After showing a page - impossible to go back, the starting intent is always the same as from the notification, with the same extra "Notification_Tag".
This my code is an example of the app template combining: B4XPages 2-page app for targetSdkVersion="34" Autostart Receiver Foreground service with notifications (for example, of FOREGROUND_SERVICE_MEDIA_PLAYBACK type, check the Manifest editor) Where notification of each page allows going to...