Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
3
Question by mrgeorge3d · Nov 02, 2015 at 02:21 AM · facebooksdklogin

Facebook SDK 7.2.1 Unity Login Crash on device iOS9, not in editor

Everything is working perfectly inside unity editor, but when I build for iOS and test on device I get this error everytime I try to login to facebook:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'can't start iterating in the middle of an iteration'

alt text

Here's the code I'm using inside Unity:

 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine.UI;
 using Facebook.Unity;
 
 public class NewFbLogin : MonoBehaviour 
 {
     public Button fbLoginBtn;
 
     public void FbLogin()
     {
         var perms = new List<string>(){"public_profile", "email", "user_friends"};
         FB.LogInWithReadPermissions(perms, AuthCallback);
     }
 
     private void AuthCallback (ILoginResult result) 
     {
         if (FB.IsLoggedIn) 
         {
             // AccessToken class will have session details
             var aToken = Facebook.Unity.AccessToken.CurrentAccessToken;
             // Print current access token's User ID
             Debug.Log(aToken.UserId);
             // Print current access token's granted permissions
             foreach (string perm in aToken.Permissions) 
             {
                 Debug.Log(perm);
             }
 
             fbLoginBtn.gameObject.SetActive(false);
         } else {
             Debug.Log("User cancelled login");
         }
     }
 }

Am I missing something?

Thanks for your help!

captura-de-pantalla-2015-10-30-a-las-111744-pm.png (380.6 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mrgeorge3d · Nov 02, 2015 at 03:32 AM 0
Share

@zzzzzz789 Could you help me? Thanks for your time!

avatar image mrgeorge3d · Nov 02, 2015 at 08:04 PM 0
Share

I have another script that uses iAd banner, I disabled that script and everything is working fine, however I don't want to disable iAds... :/

avatar image zzzzzz789 mrgeorge3d · Nov 02, 2015 at 11:22 PM 0
Share

@mrgeorge3d It sounds like this issue is not related to the Facebook SD$$anonymous$$ for Unity. For posterity though, please keep us informed on how work around this.

avatar image mrgeorge3d zzzzzz789 · Nov 02, 2015 at 11:37 PM 0
Share

This is what is happening on iOS9 Device:

I have a Login button inside a Scene, and also Im Displaying an iAd as mentioned in the docs in the same scene

  1. The iAd Displays properly inside my scene.

  2. I click my Facebook login button and it opens the new iOS9 login Safari screen.

  3. I click Ok to accept the requested perms.

  4. The App crashes with the error I mentioned before.

I've already tested this with an older device (iOS8) and facebook works fine!

The problem is inside iOS 9... So I don't $$anonymous$$now if this is a facebook issue or an iAd Banner issue, cause if I Disable the script that displays the banner, I can login to facebook without any problem.

Thanks @zzzzzz789

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by LTX · Jan 30, 2016 at 01:46 AM

This is what i have figured.

http://answers.unity3d.com/questions/1077864/facebook-sdk-710-integration-crash.html#answer-1081165

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by matbrummitt · Nov 06, 2015 at 08:17 AM

My app crashes when pressing my login button, i don't see any Facebook pages it just closes immediately. Not running iAds just unity ads

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

37 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

About AndroidSupportLibraryResolver.cs 0 Answers

Facebook SDK does not return focus to game canvas after FB purchase popup closed 0 Answers

Facebook score API not saving score for public user 1 Answer

Facebook SDK Login crashes on iOS 10 2 Answers

Unity Facebook SDK - Scores Paging and Pagination 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges