Hi, Everything was going fine and since few days i got the following error when i tried to login to facebook on Facebook : The crash happen when the facebook popup is active and i click anywhere on this screen (login and cancel button) I'm using mobile social plugin by stan asset, i tried to update the plugin, unistall/reinstall/downgrade/upgrade facebook sdk, but i got the same error. I don't know what "Invalid identifier: 'fb_mobile_login_native_app_switch_dialog_result'. Must be between 1 and 40 characters, and must be contain only alphanumerics, _, - or spaces, starting with alphanumeric or _. " mean. What identifier are they talking about? I just fill the "app Id" field in the facebook settings. Stan asset support told me that the error is not coming from their plugin. I'm fighting with this since a week :s Thanks Using: ios 10.0.2 Xcode 8.0 Facebook SDK 7.8 and 7.9 Unity 5.5.0
http://stackoverflow.com/questions/40424887/cant-login-using-facebook-login-on-ios-10 I find this but i don't understand what to do to solve the error...
I am experiencing a crash similar to this also on Unity 5.5.0f3. We don't have the facebook popup, we app switch to facebook instead, but our app crashes when it attempts to switch back from Facebook. The only error I can get is a SIGABRT in main.mm at Code (CSharp): UIApplicationMain(argc, argv, nil, [NSString stringWithUTF8String:AppControllerClassName]); Will update if I find a solution.
Our developers have worked out a fix for this issue - it will be available in upcoming 5.5/5.6 releases: https://issuetracker.unity3d.com/is...n-due-to-missing-null-check-with-facebook-sdk
In the mean time @Benzino07, use these to do the automatic subclassing: create a file in your Plugins->iOS folder called OverrideUnityAppController.h and put this in it: Code (csharp): #import "UnityAppController.h" @interface OverrideUnityAppController : UnityAppController - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation; @end and also create one called OverrideUnityAppController.mm with the following: Code (csharp): #import "OverrideUnityAppController.h" #include "PluginBase/AppDelegateListener.h" @implementation OverrideUnityAppController - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation { NSMutableArray* keys = [NSMutableArray arrayWithCapacity:3]; NSMutableArray* values = [NSMutableArray arrayWithCapacity:3]; auto addItem = [&](NSString* key, id value) { [keys addObject:key]; if (value == nil) { [values addObject:[NSNull null]]; } else { [values addObject:value]; } }; addItem(@"url", url); addItem(@"sourceApplication", sourceApplication); addItem(@"annotation", annotation); NSDictionary* notifData = [NSDictionary dictionaryWithObjects:values forKeys:keys]; AppController_SendNotificationWithArg(kUnityOnOpenURL, notifData); return YES; } @end IMPL_APP_CONTROLLER_SUBCLASS(OverrideUnityAppController) This should make the change permanently until its fixed in 5.5.x
This fix won't necessarily work if you already have an overridden UnityAppController class in your project. Some third-party plugins do this so you might be unaware of it. I have 2 plugins (Helpshift and AppsFlyer) that both want to do this already so I had to hack them together into a single class for them both to work.
Hi @Kujo87 Thanks for the code but that doesn't work for me. it just never calls my custom function. I also try to override the memory warning call, but same thing, it never gets called. I'm thinking @andymads might be correct in that another library has already overridden it, although I can't see one perhaps it in a lib.
ahh, makes sense yeah - I don't have any overriders thankfully, so been able to make it happen this way.