I’m not sure I understood you correctly, please correct me if I’m wrong.
If you want to update a user record, I think after calling the block with custom code, you can add a Save Object in Backendless block and update the user with their objectId.
Or is the problem something else?
2- the custom code executes and displays a Google Pay UI for the user to subscribe to my service using an in-app payment
4 - when i know the user has completed the in-app payment process, I update the database so they are shown the content for a subscribed user
After executing the custom code in step 2 I don’t know if the user has completed the payment process or not, so I can’t update their record at that point, otherwise any user that does not complete payment will still access subscriber content.
As I understand it, the gonative.iap.purchase function will be executed in the second step.
I couldn’t find information about what this function returns in the documentation, but it’s possible it returns information about whether the operation was successful. Based on that information, you could decide to update the record in the database.
I meant that you can assign the result of the function execution to a variable within the custom code block and inspect its content.
I have a guess as to how this works, but you’ll need to create a test page with minimal logic required for testing and test data for logging in (if needed).
I think, it would be better if you create a testing page because, upon further examination of your question, I doubt that the proposed option will work. I am more inclined to believe that gonative.iap.purchase, after succeeding, will simply call gonative_iap_purchases and not return anything.
I hope you can help with a related query, that will then allow me to test the solution you have provided above.
If the function is called by the app when the page loads, does the console.log mean that it will return the data in a way that can be accessed through UI Builder? Or do I need to do something else to access it?