iOS content block extension with renewable subscription

143 Views Asked by At

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?

1

There are 1 best solutions below

2
jscs On

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.