Q:

How do they implement reward system in apps/games?

If you noticed, there are more and more apps which are free, but in there they have some kind of currency (gold, fake money, etc.) which you can either buy or earn for free. I am interested in this free earn system. 
Namely, you get a popup like "Download and start app XY and you'll earn 5 gold coins". So I download the app and runs it once, then I switch back to app and I immediately receive 5 gold points. 
Is there some rewarding system they use or each implements its own?
If they implement their own, how do they check if XY app has been installed ans started? 
The way I see it, if I am to implement this on my own, then I contact the owner of XY app and ask him to implement a sample code in the splash of his app/game. When his app is started it send OK flag to my online database. Another service immediately pushes notification to my app and the app know that some user installed and started XY app. But I do not know what should I do in case there is no internet connection during first-launch of XY app?

A:

You don't need an Internet connection; you can just check the list of installed applications, as described here. 

