2

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.

RRN
  • 1,127
  • 1
  • 12
  • 37

1 Answers1

1

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?

  • Have you contacted Apple support about this? – RRN Oct 14 '21 at 13:09
  • no, this is time waste and all it has I see already. The only way for me was to put the app as a paid. since for me, it was more experiment, so I go in this way. In my case, I did a youtube ad blocker extension where a javascript file did that. https://apps.apple.com/us/app/youtube-ad-blocker/id1590323175 Initially, I thought to create an app group and share conditions with the extension but still, I have no access to the javascript file. – Artem Sherbachuk Oct 15 '21 at 16:15
  • I think we need to file a feature request to Apple, so Apple will know we need this. – RRN Oct 17 '21 at 16:37
  • At this time it is still no solution? – Nikolai Nagornyi Dec 13 '22 at 04:41
  • This is why it was a poor decision for Apple to require native apps to install a browser extension and have to add needless communication back and forth to the native app. It's clearly just because Apple doesn't want to build a proper JS API for purchases (and of course we can't use our own payments system either because of the Apple tax). Super frustrating. – idolize Jan 13 '23 at 21:26