Adding Subscription In-App Purchase to Safari Web Extension

Viewed 173

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.

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?

Related