Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Subscription In-App Purchase to Safari Web Extension

I have created a Safari Web Extension, now I want to add Subscription In-App Purchase into this app.

Since the Safari Web Extension has two parts: the Mac App and the Extension.

I want to ask can I add the IAP codes into the Extension part? So, the Extension can be programmatically enabled or disabled according to the latest subscription status.

like image 278
RRN Avatar asked Dec 19 '25 09:12

RRN


1 Answers

You can send conditions from macOS app to their safari extension javascript executing file via SFSafariApplication.dispatchMessage

Send Messages from the App to JavaScript macOS https://developer.apple.com/documentation/safariservices/safari_web_extensions/messaging_between_the_app_and_javascript_in_a_safari_web_extension

but for iOS there note "You can’t send messages from a containing iOS app to your web extension’s JavaScript scripts."

So I'm looking solution right now how to end status ON/OFF to extension javascript file to toggle it depend on subscription status. It's strange how apple want us developers to monetize our extensions?

like image 191
Artem Sherbachuk Avatar answered Dec 22 '25 02:12

Artem Sherbachuk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!