0

I am trying to add an in game currency to my swift/spritekit game, you wont be able to buy it. It has not monetary value, so if people crack it, it wouldnt be the end of the world.

However I dont wanna make it too easy I.E. NSUserDefaults. Is there a way to do this more securely? game center? iCloud? not sure the protocol here.

Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
  • 1
    What's the problem with using `NSUserDefaults`? On a non-jailbroken iOS device, the user has no way of accessing the user defaults. Even someone with a developer licence can only change them for their own apps. – Linuxios Jan 20 '15 at 16:42
  • 1
    If you really want to be "more secure" than vanilla `NSUserDefaults`, you could use `NSUserDefaults` with a benign key like `NotYourMoney` and then do a simple reversible hash to obscure it. – Ian MacDonald Jan 20 '15 at 16:43
  • 1
    I read theres ways to get to it, even un-jailbroken. I think vanilla will be fine, just wanted to see if there was a standard way, that I was overlooking. – plaidpancakes Jan 20 '15 at 17:14
  • Put the value in some kind of class and archive it (in user defaults or as a file). Just my 2 cents ;) – HAS Jan 20 '15 at 17:59
  • also: http://stackoverflow.com/questions/12525474/nsuserdefaults-or-keychain-is-better-to-save-username-and-password-in-iphone-app – Gabriele Petronella Jan 20 '15 at 20:48

0 Answers0