Currently Empty: $0.00
- Description
- Curriculum
- FAQ
- Reviews
In this course I’m gonna teach you how to implement a Reward ad/Digital Coins System in your app with a Server-Side Verification (SSV). This same approach I’ve used in my own app to allow users to earn digital coins by viewing ads. In return, users can spend those coins, to redeem certain rewards that you want to provide.
We will use:
-
Admob mobile advertising platform which is developed by Google, to display a reward type of ad in our application. We will configure it to accept a server-side verification.
-
Google’s User Messaging Platform (UMP) to handle the new European Consent Policy. Because if you don’t implement it, users from over 30 countries will be able to suspend your ads and reduce a huge amount of money that you can potentially earn.
-
MongoDB Atlas to host the database where we will store all information about the users and their digital coins. We will handle user and admin permissions, collection schemas, network access list, authentication and database triggers, custom functions and more.
-
Our own Backend Server which will be used to validate reward ads and add Coins to our users. The server itself should receive requests from the Admob SDK, when a callback fires up after a user successfully completes a task of viewing an ad. That adds an extra layer of security by processing and verifying user actions on the server rather than solely relying on client-side verification. This reduces the risk of manipulation or tampering by malicious users who may attempt to manipulate the client-side verification process to fraudulently claim rewards.
And at the end we will deploy our Backend server so that we can use it in a production as well.
Bottom line, quite interesting topic that opens the door for monetization in your app.
Authentication Screen - User Sign in Flow
Home Screen - Observe Coins
-
6Create Authentication Screen
This is a Test Ad ID that you need to add in your AndroidManifest.xml file. This is needed or otherwise you'll get a compile-time error when you launch the app:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" /> -
7Setup MongoDB Atlas & Google Cloud Project
-
8Implement Sign in with Google
-
9Persist the User
-
10Enable Sign in Prompts Dialog
-
11Authentication Trigger with MongoDB
exports = async function(authEvent) {
const user = authEvent.user;
const myUserCollection = context.services.get("mongodb-atlas").db("mydb").collection("MyUser");
try {
const existingUser = await myUserCollection.findOne({ ownerId: user.id });
if (!existingUser) {
const newUser = {
ownerId: user.id,
coins: 0,
name: user.data.firstName,
email: user.data.email,
picture: user.data.picture
};
const result = await myUserCollection.insertOne(newUser);
console.log(result)
if (result.insertedId) {
console.log(newUser)
return newUser;
} else {
console.log("Insert failed.");
return null;
}
} else {
console.log("User already exists.");
return null;
}
} catch (error) {
console.error("Error:", error);
return null;
}
};
Settings Screen - EEA Ad Consent
Ad Screen - Display a Reward Ad
Backend Server - Verify a Reward Ad & Update the Coins
How long do I have access to the course materials?
You can view and review the lecture materials indefinitely, like an on-demand channel.
Can I take my courses with me wherever I go?
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
Please, login to leave a review