Hi,
i am copying from my working former app that using Firebase Messaging, change app package, create firebase project, testing the app but token never receive nor the message i tested.
my FirebaseMessaging
the logs always show "waiting" no matter how long i wait, any tought?
i am copying from my working former app that using Firebase Messaging, change app package, create firebase project, testing the app but token never receive nor the message i tested.
my FirebaseMessaging
FirebaseMessaging:
Sub Process_Globals
Private fm As FirebaseMessaging
Private sql1 As SQL
End Sub
'Called when an intent is received.
'Do not assume that anything else, including the starter service, has run before this method.
Private Sub Receiver_Receive (FirstTime As Boolean, StartingIntent As Intent)
If FirstTime Or fm.IsInitialized = False Then
fm.Initialize("fm")
End If
sql1.Initialize(File.DirInternal,"main.db",True)
fm.HandleIntent(StartingIntent)
End Sub
Public Sub SubscribeToTopics
Log("subs topic")
fm.SubscribeToTopic("sigi_sispeg_broadcast") 'you can subscribe to more topics
Do While fm.Token = ""
Log("waiting")
Sleep(1000)
Loop
Log(fm.Token)
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
If checkTableexist("pesan") Then
Dim logo As Bitmap = LoadBitmapResize(File.DirAssets, "single-icon.png", 24dip, 24dip, True)
Dim n As NB6
n.Initialize("default", Application.LabelName, "HIGH").SmallIcon(logo).AutoCancel(True)
Dim cs As CSBuilder
n.BigTextStyle(Message.GetData.Get("title"), cs.Initialize.BackgroundColor(Colors.Red).Append("").PopAll,Message.GetData.Get("body"))
n.Build(Message.GetData.Get("title"), "", "tag",pesan).Notify(1)
sql1.ExecNonQuery2("insert into pesan (judul,isi) values (?,?)",Array As Object(Message.GetData.Get("title"),Message.GetData.Get("body")))
End If
End Sub
Sub fm_TokenRefresh (Token As String)
Log("TokenRefresh: " & Token)
End Sub
Public Sub checkTableexist(tbname As String) As Boolean
Dim rset As ResultSet = sql1.ExecQuery2("select name from sqlite_master where name=?",Array As String(tbname))
Dim hasil As Boolean
If rset.RowCount > 0 Then
hasil = True
Else
hasil = False
End If
rset.Close
Return hasil
End Sub
the logs always show "waiting" no matter how long i wait, any tought?