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

FB App closes and crashes our app. #70

Open
rod-gp opened this issue May 13, 2020 · 5 comments
Open

FB App closes and crashes our app. #70

rod-gp opened this issue May 13, 2020 · 5 comments

Comments

@rod-gp
Copy link

rod-gp commented May 13, 2020

Hi,
We are having a problem in iOS when the Facebook App is installed. when the login with Facebook button is clicked, the Webview pops up and then an alert asks if you want to login with the App. if you say yes, the app is opened, the user enters the info and hit submit and the user is verified correctly, unfortunately, after all this happens and the Facebook app closes and our app is reopened again our app crashes.

The error on the console is that the application cannot be found.

The question here is ... is there a way to force the webview to NOT prompt the user to open the App? if the app is not present, the webview works like a charm.

we are doing the following

public async Task FacebookLogin()
{
try
{
CrossFacebookClient.Current.Logout();
_socialMediaType = Strings.LoginTypeFacebook;
var _settings = new JsonSerializerSettings();
_settings.NullValueHandling = NullValueHandling.Ignore;

            var response = await CrossFacebookClient.Current.RequestUserDataAsync(new string[] { "email", "first_name", "gender", "last_name", "birthday" }, new string[] { "email", "user_birthday" });

            if (response.Status == FacebookActionStatus.Completed)
            {
                FBCompleteUserData userData = JsonConvert.DeserializeObject<FBCompleteUserData>(response.Data, _settings);
                _socialMediaUser = new SocialMediaUser()
                {
                    AuthToken = CrossFacebookClient.Current.ActiveToken,
                    Birthday = DateTime.Now,
                    Email = userData.email,
                    LastName = userData.last_name,
                    Name = userData.first_name
                };
                await RunSafe(LoginOrRegister());
            }
            else
            {
                await _popupMessageService.WarningMessage("An error has ocurred, try again later.", "Accept");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
        }
    }
@rdelrosario
Copy link
Member

rdelrosario commented May 13, 2020

You made sure to do all the steps in https://github.com/CrossGeeks/FacebookClientPlugin/blob/master/docs/iOSSetup.md ?

You configured Entitlement.plist as specified?

@rod-gp
Copy link
Author

rod-gp commented May 13, 2020

yes we did, we updated the entitlement, we override the methods and checked it twice in two different environments with the same result.. :(

is there any configuration on the nugget to avoid opening the Facebook app and always remain on the webView?

thanks for the quick response..

@rdelrosario
Copy link
Member

rdelrosario commented May 13, 2020 via email

@juans9797
Copy link

We are having the same issue. The app crashes on some devices, we have tested it on 8 different iPhones and 5 of them work correctly but 3 of them crashes without any error trace. The iPhones are a variety of models, no pattern there. I wouldn't think it is a configuration issue since it actually works on different iPhones. Any ideas?

@LeonardoAlfonso88
Copy link

We have the same issue. We tested in 9 devices, and in 6 work fine, in the other three crash and close the app. Can you help us, please?

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

4 participants