Search Issue Tracker
Fixed in 5.5.1
Votes
8
Found in
5.5.0f3
Issue ID
856989
Regression
Yes
[iOS] Crash in application:openURL:sourceApplication:annotation due to missing null check with Facebook SDK
App crashes in application:openURL:sourceApplication:annotation when returning from login with Facebook SDK. This occurs due to missing nil check.
Steps to reproduce:
1) Open the latest attached project.
2) Build for iOS.
3) Run on a device (connected to Internet).
4) Press 'FB.Init' UI button.
5) Press 'Login' button.
- The app will probably crash now if bundle ID is not set up with Facebook. If not - proceed.
6) If not already logged in, enter your FB credentials and login.
After logging in and returning to the app, a crash occurs in application:openURL:sourceApplication:annotation.
Manually adding nil check to UnityAppController.mm fixes the issue:
auto addItem = [&](NSString* key, id value)
{
[keys addObject:key];
[values addObject:value];
};
Needs to be changed to:
auto addItem = [&](NSString* key, id value) {
[keys addObject:key];
if (value == nil) {
[values addObject:[NSNull null]];
} else {
[values addObject:value];
}
};
This way, the crash doesn't occur.
Reproduced on:
5.6.0a6, 5.5.0f3
Did not reproduce:
5.4.3p2
Devices tested:
iPhone 7 iOS 10.2
iPhone 6+ iOS 10.0
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Inconsistent behaviour when interacting with different dropdown types with pointer events on parent Visual Element
- Hidden GameObjects won't re-enable when they have call "DontDestroyOnLoad" function
- Overlay Canvas are rendered on each split-screen camera when HDR is enabled
- [Android] The Player loses focus when using UnityEngine.Handheld.StartActivityIndicator() with Facebook SDK
- Build fails with "Building Library/Bee/artifacts/MacStandalonePlayerBuildProgram/gahcy/hj9mx3z/951.0 failed with output:..." errors when Scripting Backend is set to IL2CPP
mopsicus
Apr 04, 2017 09:03
thx FOURDESIRE, I tired while find to fix it
fourdesire
Jan 03, 2017 06:34
I temporarily fixed the issue i mentioned by
Replacing:
addItem(@"annotation", annotation);
To:
addItem(@"annotation", annotation ? annotation : @{});
in UnityAppController.mm
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation
because the annotation could be nil