Hi,
I have created an iOS app using B4i, and it has in-app subscriptions in it. Using my B4J app I want to get notified when the in-app subscription changes.
In Apple Connect it has a spot for Subscription Status URL. This allows Apple to send a POST message to a server so the developer can verify the purchase when the subscription state changes.
https://developer.apple.com/library....html#//apple_ref/doc/uid/TP40008267-CH7-SW13
In my B4J app, I have added a filter but trying to work out how to read the POST message Apple sent. Reading Apples documentation it says it's a JSON message.
In my B4J app I have added the following Filter:
When Apple submits the query to my server it seems to only log the URL (req.FullRequestURI) part in my code. (I do notice it logs the URL a few times sometimes)
I am guessing I am doing something wrong some where.
(not 100% sure if the map part is correct in my code above, or if that is the correct way in reading the POST body of the request?)
I have created an iOS app using B4i, and it has in-app subscriptions in it. Using my B4J app I want to get notified when the in-app subscription changes.
In Apple Connect it has a spot for Subscription Status URL. This allows Apple to send a POST message to a server so the developer can verify the purchase when the subscription state changes.
https://developer.apple.com/library....html#//apple_ref/doc/uid/TP40008267-CH7-SW13
In my B4J app, I have added a filter but trying to work out how to read the POST message Apple sent. Reading Apples documentation it says it's a JSON message.
In my B4J app I have added the following Filter:
B4X:
Public Sub Filter(req As ServletRequest, resp As ServletResponse) As Boolean 'ignore
Log(req.FullRequestURI)
Dim postMap As Map = req.GetMultipartData(Globals.AppLocation,999999999999999)
For i = 0 To postMap.Size - 1
Log("Key: " & postMap.GetKeyAt(i))
Log("Value: " & postMap.GetValueAt(i))
Next
End Sub
When Apple submits the query to my server it seems to only log the URL (req.FullRequestURI) part in my code. (I do notice it logs the URL a few times sometimes)
I am guessing I am doing something wrong some where.
(not 100% sure if the map part is correct in my code above, or if that is the correct way in reading the POST body of the request?)