Ios Server-to-Server Notifications Ios Server-to-Server Notifications json json

Ios Server-to-Server Notifications


The parameters you get when you set up server 2 server notification are not exactly in the same format (or contains the same fields) as when you query verifyReceipt.

For example environment and notification_type are available only in the server 2 server notification and not in verifyReceipt.

Here is an example of the complete params you get when apple send you a notification with the server 2 server notifications -

    {    "latest_receipt": "ewoXXXXX",    "latest_receipt_info": {        "original_purchase_date_pst": "2019-07-29 21:13:18 America/Los_Angeles",        "quantity": "1",        "unique_vendor_identifier": "XXX",        "original_purchase_date_ms": "1564459998000",        "expires_date_formatted": "2019-08-06 04:13:17 Etc/GMT",        "is_in_intro_offer_period": "false",        "purchase_date_ms": "1564459997000",        "expires_date_formatted_pst": "2019-08-05 21:13:17 America/Los_Angeles",        "is_trial_period": "true",        "item_id": "1452171111",        "unique_identifier": "00000",        "original_transaction_id": "0000000",        "expires_date": "00000000",        "app_item_id": "0000000",        "transaction_id": "00000000",        "bvrs": "00000",        "web_order_line_item_id": "00000000",        "version_external_identifier": "000000",        "bid": "com.XXX",        "product_id": "XXXXX",        "purchase_date": "2019-07-30 04:13:17 Etc/GMT",        "purchase_date_pst": "2019-07-29 21:13:17 America/Los_Angeles",        "original_purchase_date": "2019-07-30 04:13:18 Etc/GMT"    },    "environment": "PROD",    "auto_renew_status": "true",    "password": "*****",    "auto_renew_product_id": "com.XXXX",    "notification_type": "INITIAL_BUY"}

Your example is from a verifyReceipt response.

The documentation is not that great about server 2 server notification but the latest wwdc video is great - https://developer.apple.com/videos/play/wwdc2019/302/

Note that quite a few of the fields in this payload are considered deprecated by now.