Sure thing =)) Thanks…
function SendJson(url, action, in\_json, callback) local headers = {} headers["Authorization"] = "Basic " .. "XXXXXXXXXXX" headers["Content-Type"] = "application/json" headers["Accept-Language"] = "en-US" local params = {} params.headers = headers params.body = json.encode( in\_json ) network.request ( url, action, callback, params ) end function skickaPush ( event ) myApp.settings = loadsave.loadTable("settings.json") local finalPush = "ID:" .. myApp.settings.userId .. ": " .. pushMsg --[[b64 encoding local function \_b64enc(data) local len = data:len() local t = {} for i=1,len,384 do local n = math.min(384, len+1-i) if n \> 0 then local s = data:sub(i, i+n-1) local enc, \_ = mime.b64(s) t[#t+1] = enc end end return table.concat(t) end encodedPush = \_b64enc(pushMsg) --]] local function networkListener( event ) if ( event.isError ) then print( "Network error!") audio.play( myApp.soundTable["fallAndSplat"] ) local ooopsAlert = native.showAlert( "Ooops", "Push ej skickat, vänligen kontrollera nätverksinställningarna eller försök igen", { "OK" } ) else print ( "RESPONSE: " .. event.response ) audio.play( myApp.soundTable["hahaha"] ) myApp.titleText:morphText( "Ditt medelande är skickat!" , 2000) end end local jsonToSend = {["app\_id"] = "XXXXXXXXXXXX", --["headings"] = {["en"] = fromText}, ["contents"] = {["en"] = finalPush}, ["isAndroid"] = true, ["isIos"] = true, --["included\_segments"] = "All" --["wp\_sound"] = "CartoonHop.wav", ["data"] = {{["abc"] = "123", ["foo"] = "bar"}}, ["tags"] = {{["key"] = "iFreduser", ["relation"] = "=", ["value"] = tillId}}, } loadsave.saveTable(jsonToSend, "send.json") SendJson("https://gamethrive.com/api/v1/notifications", "POST", jsonToSend, networkListener) end