Checking server-side ad viewing (php)

Viewed 38

I have an application using php backend. Let's say this is an app for cheating views on YouTube, or something else where points are very important. I want to realize crediting points for viewing ads, but don’t know how to do it. Of course, I can send a request to the server when an advertisement has been viewed,

   @Override
    public void onAdOpened() {
        if (sampleInterstitial != null) {
            //something code
        }
    }    

but I'm afraid that a person rummaging in the code of my application will easily find which request I am sending and will be able to easily emulate my requests for building up points. How can I avoid this? For example, is it possible to somehow check from the server whether an ad was viewed? Thanks for answers)

1 Answers

First of all the client cannot check the server side code , you do something like getting the ip address , time .. etc of anyone who views the ad , and inject it in a database or a file , and in this way you can know how many people did and give it credits

  • Your Php Ad page :

    $ip = $_SERVER['REMOTE_ADDR']; // gets ip address
    $time = date_default_timezone_get(); // gets time
    // insert it in your file or database
    
Related