splitio / ios-client

iOS SDK client for Split Software
https://split.io
Other
11 stars 18 forks source link

Make package extension safe #465

Closed Jeff-Meadows closed 1 year ago

Jeff-Meadows commented 1 year ago

iOS SDK

What did you accomplish?

The Split SDK is marked as unsafe for use in app extensions, which is unfortunate, because we need feature flags there, too!

However, the only reason for this seems to be that background sync is unavailable for use in extensions, and developers need to manually call SplitBgSynchronizer.shared.schedule() anyway (which is the only public method that uses the BG sync methods unavailable in extensions).

So this PR just marks that method as unavailable to extensions, which allows marking the SDK as safe for use in app extensions.

How do we test the changes introduced in this PR?

Build the SDK.

Extra Notes

It's probably worth updating the public docs that SplitBgSynchronizer.shared.schedule() can only be called from the main application. This was already true, since doing so would probably crash any extension that called it, but now that will be caught by the compiler.