paid (subscription-based) safari app extension - how to check in JS part that user is premium?

Hello,

We are developing non-free safari app extension.

How JS part should know that user is premium?

  1. use our backend server and fetch is_preium status from there?
  2. App part (coded in Swift) checks whether user is premium and tells extension to enable/disable its functionality.

In case of 2, if we have a daily subscription, how JS part should know that subscription is over? Is asking user to run the app every day (so it checks premium status and sends it to JS part) is the only way to go?

May be there are some examples of Safari app extensions that are subscription-based?

Thank you in advance for your answers!

We can send is_premium status from macOS app to javascript via SFSafariApplication.dispatchMessage.

Send Messages from the App to JS is possible https://developer.apple.com/documentation/safariservices/safari_web_extensions/messaging_between_the_app_and_javascript_in_a_safari_web_extension but for iOS there is a note "You can’t send messages from a containing iOS app to your web extension’s JavaScript scripts."

So what should we do for iOS extension? Forget using in-app subscriptions and turn that safari app extension to paid?

paid (subscription-based) safari app extension - how to check in JS part that user is premium?
 
 
Q