Ad Reward System with Server-Side Verification (SSV) Android
- Description
- Curriculum
- FAQ
- Reviews
Ad Reward System with Server-Side Verification (SSV):
Embark on a journey to enhance your Android app’s functionality and revenue potential with the “Ad Reward System with Server-Side Verification (SSV)” course. This course will guide you through implementing a robust ad reward system with server-side verification for security and compliance. You’ll learn to integrate these features seamlessly into your Android application, leveraging industry-leading tools like Admob, Google’s User Messaging Platform (UMP), and MongoDB Atlas. With step-by-step guidance, you’ll configure reward ads, optimize performance, and navigate the complexities of the European Consent Policy. MongoDB Atlas will empower you to create and manage a robust database, ensuring scalability and security. Master the implementation of server-side verification to fortify your app against fraud and ensure fair reward distribution. Throughout the course, you’ll have access to downloadable resources and a supportive community forum. Enroll now to elevate your app’s monetization strategy and user engagement while upholding security and compliance standards!
-
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;
}
};