- Do not make assumptions about the contents of the player identifier string. Its format and length are subject to change.
Words above are from Apple’s Game Kit Programming Guide when introducing Game Center. But I have to make at least one assumption, that is, a player identifier string can always be used as a filename in iOS. The reason is simple, I have to know which player’s data file to load once I get the player’s identifier string.
Can this be guaranteed? If not, is there any alternative that achieves the same purpose?
If you’re concerned about the player identifier string containing characters that cannot be used in a filename, the simplest thing to do would be to URL encode it first.
For example: