Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error initialising facebook v11 SDK in iOS app extension #1804

Closed
5 tasks done
SaidRs opened this issue Jul 21, 2021 · 2 comments
Closed
5 tasks done

Error initialising facebook v11 SDK in iOS app extension #1804

SaidRs opened this issue Jul 21, 2021 · 2 comments

Comments

@SaidRs
Copy link

SaidRs commented Jul 21, 2021

Checklist before submitting a bug report

Xcode version

12.5.1

Swift version

5.3

Installation platform & version

Swift Package Manager

Package

FacebookCore

Goals

Integrate facebook SDK into iOS app extension

Expected results

working facebook analytics in iOS app extension

Actual results

I have an iOS keyboard app extension, where I used to initialise facebook SDK for tracking / analytics.
After updating the SDK to the latest version, the app started to crash due to:
'As of v9.0, you must initialize the SDK prior to calling any methods or setting any properties.
After following the latest SDK changes, I was able to fix this issue in the main app by first calling ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions).
However the same can not be done in the app extension due to extensions different lifecycle, in other words in extension you don't have access to UIApplication.
I went through various solutions, but still can't make it work.

Would be great if there was a way to avoid calling ApplicationDelegate method by moving straight to Settings initialisation, which worked for me before the latest SDK changes.

Steps to reproduce

No response

Code samples & details

No response

@jamestouri
Copy link
Contributor

Resolved in #1799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@jamestouri @SaidRs and others