Android Question Error while trying to execute code

Discussion in 'Android Questions' started by Makumbi, Jun 6, 2019.

  1. Makumbi

    Makumbi Active Member Licensed User

    Code:
    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

    Code:
    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: :
     
  2. jimmyF

    jimmyF Active Member Licensed User

    Read what it says.
     
    lemonisdead likes this.
  3. Makumbi

    Makumbi Active Member Licensed User

    i
    it says
    Code:
    ',' expected.
    but when i put it still it doesn't proceed
     
  4. jimmyF

    jimmyF Active Member Licensed User

    What is on this line?
     
  5. lemonisdead

    lemonisdead Well-Known Member Licensed User

    Hello,
    It should be
    Code:
    m.Put("data",data)
     
    Star-Dust, DonManfred and jimmyF like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice