Hello everybody, although I have read many threads on the subject, I did not understand what I have to do to be able to open the APP when I tap the push message.
fm_MessageArrived is only called when the APP is in foreground mode. I have other APPs that use the same service and the APP is opened, why not on this one in particular? Could it be due to this (I introduced them to use biometric)?
Thanks in advance for your attention ... please help me, I've been losing my mind for days
These are the libraries I use:
#AdditionalJar: android-pdf-viewer.aar
#AdditionalJar: com.android.support:support-v4
#AdditionalJar: Pdfium.aar
#AdditionalJar: androidx.biometric:biometric
'#Extends: android.support.v7.app.AppCompatActivity
#AdditionalJar: androidx.arch.core:core-runtime
#AdditionalJar: androidx.appcompat:appcompat
#Extends: android.support.v4.app.FragmentActivity
This is my firebase service:
#Region Service Attributes
#StartAtBoot: false
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Public fm As FirebaseMessaging
Public Token As String
End Sub
Sub Service_Create
fm.Initialize("fm")
End Sub
Public Sub SubscribeToTopics
fm.SubscribeToTopic("suitenextappflow") 'you can subscribe to more topics
Token = fm.Token
Log("Il Token è = " & Token)
End Sub
public Sub fm_TokenRefresh
Token = fm.Token
Log("Il Token è = " & Token)
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
Log($"Message data: ${Message.GetData}"$)
End Sub
public Sub SendNotification(title As String, content As String, tag As String)
Dim nb As NotificationBuilder
nb.initialize
nb.SmallIcon="icon"
nb.ContentTitle= title
nb.ContentText=content
nb.DefaultLight=True
nb.DefaultSound=True
nb.DefaultVibrate=True
nb.ContentInfo=""
nb.subtext=""
nb.Priority= 10
If tag <> "" Then
nb.Tag = tag
End If
nb.setActivity(Main)
nb.Notify(1)
End Sub
Sub Service_Start (StartingIntent As Intent)
If StartingIntent.IsInitialized Then fm.HandleIntent(StartingIntent)
Sleep(0)
Service.StopAutomaticForeground 'remove if not using B4A v8+.
End Sub
Sub Service_Destroy
End Sub
fm_MessageArrived is only called when the APP is in foreground mode. I have other APPs that use the same service and the APP is opened, why not on this one in particular? Could it be due to this (I introduced them to use biometric)?
B4X:
#AdditionalJar: androidx.biometric:biometric
'#Extends: android.support.v7.app.AppCompatActivity
#AdditionalJar: androidx.arch.core:core-runtime
#AdditionalJar: androidx.appcompat:appcompat
#Extends: android.support.v4.app.FragmentActivity
Thanks in advance for your attention ... please help me, I've been losing my mind for days