Skip to content

Warning that may cause rejection on Apple's app review appears when using lib on an app extension #119

@adrianod1as

Description

@adrianod1as

I am using NVActivityIndicatorView on a Today Extension, and I get the following warning:

ld: warning: linking against a dylib which is not safe for use in application extensions: /{path}/NVActivityIndicatorView

It seems such warning may cause rejection on Apple's app review. In Apple Documentation https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html:

Make sure your embedded framework does not contain APIs unavailable to app extensions, as described in Some APIs Are Unavailable to App Extensions.If you have a custom framework that does contain such APIs, you can safely link to it from your containing app but cannot share that code with the app’s contained extensions. The App Store rejects any app extension that links to such frameworks or that otherwise uses unavailable APIs.

In this lib's case, I believe this happens because of the use of UIApplication, which is not available for app extensions.

I did some research and according to some github/stackoverflow users, it can be fixed by changing the "Require Only App-Extension-Safe API" build setting to Yes on the framework target.

To configure an app extension target to use an embedded framework, set the target’s “Require Only App-Extension-Safe API” build setting to Yes. If you don’t, Xcode reminds you to do so by displaying the warning “linking against dylib not safe for use in application extensions”.

However, if this doesn't work, it may be necessary to remove the use of APIs unavailable to App Extensions.

Could you please look into it? Soon I will be submitting the app to App Store, and I would like to continue using your lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions