Reputation: 134
This may seem like a typical google question but after spending an hour reading various stuff, I am way more confused than I hoped to be.
I am in the middle of developing a game and I have a bunch of data, which is better off being stored inside a database (information regarding monsters such as level sprites ect). Now I also want to have in app purchases later and from what I read firebase is a good way to store inapp purchase information (which user has acquired what, highscore ect.).
Please correct me if I am wrong: All the informations regarding monsters ect. should also be stored inside a database, best case inbuilt app database. For that I planned to use sqllite or core data. I assume that since firebase is cloud based, it is not smart to load data from there just to start a game as a user would always have to be connected to it. (again please correct if wrong)
Anyways I plan to use sqllite or core data to store game information inside the app so that no user can modify it. For data such as high score in app purchases ect. I plan to use firebase.
So my question would be am I on the right track or is everything I said rubbish and there is a better way...
Help is appreciated thank you very much.
Upvotes: 0
Views: 62
Reputation: 5085
For the In app purchase I recommend using this library: https://github.com/kishikawakatsumi/KeychainAccess The data will not get lost even if a user deletes your app and then downloads it again. It is handy to store buying info in keychain access, since a user won´t need to click the restore purchase button to get what he has bought before (if he deletes the app at some point).
import KeychainAccess
let keychain = Keychain(service: "com.myservice.myapp")
//when a user buys call this:
self.keychain["hasBoughtAcceess"] = "yes"
//to check if user has bought:
if(self.keychain["hasBoughtAccess"] == "yes") {
print("user has bought")
}
else {
print("user has not bought")
}
Upvotes: 1