Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6541953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:10:04+00:00 2026-05-25T11:10:04+00:00

In my application i am trying to connect with the facebook. After login it

  • 0

In my application i am trying to connect with the facebook. After login it will ask for allow permission if any permissions are there and also can post wall.

Same app is work properly on emulator but on phone login window and allow permission window is not coming.
Why it happening like this?

Below my code for login,

  public class LoginListener implements DialogListener {

        @Override
        public void onComplete(Bundle values) {
            if (testAuthenticatedApi())
                System.out.println("Login successfully...");
            if (testAuthenticatedErrors()) {
                System.out.println("Login successfully...");
            }
        }
}


 public boolean testAuthenticatedApi() {
        if (!facebook.isSessionValid()) 
            return false;
        try {
            Log.d("Tests", "Testing request for 'me'");
            String response = facebook.request("me");
            JSONObject obj = Util.parseJson(response);
            if (obj.getString("name") == null || 
                    obj.getString("name").equals("")) {
                return false;
            }

            Log.d("Tests", "Testing graph API wall post");
            Bundle parameters = new Bundle();
            parameters.putString("message", "hello world");
            parameters.putString("description", "test test test");
            response = facebook.request("me/feed", parameters, 
                    "POST");
            Log.d("Tests", "got response: " + response);
            if (response == null || response.equals("") || 
                    response.equals("false")) {
                return false;
            }

            Log.d("Tests", "Testing graph API delete");
            response = response.replaceAll("\\{\"id\":\"", "");
            response = response.replaceAll("\"\\}", "");
            response = facebook.request(response, new Bundle(), 
                    "DELETE");
            if (!response.equals("true")) return false;

            Log.d("Tests", "Testing old API wall post");
            parameters = new Bundle();
            parameters.putString("method", "stream.publish");
            parameters.putString("attachment", 
                "{\"name\":\"Name=Title\"," +
                "\"href\":\"http://www.google.fr/\",\"" +
                "caption\":\"Caption\",\"description\":\"Description" +
                "\",\"media\":[{\"type\":\"image\",\"src\":" +
                "\"http://www.kratiroff.com/logo-facebook.jpg\"," +
                "\"href\":\"http://developers.facebook.com/\"}]," +
                "\"properties\":{\"another link\":{\"text\":\"" +
                "Facebook homepage\",\"href\":\"http://www.facebook." +
                "com\"}}}");;
            response = facebook.request(parameters);
            Log.d("Tests", "got response: " + response);
            if (response == null || response.equals("") || 
                    response.equals("false")) {
                return false;
            }

            Log.d("Tests", "Testing wall post delete");
            response = response.replaceAll("\"", "");
            response = facebook.request(
                    response, new Bundle(), "DELETE");
            if (!response.equals("true")) return false;

            Log.d("Tests", "All Authenticated Tests Passed");
            return true;
        } catch (Throwable e) {
            e.printStackTrace();
            return false;
        }
    }

    public boolean testAuthenticatedErrors() {
        if (!facebook.isSessionValid()) return false;

        Log.d("Tests", "Testing that request for 'me/invalid' is rejected");
        try {
            Util.parseJson(facebook.request("me/invalid"));
            return false;
        } catch (Throwable e) {
            Log.d("Tests", "*" + e.getMessage() + "*");
            if (!e.getMessage().equals("Unknown path components: /invalid")) {
                return false;
            }
        }

        Log.d("Tests", "Testing that old API call with invalid method fails");
        Bundle params = new Bundle();
        params.putString("method", "something_invalid");
        try {
            Util.parseJson(facebook.request(params));
            return false;
        } catch (Throwable e) {
            Log.d("Tests", "*" + e.getMessage() + "*");
            if (!e.getMessage().equals("Unknown method") ) {
                return false;
            }
        }

        Log.d("Tests", "All Authenticated Error Tests Passed");
        return true;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:10:04+00:00Added an answer on May 25, 2026 at 11:10 am

    The problem could be the SSO (Single Sign On) feature of the login.

    Following link might be helpful.

    facebook login dialog disappears soon after loading

    http://ukgupta.blogspot.com/2011/07/facebook-implementation-into-android.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to connect to facebook from my iOS application, so I can make
I'm trying to create a facebook application that i'll connect with my MVC site.
i'm trying to build an application that every given time, will connect to a
I am trying to integrate facebook connect with my cakephp application. i am not
I'm trying to make an application that can connecto to facebook. I've found Facebook
I'm using Rails, Devise, and Omniauth, and I'm trying to login using facebook connect.
I'm trying to create following autorization application for android. But after pressing login button
I'm trying to make a Facebook video application so users can have a video
I am trying to implement facebook Connect to my cakephp Application. i am using
I'm trying to connect a Zend application to an SME server running LDAP with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.