Android Question Error while trying to execute code

Makumbi

Well-Known Member
Licensed User
B4X:
    Dim Job As HttpJob
    Job.Initialize("fcm", Me)
    Dim m As Map = CreateMap("to": $"/topics/${Topic}"$)
    Dim data As Map = CreateMap("title": Title, "body": Body)
    m.Put("data":data)
    Dim jg As JSONGenerator
    jg.Initialize(m)
    Job.PostString("https://fcm.googleapis.com/fcm/send", jg.ToString)
    Job.GetRequest.SetContentType("application/json")
    Job.GetRequest.SetHeader("Authorization", "key=" & API_KEY)
error code

B4X:
B4J Version: 7.32
Java Version: 8
Parsing code.    (0.01s)
Building folders structure.    (0.01s)
Compiling code.    Error
Error compiling program.
Error description: ',' expected.
Error occurred on line: 23
m.Put("data":data)
Word: :
 

jimmyF

Active Member
Licensed User
Longtime User
Upvote 0

jimmyF

Active Member
Licensed User
Longtime User
Upvote 0
Top