Android Question In-app subscription to Server

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I am currently have a B4J server running and my B4A app is connecting to my B4J server to receive data from it.

The customer can also use a web browser on there computer and view the same data from it.

For the user to access this data from the server, the user must pay a monthly fee.

The server also sends push notifications to my B4A app and if the user doesn't pay there monthly fee I want the B4J app to stop sending the push notifications etc.

I have been using in-app purchases in my B4A app, and when the payment is successful in the B4A app it will send something to my B4J server say the payment was successful and allow the user to access the data on the server.

If the user doesn't pay there monthly fee I want to stop them from accessing the server and not allow the push notifications from being sent to the app.

The above is easy enough to be done from an in-app purchase, since when the payment is made it can let the server know.

The above is fine and I have that working.

However, I was looking at using in-app subscriptions so it automatically charges the customer, so the customer doesn't have to remember to pay the monthly fee. I understand how to use in-app subscriptions (since its similar to in-app purchases)

But I am not sure how my B4J app is going to detect that this payment (subscription payment) was successful since it seems to happen in the background on Google Play. (eventually I will need to do this with my B4i app)

I know I could get the app to check if the payment was successful next time they open the B4A app and then send the message to my server to say the charge was successful, but if the customer doesn't open the app for a few months, then my B4J app will never know about this payment and my B4J app won't know if it is allowed to grant the customer to use the web interface or my B4i app to receive the data from my server.

Does anyone know how my app can tell my B4J app that the payment was successful or not from an in-app subscription ?

(It's working fine with in-app purchases but now want to use in-app subscriptions instead)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top