Android Question user don't receive message when send FCM (user subscribe topic using FirebaseMessaging.Token)

nickysuwandi

Member
Licensed User
Longtime User
Dear All

I have problem when send FCM message to user when use listen using FirebaseMessaging.Token

My program have no problem when sending to "test", "all" .

There anyone experience with this problem

Androidpushnotif.vb:
Imports Newtonsoft.Json
Imports System.Net
Imports System.Text
Public Class AndroidPustNotif
    Private urlToPost As String = ""
    Private urlkey As String = ""
    Public Sub New(ByVal urlToPost As String, ByVal urlkey As String)
        Me.urlToPost = urlToPost
        Me.urlkey = urlkey
    End Sub
    Public Function postData(ByVal dictData As Dictionary(Of String, Object)) As Boolean
        Dim webClient As New WebClient()
        Dim resByte As Byte()
        Dim resString As String
        Dim reqString() As Byte
        Try
            webClient.Headers("content-type") = "application/json"   ';charset=UTF-8
            webClient.Headers.Add("Authorization", "key=" & Me.urlkey)
            reqString = Encoding.Default.GetBytes(JsonConvert.SerializeObject(dictData, Xml.Formatting.Indented))
            resByte = webClient.UploadData(Me.urlToPost, "post", reqString)
            resString = Encoding.Default.GetString(resByte)
            Console.WriteLine(resString)
            webClient.Dispose()
            Return True
        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try
        Return False
    End Function
End Class
 

nickysuwandi

Member
Licensed User
Longtime User
Thanks Erel, for you quick respon.

I try using B4j to send message,message don't arrived because i am subscipt to wrong topic.

Thanks for you help,i have solve my problem
 
Last edited:
Upvote 0
Top