I’m working to integrate with Apple Wallet to show passes. I have everything working but am stumped on one issue.
My application is lambda with nodeJS, dynamodb, and API gateway secured with Cognito. There are many rest APIs to update and access resources in the application.
For an integration with Apple, to update a pass on a user’s phone, Apple will call an API in the application and expects a binary payload in the response. The payload is returned by API Gateway in Base 64 encoding.
I have set the binary media types and am returning the correct Content-Type.
binaryMediaTypes:
- ‘image/png’
- ‘application/vnd-apple.pkpass’
When I invoke my request in Postman with the header Accept: ‘application/vnd-apple.pkpass’ API gateway returns the accurate binary data.
The challenge is that Apple is invoking the API with Accept: ‘/’.
What are my options with serverless to solve for this endpoint? When I add binaryMediaTypes / then all my json payloads are encoded which doesn’t seem useful.
I’m not sure how to setup http proxy for this endpoint using serverless but I suspect that’s maybe what I have to do so that I can set the CONVERT_TO_BINARY option. Is this possible to setup in my serverless.yml file?