Get data from a postback url

Hello guys I need help with this postback url how to get the data from it everytime the data sent to it. i can replace the {uid} with the id of users in my app but how to get the amount {virtual_currency} from it is the problem cuz there is no way to know the offer amount completed by the user .

anyways i don’t have much experience in this if anyone could help i’ll really appreciate it

https://bee-coin.000webhostapp.com/postbacks/test.php?user_id={uid}&amount={virtual_currency}


Like this?

actually the parameters {uid} and {virtual_currency} will be filled with values when the user complete an offer so we don’t know the values , the postback we get will tell us the values

test.php file


<?php

$json = new stdclass();
$json->userid = $_GET['user_id'];
$json->amount = $_GET['amount'];

print_r(json_encode($json));
die;

?>

Blocks

blocks

/Enjoy

1 Like

So this is the url we get the data from :

[[https://bee-coin.000webhostapp.com/postbacks/test.php?user_id={uid}&amount={virtual_currency}

And when the postback is sent from a third partie the values {uid} and {virtual_currency} will be replaced with values we don’t know depends on the user id who completed the offer and the offer amount that can be different each time so my question is in the block “set web url to” what should we write there?

use the join block to join parts of the url and the values, which have been probided for example in textboxes

join https://bee-coin.000webhostapp.com/postbacks/test.php?user_id=
     Textbox1.Text
     &amount=
     Textbox2.Text

A very good way to learn App Inventor or Kodular is to read the free Inventor’s Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps … the links are at the bottom of the Web page. The book ‘teaches’ users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Tutorials for MIT App Inventor to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun

1 Like