My server needs to send an Apple Push Notification with an alert that goes something like, “Your driver will arrive at 2:45pm.” It would be nice not to have to pull the user’s time zone and time formatting preferences up to the server, and instead just pass some kind of universal point-in-time indicator (e.g. epoch seconds or UTC timestamp) and have the iOS device turn that into a timestamp in the user’s preferred format.
Is this possible?
Short answer – generally ‘no.’ Here is the Apple documentation:
Since your application would generally not be running, you don’t get a chance to interpret the contents of the APN package. If however, you do expect to only get APNs when running, then you do have a chance to do application specific actions.
Noting – you also have the issue of the user’s language. You’ve currently selected English for “Your driver …”
The typical approach is to record the user’s timezone and language (and other locale information) on your server, usually at the time of registration. Then, when your server generates the APN it customizes it for the user’s locale.