How can I use In-App Purchase with only a webwiever?

APPLE TEAM :
if your app allows users to access digital features that are unlocked via an external subscription, the subscription should still be available to purchase in the app by using the in-app purchase API.

with your new submission: Paid digital subscription features should be made available behind in-app purchase.

I added 1 product In-App purchase but it’s not enough

2 Likes

Hi @mephjl Can you please rephrase your title as a question, and provide a question and some context in your post. This is unclear and it’ll be hard for people to help. See the linked post for more information.

3 Likes

Hope now is good, excuse me.

2 Likes

See the pics.
Is that how to do it or am I doing it wrong?


1 Like

If you are the owner of the website, you can inject a script that allows you rpage to speak to the webviewer and pass strings back and forth. In this manner, you could trigger a workflow from within your webpage, to the webviewer, that kicks off an in app purchase.

I dont have any examples at the ready of this but I know they do exist. You could do some searching for Henry (the name of a webWrapper template that uses thunkable to wrap bubble apps). That app allows for IAP i believe, though I don’t know that it’s open tot he public. You could try reaching out to its creator too.

There are plenty of examples here in the forum of how to pass messages back and forth with the webviewer. And here is the github to get you started!

2 Likes

I try

1 Like

thunkableWebviewerExtension.js is simple to use, but I don’t understand what should I send and from where to where. Maybe the name ? Maybe ID ? What ?
I still don’t understand if in the extension in thunkable I was right to put the name of the subscriptions created in the store.
Please help me

1 Like

Am I at least on the right way?

1 Like

This is by no means the only way but this might help you get started.

At a high level overview:

You’d pass a message to the app to initialize a purchase. When the purchase is complete, pass the error or success message back to the webapp for further processing.

Hopefully this makes sense. If not, It should make more sense once we release the iap docs (they’re close to done!)

<body>

<button 
onClick=buy1time(this.getAttribute(“productID”) )
id=“purchaseButton1” 
productID=“productId”> 
click here to buy
</button>

<script src=“/thunkableWebviewerExtension.js”>

const buy1time = (productId) => {

ThunkableWebviewerExtension.postMessage('productID');

}

const passBackPurchaseInfo = (purchaseObject) => {
//more logic would go here related to saving the purchase info
}

ThunkableWebviewerExtension.receiveMessage(function(message) {
     passBackPurchaseInfo(JSON.parse(message)
    });



</script>
</body>
2 Likes

So the variable passed in, must be the product ID, not the name. Thank you.
And the blocks are right ?
I setted iap variable to message (product ID now), and setted IAP to it. Right ?

This wasn’t a guide as to how to implement in your app specifically. More of an intro to how it could be completed.

My English is so bad, but i need set in-app purchases for my app, so you can make a video step by step about this function, please!!

1 Like

This could be your first step.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.