1

I've setup server-to-server notifications for in app purchases for iOS. I'm receiving the http posts successfully, but the request.body does not include all the expected fields as described here.

The only fields I'm getting are latest_receipt or latest_expired_receipt, depending on the subscription status. When I decode those fields from base64 I'm getting the receipt, which is good, but I need to see other fields in the request such as notification_type, environment, etc. The notification_type is particularly important since I need to know if a subscription is expired or renewed. Am I not getting all the fields because the environment is Sandbox? Should I expect something different in Production?

mahal tertin
  • 3,239
  • 24
  • 41
pyetti
  • 188
  • 2
  • 14

1 Answers1

2

We are using server to server notifications just like you and we have no issues on both sandbox&production environments. I just checked. We do receive latest_receipt or latest_expired_receipt and all other fields including notification_type.

But notification_type and other fields are not inside latest receipt, they are in the same JSON level as latest receipt key.

apphud
  • 625
  • 4
  • 8
  • Thanks @apphud. It was my mistake. I was printing the request body to the console, but for some reason it wasn't printing all the fields, so I assumed the fields weren't sent. They seem to all be there. – pyetti Sep 25 '19 at 17:38
  • Also @apphud, I'm reading your article (https://blog.apphud.com/subscriptions-notifications/), and yeah, this implementation of S2S Subscription Notification by Apple is just not good at all. I'm debating even offering subscriptions for iOS users. It's much, much easier on Android. – pyetti Sep 25 '19 at 19:53
  • @pyetti fell free to use our service for managing subscriptions, if you like it. – apphud Sep 26 '19 at 18:07