-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Crash on FBSDKAppLinkNavigation #1596
Comments
I'm trying to work out what UI is being called from a background thread since the I think it might have to do with how you're using
According to the Apple Docs:
Can you confirm that you are calling the restoration handler on the main thread? |
Yes I can confirm that. As I mentioned, my suspicious is that the issue is inside the completion handler of Taking a look at the code, that handler is called as a completion handler of an |
Summary: Thanks for proposing a pull request! To help us review the request, please complete the following: - [x] sign [contributor license agreement](https://developers.facebook.com/opensource/cla) - [x] I've ensured that all existing tests pass and added tests (when/where necessary) - [x] I've updated the documentation (when/where necessary) and [Changelog](CHANGELOG.md) (when/where necessary) - [x] I've added the proper label to this pull request (e.g. `bug` for bug fixes) ## Pull Request Details It should solve this crash #1596 (comment) Pull Request resolved: #1597 Test Plan: **Add your test plan here** Reviewed By: jingping2015 Differential Revision: D25589734 Pulled By: joesus fbshipit-source-id: 5d54caaf2d3eb3a63510fa28a3077416cd662f39
I updated to master branch, now I can facing another crash invoking the same method, but now the class involved is In particular there is a missed check inside this method
that makes the app crash because of
|
This fix looks reasonable enough. Can you share a little more about the use case here? I'm trying to sort out how to test the fixes. Is it accurate that you're handling a universal link, extracting app link data out of the metadata from that universal link, and that the metadata includes a |
Yes it is correct, it is exactely what I'm trying to do. Unfortunately I can't share with you the link(s) that I'm using, btw this issues started for me when moved from the old Bolt framework to this one integrated in CoreKit |
Summary: Thanks for proposing a pull request! To help us review the request, please complete the following: - [x] sign [contributor license agreement](https://developers.facebook.com/opensource/cla) - [x] I've ensured that all existing tests pass and added tests (when/where necessary) - [x] I've updated the documentation (when/where necessary) and [Changelog](CHANGELOG.md) (when/where necessary) - [x] I've added the proper label to this pull request (e.g. `bug` for bug fixes) ## Pull Request Details It should solve this crash #1596 (comment) Pull Request resolved: #1624 Reviewed By: dreamolight Differential Revision: D26103826 Pulled By: joesus fbshipit-source-id: 3589b6b610b65e9a14506e15980aca1a8f93bd85
This fix should make it into the next patch release. Thanks for the help! |
Checklist
Environment
Xcode Version: 12.2
Swift Version: 5.3
Installation Platform & Verison: Swift Package
The crash happens on all Facebook iOS 8.x.x SDK versions.
Steps to Reproduce
I'm facing into a crash when invoking
+ (void)resolveAppLink:(NSURL *)destination handler:(FBSDKAppLinkBlock)handler
of
FBSDKAppLinkNavigation
classI use it inside
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler
of my app delegate class in this way
[FBSDKAppLinkNavigation resolveAppLink:userActivity.webpageURL
handler:^(FBSDKAppLink * _Nullable appLink, NSError * _Nullable error) {
Every time the method is invoked, it makes the app crash, below the log, hoping it could be useful
I installed FacebookCore SDK via swift package (actually 8.2.0 version), so I was able to navigate into the code, and I saw that this crash happens in the line number 167 of
FBSDKWebViewAppLinkResolver
class, specifically when try to initialize anMKWebView
inside the method- (void)appLinkFromURL:(NSURL *)url handler:(FBSDKAppLinkBlock)handler
..
..
WKWebView *webView = [[WKWebView alloc] init];
(line 167)At the very beginning of the method I can see those lines
dispatch_async(dispatch_get_main_queue(), ^{
[self followRedirects:url handler:^(NSDictionary<NSString *,id> *result, NSError * _Nullable error) {
IMO I think that
followRedirects:url
are not responding on main thread, so maybe puttingdispatch_async(dispatch_get_main_queue(), ^{
inside the
followRedirects:url
handler, could solve it.Anyone else with the same issue?
The text was updated successfully, but these errors were encountered: