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

App Crashed on clicking Login #45

Open
gauravsaini03-zz opened this issue Apr 14, 2014 · 1 comment
Open

App Crashed on clicking Login #45

gauravsaini03-zz opened this issue Apr 14, 2014 · 1 comment

Comments

@gauravsaini03-zz
Copy link

Hello,

My Application crashes when I tried login with facebook. This situation occur in the case of facebook app not installed. If facebook app is installed it worked fine.

Can Anyone help me, so How I can work out login without being have to facebook app installed also.

Thanks
Gaurav

@vrunoa
Copy link

vrunoa commented Apr 14, 2014

On older version of the facebook SDK I add this method to check facebook is installed on the user phone.

public boolean isFacebookAvailable() {

        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.putExtra(Intent.EXTRA_TEXT, "Test; please ignore");
        intent.setType("text/plain");

        final PackageManager pm = this.getApplicationContext().getPackageManager();
        for(ResolveInfo resolveInfo: pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY)){
            ActivityInfo activity = resolveInfo.activityInfo;
            // Log.i("actividad ->", activity.name);
            if (activity.name.contains("com.facebook.katana")) {
                return true;
            }
        }
        return false;
    }

On the new facebook SDK they already have this validation, and let you login with a webview in case the user doesnt have fb installed. My opinion, install the new sdk.

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

2 participants