I just released an app for iOS and I used Revenue Cat to help with IAPs. I just found out that anyone with a jailbroken iPhone can make fake purchases that give them the "goods" without making a payment. Does Revenue Cat have a way to verify and make sure this doesn't happen?
Here is the code for when a certain is made in the app (button press):
guard let package = offering?.availablePackages[2] else {
print("No available package")
return
}
Purchases.shared.purchasePackage(package) { (trans, info, error, cancelled) in
// handle purchase
if trans?.transactionState == .purchased {
if let currentUser = Auth.auth().currentUser {
var ref: DatabaseReference!
ref = Database.database().reference()
ref.child("users/\(currentUser.uid)/score").getData(completion: { error, snapshot in
guard error == nil else {
print(error!.localizedDescription)
return;
}
let score = snapshot.value as? Int ?? 0;
let newScore = score + 100
ref = Database.database().reference()
ref.child("users").child(currentUser.uid).updateChildValues(["score": newScore])
});
}
}
}