0

I’m having hard time thinking of a solution to my problem, I want to block the content blocker usability when the renewable subscription is not active, I have the related code that checks if the subscription is still active inside the app extension but it doesn’t get called only on the first launch of the extension so once the user buy one subscription it can cancel it and the app extension won’t be reloaded so it will keep block the content even when it shouldn’t.

Is there a way that I can reload the extension once the subscription is over? Or maybe reload the extension once a day?

jscs
  • 63,694
  • 13
  • 151
  • 195
DeadlyMind
  • 63
  • 4

1 Answers1

0

You can invoke SFContentBlockerManager.reloadContentBlocker(withIdentifier:) any time from your application's code, and your NSExtensionRequestHandling implementor inside your app extension will have its beginRequest(with:) called.

You can then run your subscription check and disable the content blocking rules if needed.

jscs
  • 63,694
  • 13
  • 151
  • 195
  • 1
    The reload can only be executed from my app code but the subscription can be canceled from outside the app and the content blocker won’t be reloaded, do you know of anything I can do with it? – DeadlyMind Oct 21 '17 at 20:22
  • How about always checking the subscription periodically in the app, and calling `reload...` if necessary? – jscs Oct 21 '17 at 21:14