Onesignal-ios-sdk: Linking against a dylib which is not safe for use in application extensions

Created on 9 Aug 2018  路  12Comments  路  Source: OneSignal/OneSignal-iOS-SDK

Description:

Hi,

it is a bit odd that configuring OneSignal requires an app extension and _OneSignal.framework_ is not app extension safe...

Environment

Xcode 9.4.1, integrating using Carthage 0.30.1 using Carthage integration guide

Steps to Reproduce Issue:

  • create new project

  • integrate using Carthage
  • Anything else:
    screen shot 2018-08-09 at 12 40 12

    Medium Priority

    Most helpful comment

    We're now working on a PR to fix this issue. Unfortunately it will need to be a breaking change so it will need to wait until our next major release (3.0)

    Essentially we are splitting out extension-specific functionality into a separate (smaller) framework

    Here is the current state of the PR: https://github.com/OneSignal/OneSignal-iOS-SDK/pull/427

    All 12 comments

    Our SDK doesn't use any extension-unavailable code in the extension service, so your app wouldn't get rejected. But the warning is certainly annoying.

    You can also use Cocoapods, or link directly against our static binary, which would also get rid of the error, but neither of these things are necessary.

    Eventually in the future I will look into either splitting out the extension-specific functionality into its own separate library, or I'll look into other approaches.

    +1

    We're now working on a PR to fix this issue. Unfortunately it will need to be a breaking change so it will need to wait until our next major release (3.0)

    Essentially we are splitting out extension-specific functionality into a separate (smaller) framework

    Here is the current state of the PR: https://github.com/OneSignal/OneSignal-iOS-SDK/pull/427

    @Nightsd01 is there an existing branch with this fix? And what do you mean by or link directly against our static binary What does that mean?

    @otymartin The static OneSignal framework can be found here:
    https://github.com/OneSignal/OneSignal-iOS-SDK/tree/master/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework

    The PR #427 noted above just splits out the Notification Extension Service specific part of the SDK into its own target to make it smaller and to fix any warnings about APIs being referenced that are not available in that target. I don't believe it would fix the dynamic linking warnings.

    Ahh I see - so the warnings are here to stay until 3.0.0?

    Correct, it requires APPLICATION_EXTENSION_API_ONLY to be set in the Xcode project to fix the warning. However we can't do this until SDK is split into modules as I believe it would result in compiler errors otherwise.

    @JKalash So what do I set it to NO or YES and on what the OneSignal pod? or the Extension target? Or my apps main target?

    @otymartin It would be on the "OneSignal" framework project itself, like the following.
    https://stackoverflow.com/a/48863451/1244574
    Again it will most likely create a compile issue as it is the same code base for the main target and the extension.
    Also the "not safe" warning is present since it doesn't know if it is referring to any APIs it can't use. However OneSignal has runtime guards so there isn't any real issues.

    @JKalash Ok, although I hate seeing warnings I can live with. it knowing it won't affect the actual push delivery and App Store review process.

    Thanks

    @jkasten2 is this problem fixed?

    @jkasten2 is this problem fixed?

    @otymartin Unfortunately this issue is not simple to fix since it requires having a separate SDK for the App target and the notification service extension target with no shared symbols. We are still looking into a fix for this.

    Was this page helpful?
    0 / 5 - 0 ratings

    Related issues

    ogres picture ogres  路  3Comments

    brunodelgado picture brunodelgado  路  3Comments

    arthurdapaz picture arthurdapaz  路  5Comments

    chmiiller picture chmiiller  路  6Comments

    appcelerate picture appcelerate  路  3Comments