This is a big issue and one which I've been thinking about for a while now. The trouble is I don't think there's any really foolproof method of detecting this really. The only truly foolproof method would be to verify once/each time with the apple records to check whether there is a valid purchase receipt there, but I don't know if this is even possible? Even then, this could be prone to hacking to circumvent it. Perhaps the gamecentre offers some way to work this?
As for stopping people from getting free in-app purchases - I'd recommend that you encrypt/encode any data which is stored such as an INI file. This doesn't even require an encryption extension, a simple lookup table to match obfuscated codes to products which is held as an internal array or string object would at least offer some protection. In this way, you could even check for signs of tampering. If people try to guess values in the INI file, and your program detects entries which do not match an internal list or some sort of checksum, you could upload some details such as IP address or whatever to a PHP/ASP script using the get object and even go so far as to block the application from running.
As long as you ensure this works perfectly, the only people who would have problems are those tampering with internal data files so it shouldn't cause genuine customers any issue.
I disagree with the sentiment that pirates weren't going to buy it anyway. I think there is a morality break at the moment and people don't necessarily see it as piracy if they've found it free... especially when there are ever easier ways to get hold of pirated games. As was said, if someone was on the fence then it might sway them towards not paying. You can't even guarantee revenue from pirates via advertising either, as adblocking is extremely easy to achieve on iOS and Android.
Damn pirates! D:
So, that is true what you say about INI files. But there are two different issues being discussed here...
So, what about stopping any device that also has Cydia installed from running the game?
Cydia is ONLY installed on jailbroken devices.