Code Monkey home page Code Monkey logo

facebook-android-sdk's Introduction

Facebook SDK for Android

Run testsuite with gradle Maven Central

This library allows you to integrate Facebook into your Android app.

Learn more about the provided samples, documentation, integrating the SDK into your app, accessing source code, and more at https://developers.facebook.com/docs/android

👋 The SDK team is eager to learn from you! Fill out this survey to tell us what’s most important to you and how we can improve.

TRY IT OUT

  1. Check-out the tutorials available online at https://developers.facebook.com/docs/android/getting-started
  2. Start coding! Visit https://developers.facebook.com/docs/android/ for tutorials and reference documentation.

FEATURES

STRUCTURE

The SDK is separated into modules with the following structure.

+----------------------------------------------------+
|                                                    |
| Facebook-android-sdk                               |
|                                                    |
+----------------------------------------------------+
+----------+ +----------+ +------------+ +-----------+
|          | |          | |            | |           |
| Facebook | | Facebook | | Facebook   | | Facebook  |
| -Login : | | -Share   | | -Messenger | | -Applinks |
|          | |          | |            | |           |
+----------+ +----------+ |            | |           |
+-----------------------+ |            | |           |
|                       | |            | |           |
| Facebook-Common       | |            | |           |
|                       | |            | |           |
+-----------------------+ +------------+ +-----------+
+----------------------------------------------------+
|                                                    |
| Facebook-Core                                      |
|                                                    |
+----------------------------------------------------+

USAGE

Facebook SDKs are broken up into separate modules as shown above. To ensure the most optimized use of space only install the modules that you intend to use. To get started, see the Installation section below.

Any Facebook SDK initialization must occur only in the main process of the app. Use of Facebook SDK in processes other than the main process is not supported and will likely cause problems.

INSTALLATION

Facebook SDKs are published to Maven as independent modules. To utilize a feature listed above include the appropriate dependency (or dependencies) listed below in your app/build.gradle file.

dependencies {
    // Facebook Core only (Analytics)
    implementation 'com.facebook.android:facebook-core:latest.release'

    // Facebook Login only
    implementation 'com.facebook.android:facebook-login:latest.release'

    // Facebook Share only
    implementation 'com.facebook.android:facebook-share:latest.release'

    // Facebook Messenger only
    implementation 'com.facebook.android:facebook-messenger:latest.release'

    // Facebook App Links only
    implementation 'com.facebook.android:facebook-applinks:latest.release'
    
    // Facebook Marketing only
    implementation 'com.facebook.android:facebook-marketing:latest.release'

    // Facebook Android SDK (everything)
    implementation 'com.facebook.android:facebook-android-sdk:latest.release'
}

You may also need to add the following to your project/build.gradle file.

buildscript {
    repositories {
        mavenCentral()
    }
}

GIVE FEEDBACK

Please report bugs or issues to https://developers.facebook.com/bugs/

You can also visit our Facebook Developer Community Forum, join the Facebook Developers Group on Facebook, ask questions on Stack Overflow, or open an issue in this repository.

SECURITY

See the SECURITY POLICY for more info on our bug bounty program.

CONTRIBUTING

We are able to accept contributions to the Facebook SDK for Android. To contribute please do the following.

  • Follow the instructions in the CONTRIBUTING.md.
  • Submit your pull request to the main branch. This allows us to merge your change into our internal main and then push out the change in the next release.

LICENSE

Except as otherwise noted, the Facebook SDK for Android is licensed under the Facebook Platform License (https://github.com/facebook/facebook-android-sdk/blob/main/LICENSE.txt).

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

DEVELOPER TERMS

  • By enabling Facebook integrations, including through this SDK, you can share information with Facebook, including information about people’s use of your app. Facebook will use information received in accordance with our Data Use Policy (https://www.facebook.com/about/privacy/), including to provide you with insights about the effectiveness of your ads and the use of your app. These integrations also enable us and our partners to serve ads on and off Facebook.

  • You may limit your sharing of information with us by updating the Insights control in the developer tool (https://developers.facebook.com/apps/[app_id]/settings/advanced).

  • If you use a Facebook integration, including to share information with us, you agree and confirm that you have provided appropriate and sufficiently prominent notice to and obtained the appropriate consent from your users regarding such collection, use, and disclosure (including, at a minimum, through your privacy policy). You further agree that you will not share information with us about children under the age of 13.

  • You agree to comply with all applicable laws and regulations and also agree to our Terms (https://www.facebook.com/policies/), including our Platform Policies (https://developers.facebook.com/policy/) and Advertising Guidelines, as applicable (https://www.facebook.com/ad_guidelines.php).

By using the Facebook SDK for Android you agree to these terms.

facebook-android-sdk's People

Contributors

abeatte avatar alaeldin513 avatar andrey-starodubtsev avatar chychkan avatar cristianoliveira avatar dreamolight avatar dzhuowen avatar fbtaoge avatar gcaglar avatar iquintero avatar jarwarren avatar jawwad avatar jingping2015 avatar joesus avatar jvlyn avatar kongxinzhu avatar kylinchang avatar laughingguitarist avatar lepouya avatar mingcaozhang avatar mingflifb avatar ninanina0815 avatar nodrock avatar ppansy avatar samodom avatar sso-google avatar swiese avatar victorcfk avatar xiaohaiguicc avatar zasadnyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facebook-android-sdk's Issues

Could not include as library

Hi everyone,

Each time I try to include com_facebook_android as library of any project in Eclipse, I won't be able to bluid the project anymore !
I've got this error in FbDialog.java line 86: R.drawable.facebook_icon cannot be resolved

and the following error in my project :

Description Resource Path Location Type
Unparsed aapt error(s)! Check the console for output. Example line 1 Android ADT Problem

I tried several things like adding the PNG file in resources or comments the lines but when I tired to publish on Emulator, I've got a message "Could not find APK file"

When I remove the library, everything works fine...

Please tell me how can I solve it?

Thx,

no permission to open page after success

Hello,

I would like to use the new Facebook API in my Android program, but have a problem.

I use the simple code from readme-file to authorize a user:
mFacebook = new Facebook();
mFacebook.authorize(this, APP_ID, PERMISSIONS, new DialogListener() { ... });

The dialog seemed to enter a user name and password for Facebook, but than I get the following message:
"Advanced approval: An invalid parameter was detected, abort or continue."

Afterwards, I had tried around with the generated URL and found that the parameter "display=touch" is not recognized. So I commented out line 350 in file Facebook.java:

//parameters.putString("display", "touch");

The login screen came again (saw something different) and the application seems to have been successful, because the API is now trying to open a page that can not open it. The following message is shown:
"You do not have permission to open page. fbconnect://succes/"

The permissions are the same like in the example:
PERMISSIONS = new String[] {"publish_stream", "read_stream", "offline_access"};

In the DialogListener the callback method "onComplete" is not called, but "onError", if my Android device does not have Internet access. Can someone please help me?

I use the Motorola Milestone with Android 2.01, but I develop for Android 1.6.

[Please Help ] Cannot execute SDK sample problem

Hi, I am in need of help to complete my application.

  1. I have downloaded the sdk and extracted the zip file to a folder
  2. I used Eclipse galileo import to create an android project from existing resource.
    I imported the sdk source code (facebook folder of the sdk) into my project explorer successfully.
    I can also run Build Project for this source code.
  3. Now, I am trying to import the sample example in the folder examples/simple. The project is imported I cannot execute it. I have added my client ID on the emample.java
    I cannot build the project.
    I am trying to clean the project and then build. This gives me the following error.

[2010-06-18 11:32:49 - Example] ERROR: Unknown flag '--'
[2010-06-18 11:32:49 - Example] Android Asset Packaging Tool
[2010-06-18 11:32:49 - Example]
[2010-06-18 11:32:49 - Example] Usage:
[2010-06-18 11:32:49 - Example] aapt l[ist] [-v] [-a] file.{zip,jar,apk}
[2010-06-18 11:32:49 - Example] List contents of Zip-compatible archive.
[2010-06-18 11:32:49 - Example]
[2010-06-18 11:32:49 - Example] aapt d[ump] WHAT file.{apk} [asset [asset ...]]
[2010-06-18 11:32:49 - Example] badging Print the label and icon for the app declared in APK.
[2010-06-18 11:32:49 - Example] permissions Print the permissions from the APK.
[2010-06-18 11:32:49 - Example] resources Print the resource table from the APK.
[2010-06-18 11:32:49 - Example] configurations Print the configurations in the APK.
[2010-06-18 11:32:49 - Example] xmltree Print the compiled xmls in the given assets.
[2010-06-18 11:32:49 - Example] xmlstrings Print the strings of the given compiled xml assets.
[2010-06-18 11:32:49 - Example]
[2010-06-18 11:32:49 - Example] aapt p[ackage] [-d][-f][-m][-u][-v][-x][-z][-M AndroidManifest.xml]
[2010-06-18 11:32:49 - Example] [-0 extension [-0 extension ...]]
[2010-06-18 11:32:49 - Example] [-g tolerance]
[2010-06-18 11:32:49 - Example] [-j jarfile]
[2010-06-18 11:32:49 - Example] [-I base-package [-I base-package ...]]
[2010-06-18 11:32:49 - Example] [-A asset-source-dir] [-P public-definitions-file]
[2010-06-18 11:32:49 - Example] [-S resource-sources [-S resource-sources ...]] [-F apk-file] [-J R-file-dir]
[2010-06-18 11:32:49 - Example] [raw-files-dir [raw-files-dir] ...]
[2010-06-18 11:32:49 - Example]
[2010-06-18 11:32:49 - Example] Package the android resources. It will read assets and resources that are
[2010-06-18 11:32:49 - Example] supplied with the -M -A -S or raw-files-dir arguments. The -J -P -F and -R
[2010-06-18 11:32:49 - Example] options control which files are output.
[2010-06-18 11:32:49 - Example]
[2010-06-18 11:32:49 - Example] aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...]
[2010-06-18 11:32:49 - Example] Delete specified files from Zip-compatible archive.
[2010-06-18 11:32:49 - Example]
[2010-06-18 11:32:49 - Example] aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...]
[2010-06-18 11:32:49 - Example] Add specified files to Zip-compatible archive.
[2010-06-18 11:32:49 - Example]
[2010-06-18 11:32:49 - Example] aapt v[ersion]
[2010-06-18 11:32:49 - Example] Print program version.
[2010-06-18 11:32:49 - Example]
[2010-06-18 11:32:49 - Example] Modifiers:
[2010-06-18 11:32:49 - Example] -a print Android-specific data (resources, manifest) when listing
[2010-06-18 11:32:49 - Example] -c specify which configurations to include. The default is all
[2010-06-18 11:32:49 - Example] configurations. The value of the parameter should be a comma
[2010-06-18 11:32:49 - Example] separated list of configuration values. Locales should be specified
[2010-06-18 11:32:49 - Example] as either a language or language-region pair. Some examples:
[2010-06-18 11:32:49 - Example] en
[2010-06-18 11:32:49 - Example] port,en
[2010-06-18 11:32:49 - Example] port,land,en_US
[2010-06-18 11:32:49 - Example] If you put the special locale, zz_ZZ on the list, it will perform
[2010-06-18 11:32:49 - Example] pseudolocalization on the default locale, modifying all of the
[2010-06-18 11:32:49 - Example] strings so you can look for strings that missed the
[2010-06-18 11:32:49 - Example] internationalization process. For example:
[2010-06-18 11:32:49 - Example] port,land,zz_ZZ
[2010-06-18 11:32:49 - Example] -d one or more device assets to include, separated by commas
[2010-06-18 11:32:49 - Example] -f force overwrite of existing files
[2010-06-18 11:32:49 - Example] -g specify a pixel tolerance to force images to grayscale, default 0
[2010-06-18 11:32:49 - Example] -j specify a jar or zip file containing classes to include
[2010-06-18 11:32:49 - Example] -m make package directories under location specified by -J
[2010-06-18 11:32:49 - Example] -u update existing packages (add new, replace older, remove deleted files)
[2010-06-18 11:32:49 - Example] -v verbose output
[2010-06-18 11:32:49 - Example] -x create extending (non-application) resource IDs
[2010-06-18 11:32:49 - Example] -z require localization of resource attributes marked with
[2010-06-18 11:32:49 - Example] localization="suggested"
[2010-06-18 11:32:49 - Example] -A additional directory in which to find raw asset files
[2010-06-18 11:32:49 - Example] -F specify the apk file to output
[2010-06-18 11:32:49 - Example] -I add an existing package to base include set
[2010-06-18 11:32:49 - Example] -J specify where to output R.java resource constant definitions
[2010-06-18 11:32:49 - Example] -M specify full path to AndroidManifest.xml to include in zip
[2010-06-18 11:32:49 - Example] -P specify where to output public resource definitions
[2010-06-18 11:32:49 - Example] -S directory in which to find resources. Multiple directories will be scanned and the first match found (left to right) will take precedence. -0 specifies an additional extension for which such files will not
[2010-06-18 11:32:49 - Example] be stored compressed in the .apk. An empty string means to not
[2010-06-18 11:32:49 - Example] compress any files at all.

Thanks,

Facebook links.post problem

Hi,

links post not working.

Code:
Bundle parameters1 = new Bundle();
parameters1.putString("url", "http://google.com");
parameters1.putString("comment", "heelloo");
parameters1.putString("image", imgURL);
mFacebook.dialog(GetAllQuestions.this, "links.post", parameters1, new FBDialogListener());

Please help.

Thanks
veradis

Login dialog resizes smaller when soft keyboard displays

I'm trying to create an app that includes a context menu with an item for logging in via facebook. The login dialog/webview is being displayed as a result of my call to Facebook.authorize; however, when I tap on the input field for email or password, the virtual keyboard gets displayed and the dialog attempts to resize to make room for the keyboard. However, the layout gets all messed up. How can I force the window to be panned instead of resized?

I've tried adding one of the three blocks of code below to FbDialog.java's onCreate method to block the resizing, but none of these seem to work:

// solution 1 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

// solution 2
InputMethodManager imm = (InputMethodManager) mWebView.getContext().getSystemService( Context.INPUT_METHOD_SERVICE );
imm.showSoftInput( mWebView, WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN );

// solution 3
getWindow().addFlags( WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN );

Any suggestions???

Customize stream.publish dialog

How can I customize the publish dialog?
I managed to make a customized feed post by using the Facebook.request(String graphPath, Bundle parameters, String httpMethod) method:
mFacebook.request("/me/feed", parameters, "POST"));

parameters:

parameters.putString("link", "...");
parameters.putString("name", "...");
parameters.putString("caption", "...");
parameters.putString("source", "...");
parameters.putString("attribution", "...");

this works as expected, but now I'd like to let the user add a "message" to those parameters using the stream.publish dialog.
At first I tried to call the dialog with "/me/feed" instead of "stream.publish" and the same parameters I used for the request, which wasn't working as I thought, the dialog just said "Error with [App]".
Thus I suppose I can't use the graph-API in the dialog?
Further trying I called dialog with another parameters Bundle:

attachment.putString("caption", "...");
attachment.putString("name", "...");
attachment.putString("href", "...");
parameters.putBundle("attachment", attachment);

But the publish dialog just ignores them, publishing a message (without any extras) still works though. Also adding a key named "message" to parameters works as expected, filling the message input field with the given value.

Login page blank on HTC Legend

Hi,
in my recent project when I do the autorization (facebook.authorize(...) ) I only get a blank page back. It works on all other devices (Magic, Hero, Desire, SonyEricsson X10 etc.) where I get to the login page. Has anyone else got it to work on the HTC Legend?

ask one question about "like/unlike"

pls read the source code as below (from stream example):

public void like(final String post_id, final boolean val) {
    Bundle params = new Bundle();
    if (!val) {
        params.putString("method", "delete");
    }
    getFb().request(post_id + "/likes", new Bundle(), "POST",
            new AsyncRequestListener() {

        public void onComplete(JSONObject response) {
            callJs("javascript:onLike('" + post_id + "'," + val + ")");
        }
    });
}

i do not know why pass a "new Bundle()" not the "params", to the request call.
could you tell me ?thank you.

Blank Login Screen

Hi, Im using the app id as '107714532611441'. Still im getting the blank empty log in page after i click the log in button. I have added the code to clear the session after the session restore.

Extended permissions not working

I'm getting "an invalid next or cancel parameter was specified" when I try to get extended permissions. When I only use the authorization without any parameters it works. This also happens in the example app.

Can't install the Android-SDK

To make sure that ANDROID_DIR was created I pointed to the android.jar file in the android-sdk folder. However when I did so I get the following error message.

[2010-06-02 17:18:13 - FacebookSDK-example]
Attempt to include a core VM class in something other than a core library.
It is likely that you have attempted to include the core library from a desktop
virtual machine into an application, which will most assuredly not work. If
you really intend to build a core library -- which is only appropriate as
part of creating a full virtual machine binary, as opposed to compiling an
application -- then use the "--core-library" option to suppress this e

Accessing "Mobile Upload" email via Graph API?

I know that uploading photos and video isn't supported in the SDK at this time... I was goofing around on FB the other day and found the "Mobile upload email" When clicking on photos -> the add new photos page appears and there is "create album" and "mobile photos" -> clicking on "mobile photos" opens a sub-screen with the "special" email for uploading...

So is there a way to get this email programatically? I really don't want to have to prompt the user :( but I guess I will if I have to :D

ReferenceError: Can't find variable: UIPermissions - when asking for permission

Like Button integration (task #201437)

I'd like to be able to have a WebView with a "Like Button" in it. This almost works. However, even if my app has the "offline_access" permission, the like button wants the user to re-login if they have logged into facebook somewhere else since they last logged into facebook via the app.

Incorrect password flow results not pretty

After entering the incorrect password three times the login window changes to an unoptimized version of the web page with a "try again" or a "reset your password option." This page is far too wide for the screen and is almost unnavigable. Clicking try again opens the browser and brings the user to a facebook.com mobile login page. A correct login brings the user to the facebook.com home page and does not pass the details back to the app.

Error after restarting sample app

I managed to get the FacebookSDK-example app working and submitted a wall post. However if I shut down the app (Force-stop in Android's settings) and relaunch it I can no longer post. I still see the "Wall Post!" button, but when I click on it, it launches a blank webview with "Error" at the top.

In order to be able to submit another wall post, I have to click on the Logout button and log back in.

When I first logged in, I did leave the "Keep me logged in" checkbox checked.

Extended permission pop up error

I was trying to run an example FacebookSDK-example.

Once I put my user id and password, it brings me a dialogue box of Extended Permission with the following info with "Okay" button -
"An invalid next or cancel parameter was specified."

Clicking "Okay" button doesn't take me any where.

I've not changed anything in the example except putting application id.

I've a G1. The same thing happens with my emulator. Can someone suggest what I'm doing wrong?

You do not have permission to open this page. fbconnect://success/#access_token

Hi

I've been trying to get the latest version of the facebook SDK to work but I get this behaviour:

When initiating Facebook.authenticate() the facebook dialog pops up blank but with a loading dialog on top. After a second or two I get thrown to Browser where a url fbconnect://success/#access_token=blabla has been loaded and the page says "You do not have permission to open this page. fbconnect://success/#access_token...."

Why does this happen? If I clear my cookies first I'm prompted (through Browser) for username and password at touch.facebook.com, and then the same page as above is shown.

I've monitored the console output and there is a bunch of really long urls (some more than 1200 characters long) being passed to the Facebook-Webview, a bit strange.

I've tried migrating to the new permissions in the facebook app we're connecting to but this did not change anything.

Is there anything I've missed here?

Blank Login Screen

I build the SDK on Android SDK 1.6. I added the APP_ID. I'm testing this on the ADP1. After i click on the login screen, i can only find a blank screen. I have tried this many times.

OAuthException Invalid Session Key

I get an OAuthException right after I accept publish stream request from my application. Is this a new issue? I am using the latest facebook-android-sdk codebase.

Strangely enough, I am able to login using one of the ids that I use for testing. This id had allowed the publish stream request previously. I can't use any new test ids

Thanks

fb wall posting

Hi,

Is there an way to post on wall without opening the dialog window and i have to add user prompt, attachment, message from my coding rather than asking the user to do so. When the user clicks post to wall button, it should respond back with only success or failure status(no dialog should open),

When i try to add attachment, the dialog shows error. I tried like one mentioned in previous thread, but with no result.

String imgURL = "www.google.co.in/images/srpr/nav_logo13.png";
String linkURL = "www.google.com";
String caption = "My caption";
String description = "My description";

Bundle bundle = new Bundle();
bundle.putString("userMessagePrompt", "Hello");
bundle.putString("attachment", "{"name":""+caption+"","href":""+linkURL+"","description":""+description+"", "media":[{"type":"image","src":""+imgURL+"","href":""+linkURL+""}]}");
bundle.putString("message", "My message");
mAsyncRunner.requestPOST("stream.publish", new Bundle(), new WallPostRequestListener());.

Thanks.

XMPP

I tried to move my app to the new SDK.
From what I see in the new APIs, there is no Facebook session key and no Facebook session secret.
These are required to perform XMPP Facebook authentication for accessing the chat stream.
Any ideas how to do it with the new APIs?
Thanks

you do not have permission to open this page. fbconnect://success

Hello - I'm suddenly having this issue with my android app. It's happening when the user is trying to login, after clicking the Allow button on the permission screen. It's been working fine for several weeks but just today I'm receiving this same error. I've read a similar thread on this issue and have checked my application settings and I have the New Data Permissions enabled. My application ID is 110586198985031. Any help would be greatly appreciated.

Thanks!

was working, now I get "FacebookError: Error processing access token"

My app logs into FB using:

getFacebook().authorize(viewContext, FB_APP_ID,
new String[] {"read_stream", "offline_access"},
new LoginDialogListener());

on success, the token is saved using: SessionStore.save(getFacebook(), context);

Periodically, I access FB using:

            Facebook fb = Prefs.getFacebook();

    asyncRunner = new AsyncFacebookRunner(fb);

        SessionStore.restore(fb, context);

        asyncRunner.request("me/home", new MyRequestListener());

After signing in, this will work for a while, but after several successful accesses (over several minutes for testing), each time the app tries to read the home stream using the above I get "FacebookError: Error processing access token".

Can anyone shed some light on what is happening? Is there a fix?

Thanks,
Steve

Facebook.authorize displaying "You do not have permission..." message

Although I believe this was working fine yesterday, today when I try to login using the Facebook.authorize method, the browser opens up to the URL:

fbconnect://success/#access_token=127601....&expires_in=0

... and the browser displays the message below:

You do not have permission to open this page. fbconnect://success/#access_token=12760143ViXsBvo.&expires_in=0

Is this related to "Known Issue #5"???

API Error on Example

I created a very test Facebook application and used the API key as the APP_ID in Example.java.

The example application runs perfectly for Login and the request button (it displays my Facebook name). When I click on the Wall Post! button I see the webview activity launch, then loads the following text:
API Error Code: 3
API Error Description: Unknown Method
Error Message: app must be on whitelist

I have tried three different application keys and always get the same result. Do I have an incorrect Facebook application setting, or is this an error that other people are getting?

Stream app stopped working

I tried relaunching the stream app on my HTC Hero running Android 2.1 and I now get 'Force-Close' error. I think that running both the Facebook HTC App with 'Account Sync' 'On' is causing this issue. I cannot replicate this emulator running 2.1. (Normally I would attach the logcat log but right now I have connectivity issues having it show up.

Not easy to determinate Facebook.request(...) errors

Facebook.request(...) returns a String... not easy to determinate which type of error it is.

We have to parse the string to check if it contains: - "< HTML >", what means it is an HTTP error;
- "error_code" or "error", what means it is a Facebook error (JSON string).
Otherwise it is not an error and the string contains the id of the publication.

-> could Facebook.request(...) return an object instead of a string?
Thanks :)

Can one send an 'attachment' with a Wall Post?

Is there a way to send an 'attachment', as one could using the older API? I wanted to be able to post something along the lines of the following, along with the user's message.
{
"properties": {"Winery": "Colchuga winery","Wine Type": "Red Wine","Region": "Southern Chile","Country": "Chile","Price": "$12.95"},
"caption": "Rated 2 out of 5","href": "#","name": "Gamay Beaujolais","description": "Good"
}

I have been tinkering with the Example application that was included in the SDK but have been unable to figure out how to go about including an 'attachment' with the user's message.

Thanks.

Transform string into URL strings

Could you add a method (e.g. in Util class) to transform strings into URL strings?
Facebook API does not accept normal strings anymore since last week :(, i.e. all "special" characters ('{', ',', etc.) shall be replaced with %nn (%7B, %2E, etc.).
Note that '.' character does not need to be replaced... but it can be as well.

message=Message&attachment={"name":"Name", "href":"http://www.google.fr", "caption":"Caption", "description":"Description"}
-> message=Message&attachment=%7B%22name%22%3A%22Name%22%2C%20%22href%22%3A%22http%3A%2F%2Fwww.google.fr%22%2C%20%22caption%22%3A%22Caption%22%2C%20%22description%22:%22Description%22%7D

Thanks :)

Tweaks to readme file

Thanks Steven, for the updated configuration and readme. It's great to see this evolve so quickly.

I have two more suggestions for the readme file:

  1. Correct the line "git clone [email protected]:facebook/facebook-android-sdk.git" to read "git clone http://github.com/facebook/facebook-android-sdk.git". That will allow everyone who has only read-only access to get the files.

  2. The line "If you already have an Android application, you can add a dependency to your application on the SDK by right-clicking on your project in the Package Explorer, selecting Properties, and adding the dependency in the Library section of the Android tab." is a bit vague. I've never imported a library into an Android project before, and the steps are not completely obvious. Even after two tries, I don't think I have it quite right yet.

Thanks,
David

permission denied

i keep getting permission denied when trying to get the repository any ideas why?

[email protected]:facebook/facebook-android-sdk
Initialized empty Git repository in /home/ade/facebook-android-sdk/.git/
ERROR: Permission to facebook/facebook-android-sdk denied to adeakinyooye.
fatal: The remote end hung up unexpectedly

Pressing 'Back' key does not call onCancel

Hey Steven,

I've been using the SDK great work. One thing I noticed. The user might bring up the dialog box to login but the dialog itself can be "cancelled" by pressing the back key on the emulator or phone.

Perhaps you can wire up the dialog to use a setOnCancelListener() to call onCancel()?

Thanks!

Dimitris

Provide a first official version

Hello,

could you provide a first .jar (and associated sources) in Downloads, as a first official version... even 0.1.alpha?
It would be a base and a reference, at least for people using the SDK for applications in production; and the version could be mentioned when posting an issue here.

Thanks for your comprehension :)

How do I get the session key?

My client's application requires a session_key parameter in the API's requests. I had previously been using CodeCarpet's FBConnect API to log into Facebook, which would return a session_key in the login response. However, the official SDK only returns access_token and expires_in parameters upon login, and I cannot find a way to obtain the session key.

How to get online friends?

The request to get all friends of my facebook account works fine:
mAsyncRunner.request("me/friends", new SampleRequestListener());

And the request to get informations about one friend works fine too:
mAsyncRunner.request(userID, new SampleRequestListener());

But how do I get the information about which of my friends are currently online?
I know that I can specify parameters for the bundle by means of filtering, but I have not found a parameter that filters the list of friends after their online status.

My internet research revealed the parameter "online_presence = active", but it had no effect. One of the friends was clearly not online during the test and stood still in the list.

Is there somewhere a list of possible parameters for various requests, such as just a list of currently active friends.

Example & Stream App - Console: ReferenceError: Can't find variable: UIPermissions

Hey,
I have set up the Stream & Example projects as explained in the documentation. The problem that I am encountering is when I get asked for extended permission (after logging in to facebook), clicking on "Allow Publishing" or "Don't Allow" does not do anything.

Here is the error that I found from LogCat:

06-17 01:12:21.063: DEBUG/Facebook-WebView(951): Redirect URL: http://www.facebook.com/connect/prompt_permissions.php?api_key=5839969809&cancel=https%3A%2F%2Fgraph.facebook.com%2Foauth%2Fauthorize_cancel%3Fdisplay%3Dtouch%26scope%3Doffline_access%252Cread_stream%252Cpublish_stream%26redirect_uri%3Dfbconnect%253A%252F%252Fsuccess%26type%3Duser_agent%26client_id%3D5839969809&canvas=0&display=touch&ext_perm=offline_access%2Cread_stream%2Cpublish_stream&extern=3&fbconnect=1&locale=en_US&next=https%3A%2F%2Fgraph.facebook.com%2Foauth%2Fauthorize_success%3Fdisplay%3Dtouch%26scope%3Doffline_access%252Cread_stream%252Cpublish_stream%26redirect_uri%3Dfbconnect%253A%252F%252Fsuccess%26type%3Duser_agent%26client_id%3D5839969809&offline_access=1&legacy_return=1&required=1&return_session=1&source=login&v=1#
06-17 01:12:21.112: DEBUG/WebCore(951): Console: ReferenceError: Can't find variable: UIPermissions line: 15 source: http://www.facebook.com/connect/prompt_permissions.php?api_key=5839969809&cancel=https%3A%2F%2Fgraph.facebook.com%2Foauth%2Fauthorize_cancel%3Fdisplay%3Dtouch%26scope%3Doffline_access%252Cread_stream%252Cpublish_stream%26redirect_uri%3Dfbconnect%253A%252F%252Fsuccess%26type%3Duser_agent%26client_id%3D5839969809&canvas=0&display=touch&ext_perm=offline_access%2Cread_stream%2Cpublish_stream&extern=3&fbconnect=1&locale=en_US&next=https%3A%2F%2Fgraph.facebook.com%2Foauth%2Fauthorize_success%3Fdisplay%3Dtouch%26scope%3Doffline_access%252Cread_stream%252Cpublish_stream%26redirect_uri%3Dfbconnect%253A%252F%252Fsuccess%26type%3Duser_agent%26client_id%3D5839969809&offline_access=1&legacy_return=1&required=1&return_session=1&source=login&v=1

Package name for facebook and examples are the same

Both the facebook project and the examples/simple project use the same project names. This results in the build process producing two different com.facebook.android.R.class files, which causes dex to choke when assembling the apk on IntelliJ. I'm surprised this isn't a problem on eclipse as well.

Changing the project name in simple to com.facebook.android.example solved this problem. The problem may also exist for the Stream example, but I haven't tried it myself.

Problems when try stream example

When i am trying stream i got a problem
after i input the email and password and click login button, it brought me to a webview dialog
show me the information:
Stream is requesting permissions to do the following:
Access my public information.....
Post to my Wall.....
Access poss in my News Feed
.........

Is there still need more permission to access ?
I have looked into the source code and see there already have { "offline_access", "read_stream", "publish_stream" }, is it not enough ?

ask for some help .thank you in advance.

The SDK blocks on bad HTTP requests (task #467289)

The SDK blocks on bad HTTP requests like "https://api.facebook.com?method/stream.publish?message=Message".
The request is sent by Util.openUrl but Facebook.request(...) never returns.

OK, I know this should not happen...

Bad Dialog size on large screens

FbDialog (which displays the Facebook login web page) is well displayed on 320x480 "default-size" screens (e.g. HTC Hero and Motorola Dext)... but is very small on larger screens (e.g. 480x800 HTC Desire and 480x854 Motorola Droid/Milestone).

The cause is that sizes are hard-coded in FbDialog:
static final LayoutParams DEFAULT_LANDSCAPE = new LayoutParams(460, 260);
static final LayoutParams DEFAULT_PORTRAIT = new LayoutParams(280, 420);

Stupid groups on Facebook

i'm kinda getting sick and tired of all these groups saying some thing "blah blah blah.. JK.. Make a joke" it's starting to annoy me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.