Just starting to learn and implement our server for sending push notifications in C#
I read following: Apple Push Notifications in Bulk
I also checked push-sharp and MoonApns projects for code reference.
Both projects use version "1" of message.
Apple has new format (2) here:
I don't have reference to v1 to compare but by looking online it seems like they added ability to send "batch" of messages at one time. So, we don't have to send each notification one by one, we instead can send packs..
Being new and overwhelmed with all this as it is I wonder if I should try and deal with v2?
ItemId is not the identifier of the notification. It identifies the type of the Item (1 for device token, 2 for payload, 3 for notification identifier, 4 for expiration data and 5 for priority). Therefore it has no effect on the number of messages sent in one batch.
If message 50 has an error, you have to resend messages 51 - 100.
I haven't tried to use this new format, and I'm not sure what it's good for. It adds the notification priority, which didn't exist in the previous format, but if you don't need that, you can stick with format 1.
BTW, from the current documentation it's unclear how you are supposed to batch notifications using the new format.
A single frame must include (at least) all the items of a single notification (i.e. device token, payload, message ID, expiration and priority), unless some of them are optional (which is not specified in the documentation).
But if you include only one notification in a frame, you don't batch anything. If you attempt to include multiple notifications in a single frame, it is not clear how the frame would be interpreted. The need to specify the item type for each item implies that the order of the items doesn't matter (unlike formats 0 and 1 in which it did). So if, for example, you decide to batch two notifications in the same frame, you'll have two notification IDs and two device tokens in the same frame. In this case, it's not clear which device token relates to which notification ID (unless the order does matter). Perhaps that format is an intermediate format that would be extended later on to allow sending a single payload to multiple device tokens (which will allow you to specify the payload once for multiple device tokens). That would be useful.
Formats 0 and 1 are specified here.