Django Admob Server-Side Verification (SSV)
A Django app providing a view that handles Admob Server-Side Verification callbacks. Successfull verifications trigger a custom signal. Separate apps may listen to that signal and reward the user based on the information received via the callback.
Taken from the Admob SSV documentation:
Server-side verification callbacks are URL requests, with query parameters expanded by Google, that are sent by Google to an external system to notify it that a user should be rewarded for interacting with a rewarded video ad. Rewarded video SSV (server-side verification) callbacks provide an extra layer of protection against spoofing of client-side callbacks to reward users.
Requirements
Installation
pip install django-admob-ssv
Configuration
- Add a
pathfor thedjango_admob_ssv.views.admob_ssvview to yoururlpatterns.
from django.urls import path
from django_admob_ssv.views import admob_ssv
urlpatterns = [
path('admob-ssv/', admob_ssv),
]
- Listen to the
django_admob_ssv.signals.valid_admob_ssvsignal.
from django.dispatch import receiver
from django_admob_ssv.signals import valid_admob_ssv
@receiver(valid_admob_ssv)
def reward_user(sender, query, **kwargs):
ad_network = query.get('ad_network')
ad_unit = query.get('ad_unit')
custom_data = query.get('custom_data')
# ...
Take a look at this list of all SSV callback parameters.
Also make sure you connect your receiver properly, otherwise it won't get called. (Take a look at the "Where should this code live?" box).
Examples
Take a look at the "Configuration" section above and the provided example_project.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-admob-ssv-1.0.2.tar.gz.
File metadata
- Download URL: django-admob-ssv-1.0.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80b13efeb2d8064ab31d4da2081c9ffc0128235c8884f3e7db95ee63fe928a33
|
|
| MD5 |
0984e7cfa0fc5ad9225a358d6f6841b5
|
|
| BLAKE2b-256 |
f53aeba46ff9a7786d2595e7a17de4eb72e7fa021d669ab26116030bdd95f493
|