lundi 20 avril 2015

Embed Youtube Video To Facebook And Play At Specific Timecode

I have a :30 YouTube video that I want to embed onto Facebook and start playback at :16.

I thought this would be easy enough changing the parameters in the URL for share, or the URL in the embed code. But when I post this on Facebook, even though the URL's will link to YouTube and play at the correct :16 mark, they always start from :00 when playback is initiated inside Facebook.

Does Facebook strip all of the URL parameters for embeded YouTube videos? Is there a work-around?

I've tried:

http://ift.tt/1OxCAsj

And I've tried:

<iframe width="560" height="315" src="http://ift.tt/1OxCAsj" frameborder="0" allowfullscreen></iframe>

And I've tried:

<iframe width="560" height="315" src="http://ift.tt/1OxCAsl" frameborder="0" allowfullscreen></iframe>

Nothing seems to work. I have an idea that depends on this functionality, so I'd love some help if anyone knows a work-around or even a reason. Thanks so much, crew!

Facebook webview Login issue android

I have an issue: I provided the feature of login with facebook through my app via facebook sdk 4.0.1.

At first I use below method to login and provide read permissions in mPermissions array.

LoginManager.getInstance().logInWithReadPermissions(FacebookFragment.this, mPermissions );

But if user already provided these permission once, then after re-login facebook says "You have already authorized myapp" and show me attached screen UI.

This scenario generates only when user do login with facebook webview (facebook app is not installed in their device) Please let me know about how can I remove this page from login.

enter image description here

Unable to fetch profile pic using graph api Facebook sdk 4.0

I am unable to fetch image using

 Bitmap bitmap = getBitmapFromURL("http://ift.tt/1Dm7y3w");
            if(bitmap!=null)
            imageView.setImageBitmap(bitmap);
            else
                Toast.makeText(getActivity(),"null it is",Toast.LENGTH_SHORT).show();

Where getBitmapFromURL is

public static Bitmap getBitmapFromURL(String src) {
        try {
            URL url = new URL(src);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setDoInput(true);
            connection.connect();
            InputStream input = connection.getInputStream();
            Bitmap myBitmap = BitmapFactory.decodeStream(input);
            return myBitmap;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

But when I use below everything works fine

        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);

But I have read there Strict mode in android 2.2 that this policy is not safe to use and not just this, it is also blocking my main UI for few seconds.

I want to know first, why I am unable to fetch facebook profile pic without using above policy and Is there any way that I can avoid above policy and may able to fetch my profile pic? Thanks in advance :)

Facebook connect and phonegap

i'm making a phonegap web application and i need to put Facebook's login in it.

i was not able to install phonegap's Facebook login but i find this very interesting library http://ift.tt/PSB2l0 i installed and it works fine on my iphone with phonegap desktop app (by using phonegap localhost as Valid OAuth redirect URIs in Facebook for example: http://localhost:3000/pathto/index.html) but when i open my local project from file://pathto/index.html it doesn't works, the redirect uri is invalid.

1- is there a way to allow all redirect uri? 2- when i build the app with build.phonegap and make the iphone/android app it will work with this redirect uri? if not? what is the redirect uri that i should put?

dimanche 19 avril 2015

How to limit the number of nodes?(Spritekit)

Hey guys i have a little problem check it out:



override func touchesBegan(touches: Set, withEvent event: UIEvent) {

for touch in (touches as! Set<UITouch>) {

var Location:CGPoint = touch.locationInNode(self)
var Node:SKNode = self.nodeAtPoint(Location)

if(Location.x < self.size.width/2) {

node2.addchild(sprite2)
node1.removeFromParent()
}
if (Location.x > self.size.width/2) {

node1.addchild(sprite1)

node2.removeFromParent()
}


The problem is that when i tap for exmple 10 times on the same side of the screen (lets say the right side) it apppears 10 spritenodes and i can t use "hidden" because of the physicsBody can you guys help me?


facebook number of page views using facebook graph api

I'm using this url for facebook graph api to get page views, and get the following in return:



{
"data": [],
"paging": {
"previous": "http://ift.tt/1IgTnxW",
"next": "http://ift.tt/1IgToli"
}
}


in some queries date time error that must be unix or date time format. I can share you my access token. I urgently need number of page views and also tell me since and until format


Not able to boost my blog in facebook page

I am trying to post Blog on my Facebook page and boost it, but its shows error message saying - specified creative could not be downloaded. enter image description here


Comment using yahoo in Facebook comment plugin

The comment disappears if one clicks on the "comment using" > Yahoo or Hotmail.


how to enable third party commenting ?


how to get similar pages by category and their likes using facebook graph api

i am using this link in facebook grap explorer and it works


http://ift.tt/1HK5N36


but i am trying to access the same data in the given below code without giving id because id gives an error of non existing feilds



function Getpage()
{
FB.api("/search?q=education?education&type=page", function (response) {

});

}


it does not work but same if i try acessing in that way it gives takes http/graph/facebook/ as id



function Getpage()
{
FB.api(" /http://ift.tt/1HK5N36", function (response) {
var i = 25;
var g = response.data[i];
});

}


it doesnot return the same data as in graph explorer the above link returns i tried acess token even but using javascript how should i get similar pages of same category? like this the first link returns in graph explorer



{
"data": [
{
"category": "Education",
"name": "EducationUSA",
"id": "72457958318"
},
{
"category": "Education",
"category_list": [
{
"id": "108051929285833",
"name": "College & University"
},
{
"id": "163917800330437",
"name": "Admissions Training"
},
{
"id": "181053558607965",
"name": "Youth Organization"
}
],
"name": "Education Diffusion",
"id": "180364528818411"
},


how to get their likes also?


Facebook Login not working when already authorized

I am trying to implement Login With Facebook using Facebook SDK 3.23.0. Everything is working fine until when user is already authorized Facebook and user is already logged in Facebook Application. When I tap on Log in With Facebook button It's not showing me any dialog if user is already signed in Facebook application as well as already given authorization permission.


I am not able resolve this wearied behavior of Facebook while making login.


items about "would like to post to Facebook for you"

I write a program that says "Program would like to post to Facebook for you" what item should i submit for review? is that "publish_actions"?


but Facebook just say "It looks like you haven't made any API requests to publish content with the publish_actions permission in the last 30 days. You, or any account from Roles, needs to test this app with this permission before you can submit it for review."


Then I add my account to testers and test the program,but nothing changed, why? what should i do?


Message tags on wall post with koala ruby gem

Is it possible to write a wall post tagging users or pages inside the message?


I was told that the following command should work, but it is not



graph = Koala::Facebook::API.new(page_token)
graph.put_wall_post("cool @[PAGE_ID:AnyText] test")

How to control the number of nodes when i tap? Spritekit

Hi guys im new making iOS games (spriteKit) and im making a game where im using two spritenodes (left, right) but is the same hero. The game is about evading obstacles that are comming from two sides so when i tap one of the sides the opposite node should disappear and appears on the right place. The problem is when i tap more than once on the same side of the screen it appears more nodes and i dont want that. Here is the code:



override func touchesBegan(touches: Set, withEvent event: UIEvent) {

for touch in (touches as! Set<UITouch>) {

var Location:CGPoint = touch.locationInNode(self)
var Node:SKNode = self.nodeAtPoint(Location)

if(Location.x < self.size.width/2) {

node2.addchild(sprite2)
node1.removeFromParent()
}
if (Location.x > self.size.width/2) {

node1.addchild(sprite1)

node2.removeFromParent()
}

Open URLs in Native FB App

I've been reading on deep linking and App Links and such.


I was just wondering if it was possible on Android to simply share a URL of a Facebook Profile or Album on say WhatsApp or Telegram and get it to open in the native FB app instead of in the browser.


If not possible, why is this so?


Facebook open graph link

Is there a way to define the facebook Open Graph meta tags (OG) with a link?


For example I have a single page website with several anchors.


At each anchor I have a sub heading and an image


The url would be : http://ift.tt/1GLjCz9


When using the facebook share function I'd like to define that URL with a defined sub heading as the title, and the the image in the sub heading as the image that is shared on facebook.


Is this possible? Is it possible with PHP or JS?


Facebook Completion Handler returning null?

I am using the Facebook API and I am using the FBRequestConnection.startForMeWithCompletionHandler method to get a user's profile picture. This was working fine for me until recently where suddenly my application constantly fails because the id parameter returns null. I looked up the documentation and it shows the following as the parameters: [FBRequestConnection startForMeWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error)


This is my code so far:



FBRequestConnection.startForMeWithCompletionHandler { (connection, user, error) -> Void in
//Get individual's profile picture
let url = NSURL(string: "http://ift.tt/1GaqSEG")
let urlRequest = NSURLRequest(URL: url!)
//Asynchronous request to display image
NSURLConnection.sendAsynchronousRequest(urlRequest, queue: NSOperationQueue.mainQueue()) { (response:NSURLResponse!, data:NSData!, error:NSError!) -> Void in

// Display the image
let image = UIImage(data: data)
if(image != nil){
completion(result: true, image: self.profilePic.image)
}
}

}


Oddly enough, the user parameter in the function always returns nil and I'm not sure why. I have looked at multiple links on stack overflow and most say that either my session is inactive or I am logged out, but I have tested both and my session is indeed active. Moreover, I looked in my errors array and I got a HTTP 200 Status Code meaning that my connection works. I get two other errors, com.facebook.sdk:ErrorInnerErrorKey and com.facebook.sdk:ErrorSessionKey but upon looking into these errors, I can't find anything about them. Any help would be appreciated. Thanks!


Compile Error using Parse and Facebook

I'm trying to integrate Parse and Facebook's SDK with my app using Xcode 6.3 and am getting these errors when attempting to build:


Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_FBSDKAppEvents", referenced from: __TMaCSo14FBSDKAppEvents in AppDelegate.o "_OBJC_CLASS_$_FBSDKApplicationDelegate", referenced from: __TMaCSo24FBSDKApplicationDelegate in AppDelegate.o "_OBJC_CLASS_$_PFAnalytics", referenced from: __TMaCSo11PFAnalytics in AppDelegate.o "_OBJC_CLASS_$_PFFacebookUtils", referenced from: __TMaCSo15PFFacebookUtils in AppDelegate.o "_OBJC_CLASS_$_Parse", referenced from: __TMaCSo5Parse in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)


I don't know what this means, but I've tried many other solutions, such as cleaning, deleting the Derived Data folder, checking all of my frameworks, and I still can't solve the problem. If anyone has any idea how to fix this I would be very grateful. Thank you for your time.


Facebook login with passport.js, sails.js API and ember.js

I'm setting up this Sails project where I use PassportJS, via sails-generate-auth, and JWTs - using this as a guide - to login. I'm trying to decouple the api from the Ember app as much as I can so I can use the same API for iOS, etc. Since passport uses callbacks to handle Facebook auth, how can I login via AJAX?


I'm able to successfully login to Facebook via passport js using an AJAX GET to /auth/facebook like so



var url = config.api + '/auth/facebook'
var controller = this;
Ember.$.get( url, function ( data ) {
// This is never called because Facebook redirects
localStorage.private_token = data.token;
controller.transitionToRoute('profile', data.user);
});


but then when Facebook redirects, it goes back to the API, not the frontend app. But if I configure the backend to redirect to the front end app after the callback, I have a dependency on the front end app that I want to avoid. I've never done Facebook auth before but I've used API tokens for a while now.


Is there any way to do what I'm trying to do? Or should I just redirect to the front-end app from passport.callback?


Django - python-social-auth: Facebook returns anonymous user

I'm using python-social-auth on my Django website to connect with social accounts. I've managed to work with with Twitter and Google, but I'm having problems with Facebook. On the URI callback, request.user gives me 'AnonymousUser'. These are my settings:


settings.py:



...
AUTHENTICATION_BACKENDS = (
'social.backends.open_id.OpenIdAuth',
'social.backends.google.GoogleOpenId',
'social.backends.google.GoogleOAuth2',
'social.backends.google.GoogleOAuth',
'social.backends.twitter.TwitterOAuth',
'social.backends.yahoo.YahooOpenId',
'social.backends.facebook.FacebookOAuth2',
'django.contrib.auth.backends.ModelBackend',
)

SOCIAL_AUTH_FACEBOOK_KEY = 'xxx'
SOCIAL_AUTH_FACEBOOK_SECRET = 'xxx'

SOCIAL_AUTH_PIPELINE = (
'social.pipeline.social_auth.social_details',
'social.pipeline.social_auth.social_uid',
'social.pipeline.social_auth.auth_allowed',
'social.pipeline.social_auth.social_user',
'social.pipeline.user.get_username',
'social.pipeline.social_auth.associate_by_email',
'users.pipeline.require_email',
'social.pipeline.mail.mail_validation',
'social.pipeline.user.create_user',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details'
)

AUTH_EXTRA_ARGUMENTS = {'redirect_uri': PROJECT_DOMAIN + '/auth/'}

...


urls.py



urlpatterns = patterns('',
...
url(r'^auth/$', views.auth_complete),
...


views.py



...
def auth_complete(request):
return HttpResponse(request.user) # this gives me AnonymousUser
...


Please warn me if I omitted any setting.


Get FB status with UID

I want to get someone's FB status, who is friend of the logged in user. I'm trying curl http://ift.tt/1JkFz5L; isn't this right? I have given all the appropriate permissions.


Detect when Facebook loads extra pages

First off, i'm new to programming/javascript. I'm trying to detect when facebook loads new pages if you scroll down to the bottom of a page or a timeline page. And then when it has detected that I want to run a JS script. I've looked in the source-code of facebook and I've found this:



<a class="pam uiBoxLightblue uiMorePagerPrimary" onclick="(JSCC.get(&quot;ji9EntmPx4Hav1HbcgX0&quot;) &amp;&amp; JSCC.get(&quot;ji9EntmPx4Hav1HbcgX0&quot;).getHandler())(); return false;" href="#" role="button">See More Stories</a>


How would I go about and detect when Facebook loads in new pages?


Thanks in advance!


MVC5 Facebook Authentication not working

I have followed this tutorial on how to enable Facebook login on my MVC 5 application, but people are getting the following error:


facebook error


I have an SSL certification installed on my server, and have that installed on the web application (through IIS).


On Facebook's Developer page I have this:


facebook developer


Why isn't this working?


Facebook ApiGraph Insights from photo

I have an Android app with Facebook login. I am using the ASNE library with the next scopes: read_insights, read_stream, publish_actions, email,public_profile, user_friends.


The user I am login with, has the tester role in the developer console of facebook.


Now, I am saving the token of the user in my server (generated from the phone), and from the android device I send to my server the photo and my server is posting successfully the photo in the wall of the user (using the previous token) and I get back the PostId.


Now, I want to get the insights of this post but I the data object is empty.


I check the token permissions and it is ok:


Token debugger


And the screenshot of the insights response:


enter image description here


If I post the picture in a page, I get the insights from this post. For example:


enter image description here


Thanks for all, and sorry for my bad english


how to get friends count of an random user in facebook

Is there a way to get friends count of a random user in Facebook?


i was tring to make request



1579961218908589/friends


on Graph API Explorer and it always give me empty data. thx


Error: Domain "com.facebook.sdk" - code: 5

I keep getting an error when I am trying to get an individual's profile picture. I get the error com.facebook.sdk - code:5 and I'm not too sure why I am getting it. This is my code:



FBRequestConnection.startForMeWithCompletionHandler { (connection, user, error) -> Void in
//Get individual's profile picture. My error occurs on the NEXT line.
let url = NSURL(string: "http://ift.tt/1GaqSEG") //This is where my error occurs
let urlRequest = NSURLRequest(URL: url!)
//Asynchronous request to display image
NSURLConnection.sendAsynchronousRequest(urlRequest, queue: NSOperationQueue.mainQueue()) { (response:NSURLResponse!, data:NSData!, error:NSError!) -> Void in

// Display the image
let image = UIImage(data: data)
self.profilePic.image = image

}
}


In the code above, the line that gives me issues is the let url = NSURL(...) line and it simply returns nil. I'm really puzzled by this error because when I looked up different solutions online, they said it was because my FBSession was not active. However, I had a statement, if FBSession.activeSession().isOpen right above this code and the code still failed on the let url = NSURL(...) line. Strange this is that this code seems to work sometimes and more recently it has been giving me a lot of issues. When I first implemented it, it was working fine. If it helps, I get 3 different errors saying com.facebook.sdk:ErrorInnerErrorKey, com.facebook.sdk:ErrorSessionKey, and com.facebook.HTTPStatusCode 200. Any help would be appreciated! Thanks.


EDIT: I also tried to add in FBSession.openActiveSessionWithAllowLoginUI(false) in the func applicationDidBecomeActive(application: UIApplication) method and it seems to fix things after the first run but on any runs after that it doesn't seem to work.


How do App Developers make pre-populated texts/URL's on Facebook SHARE button?

A very popular iOS game that was number 1 downloaded app for about a month, last month has a pre-populated message text on Facebook SHARE button stating how many points the user scored and a link to download the Mr Jump game in the App store. Facebook policies state you can't use pre-populated messages, it must be 100% user generated. So no links as well. Since App developers are still doing it, then what's the work around, around the Facebook policies to be able to do it? Is there a needed code for this work around?


GraphApi - verify if a Facebook page allow commenting with images

I was wondering if there's a way to know if a given page is allowing users to comment posts using images as attachment.

Right now, on the Application i'm making, you can comment with an image only to pages that support it. Otherwise, it would give an error. I want to know if there's a way to do it and if not, is there an alternative to prevent the user from commenting a picture when image commenting is disabled on the page.


I looked everywhere (Graph api docs, sites, forums, etc...) but couldn't find anything.


Can i detect if user clicks on facebook follow button?

talking about this : Facebook Follow button there is FB.Event.subscribe() for Like button but it is not for follow button at Facebook developers page.


Facebook doesn't allow pre-populated iOS SHARE button messages

So Facebook apparently doesn't allow pre-populated messages/links of any kind in your iOS app's shared button. However, in Game Center when you click on the shared button Apple pre-populated a message stating "check out my score playing...". If someone decides to share through GameCenter this is a message I can't get rid of. So how does this work with pre-populated messages with Facebook not being allowed in Share button pop up texts?


Null Value for Facebook ID when trying to Login to Windows Phone 8.1 App

I'm trying to integrate Facebook Login with my app. I've managed to log in, get the Profile Name, but not the Profile Picture. Upon inspection I realized it's due to null value in facebookID. How to fix this?



private void LoadUserInfo()
{
var UISyncContext = TaskScheduler.FromCurrentSynchronizationContext();
FBSession fbSession = FBSession.Instance;
var fb = new FacebookClient(fbSession.Token.AccessToken);

fb.GetCompleted += (o, e) =>
{
if (e.Error != null)
{
Task.Factory.StartNew(() =>
{
Debug.WriteLine(e.Error.Message);
}, new System.Threading.CancellationToken(), TaskCreationOptions.PreferFairness, UISyncContext);
return;
}

var result = (IDictionary<string, object>)e.GetResultData();

Task.Factory.StartNew(() =>
{
TextBlock user_Name = FindChildControl<TextBlock>(homeSection, "user_Name") as TextBlock;
Image user_Image = FindChildControl<Image>(homeSection, "user_Image") as Image;
Debug.WriteLine("ID: " + fbSession.Token.AccessToken);
var profilePictureUrl = string.Format("http://ift.tt/1qxNyGU}", fbSession.Token.FacebookId, "square", fbSession.Token.AccessToken);
user_Image.Source = new BitmapImage(new Uri(profilePictureUrl));
user_Name.Text = String.Format("{0} {1}", (string)result["first_name"], (string)result["last_name"]);
}, new System.Threading.CancellationToken(), TaskCreationOptions.PreferFairness, UISyncContext);
};

fb.GetTaskAsync("me");
}


What am I doing wrong? How to fix this?


Error inflating class com.facebook.widget.LoginButton with Facebook SDK 4.0.1

I know this is a very common question, btu I have read through all the stack overflow questions without finding an answer.


I'm trying to integrate the Facebook Login Button using Facebook SDK 4.0.1 added through Gradle, but I get the following error.



java.lang.RuntimeException: Unable to start activity ComponentInfo{se.speedle.android/com.bryderi.speedle.android.activity.MainActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class com.facebook.widget.LoginButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class com.facebook.widget.LoginButton
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.bryderi.speedle.android.activity.MainActivity.onCreate(MainActivity.java:36)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.widget.LoginButton" on path: DexPathList[[zip file "/data/app/se.speedle.android-1.apk"],nativeLibraryDirectories=[/data/app-lib/se.speedle.android-1, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.view.LayoutInflater.createView(LayoutInflater.java:559)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.bryderi.speedle.android.activity.MainActivity.onCreate(MainActivity.java:36)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)


I can see the LoginButton class in Android Studio, so it kind of works


Here's my build.gradle dependencies



dependencies {

aspects 'org.robobinding:robobinding:0.8.9'
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M1'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:support-v13:21.0.3'

compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
compile 'me.alexrs:recyclerview-renderers:1.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
}


Here's my layout



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://ift.tt/nIICcg"
xmlns:facebook="http://ift.tt/GEGVYd"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="20dp" >

<com.facebook.widget.LoginButton
android:id="@+id/connectWithFbButton"
style="@style/com_facebook_loginview_default_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_horizontal"
android:text=" connect_with_facebook"/>
</LinearLayout>


And the relevant parts of my activity



@Override
protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

FacebookSdk.sdkInitialize(getApplicationContext());


callbackManager = CallbackManager.Factory.create();


setContentView(R.layout.activity_main);

// Set a Toolbar to replace the ActionBar.
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

// Find our drawer view
dlDrawer = (FragmentNavigationDrawer) findViewById(R.id.drawer_layout);
// Setup drawer view
dlDrawer.setupDrawerConfiguration((ListView) findViewById(R.id.lvDrawer), toolbar,
R.layout.drawer_nav_item, R.id.flContent);
// Add nav items
dlDrawer.addNavItem("Home", "First Fragment", ClassifiedsFragment.class);
dlDrawer.addNavItem("Favourites", "Favourites", ClassifiedsFragment.class);
dlDrawer.addNavItem("My Items", "Items", ClassifiedsFragment.class);
dlDrawer.addNavItem("Settings", "Settings", ClassifiedsFragment.class);


//dlDrawer.addNavItem("Second", "Second Fragment", SecondFragment.class);
//dlDrawer.addNavItem("Third", "Third Fragment", ThirdFragment.class);
// Select default
if (savedInstanceState == null) {
dlDrawer.selectDrawerItem(0);
}
}

How to remain number as string in PHP

i have created services that request FB for real-time updates. The result that return by Facebook is in JSON type. Its like this:



{"object":"page","entry":[{"id":"248874468652581","time":1428654497,"changes":[{"field":"feed","value":{"item":"comment","verb":"add","comment_id":"248878481985513_367520770121283","parent_id":"248874468652581_248878498652178","sender_id":1490984774509544,"created_time":1428654497,"sender_name":"Orlig Anbiz","message":"helo"}}]}]}


Then i want to keep all data in this JSON to store in database. My problem is at



"sender_id":1490984774509544,


Which is the sender id (number without double qoutes). Then when I put this sender_id in var, it is automatically convert it into float. My php code:



$sender_id = strval($json_array['entry'][0]['changes'][0]['value']['sender_id']);
echo nl2br("The Sender ID = $sender_id \n");


My result for sender_id will become like this:



The Sender ID = 1.4909847745095E+15


I dont want that sender ID change to float but keep as string which is supposed to display like this:



The Sender ID = 1490984774509544


Please Help. Thank You in advance.


OG Tags via php

I'm trying to make a very simple game.


a) I let the user input his name;

b) I put this name in a canvas;

c) I generate an image (base64) whit canvas.toDataRL() and I create an image file sending the base64 URI to a php file. I'm doing it with this code:


JAVASCRIPT:



var canvas = document.getElementById("myCanvas");
var dataURL = canvas.toDataURL("image/jpeg", 0.2);
//console.log(dataURL);

// post the dataUrl to php
$.ajax({
type: "POST",
url: "upload.php",
data: {image: dataURL}
}).done(function( respond ) {
console.log(respond);
});


UPLOAD.PHP



<?php
if ( isset($_POST["image"]) && !empty($_POST["image"]) ) {
$dataURL = $_POST["image"];
$parts = explode(',', $dataURL);
$data = $parts[1];
$data = base64_decode($data);
// create a temporary unique file name
$file = "img/" . UPLOAD_DIR . uniqid() . '.png';
// write the file to the upload directory
$success = file_put_contents($file, $data);
print $success ? $file : 'Unable to save this image.';
}
?>


d) Now I'd like to use this image that I've created to set the og:image tag (to share it on Facebook)! How can I do? I've honestly no idea.


Thank you!


Facebook groups posting - security issue

I'm trying to make an application for my colleague. Since he has many fb groups, he wants to be able send posts automaticaly (not spam) to selected groups. I have written a small script which obtain access_token and then this script sends the posts.


The problem is, that facebook probably things that it's an unauthorized posting from his account which is not..


Here is the message he gets after tried to send a post to one of his groups:



We’ve Detected Suspicious Account Activity
It looks like your account has been spreading spam due to another person or website gaining access to some of your sensitive account information.

Sometimes this happens when spammers create a fake Page that offers you a great deal (ex: free plane tickets) in return for a specific piece of information from your account, like an access token.

We’ve secured your account, and will help clean up any recent account activity that didn’t come directly from you.


Is there a way to tell the facebook that no unwanted website or person gaining his info?



def post_to_1_group(test):

graph = facebook.GraphAPI(oauth_access_token)
groups = graph.get_object("me/groups")
group_id = groups['data'][1]['id']
graph.put_object(group_id, "feed", message=test)

Facebook, how to share a link thats just an image,

This Facebook post http://ift.tt/1OZW8aN looks like a photo post but is actually link, it clicks through to an external site.


I have tried sharing a link, removing all og metatags from my site except image path but it doesn't look like that.


The closest I can get is the default link behaviour without any title description, so just an image with the url besides/below rather than displayed over the top of the bottom of the image.


So what sort of post is this?


Thanks for any help.


Facebook/Twitter posts SHARE button confusion

I've read on Facebook's guidelines with Share button for iOS Do's and Dont's.


Does Facebook not allow there to be a custom message by the developer when the user shares their Facebook post?


If I create the following post for example: "I just scored %i points". That %i would be depending on how many points user scored in game. Am I allowed to include this in Facebook SHARE button posts? I think Facebook said no, but I see a lot of game developers are doing it anyways.


So is it allowed or not? I think it's allowed for Twitter, uncertain for Facebook. Do you do it as a developer if you use a Facebook/Twitter SHARE button?


Android Studio with Facebook (Login+Share Function)

I am a beginner who making an android app by using android studio which need Facebook login+share function.


To add a Share button add the following code snippet to your view:



ShareButton shareButton = (ShareButton)findViewById(R.id.fb_share_button);
shareButton.setShareContent(content);


I don't understand my view is in which class? Where actually should i put the code?


Thank you in advance.


Xcode Debug Area says Facebook/Twitter posts invalidated

I created 2 separate share buttons, one for Facebook the other for twitter in my iOS game app.


The debug area states:


plugin com.apple.share.Facebook.post invalidated


plugin com.apple.share.Twitter.post invalidated


why does it say invalidated when the share button works and the posts get sent to Facebook?


Method to attach local images to actions seems missing

Since using the standard SharePhoto doesn't allow you to add your own description, captions and other stuff. I am using OpenGraphStories share dialog. Now the problem is the facebook documentation says :


enter image description here


BUT!!! I cant find the addPhoto() anywhere. I have searched their references and even the pre 4.0 docs.


Code snippet:



ShareOpenGraphObject place = new ShareOpenGraphObject.Builder()
.putString("og:type", "place")
.putString("og:title", "sample title")
.putString("og:description", "sample description")
.putString("place:location:latitude", "Sample Location: Latitude")
.putString("place:location:longitude", "Sample Location: Longitude")
.build();

ShareOpenGraphAction publish = new ShareOpenGraphAction.Builder()
.setActionType("news.publishes")
.putObject("place", place)
.build();

SharePhoto photo = new SharePhoto.Builder()
.setBitmap(mCombinedBitmap)
.setUserGenerated(true)
.build();

ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
.setPreviewPropertyName("news")
.setAction(publish)
.build();

mShareDialog.show(ShareActivity.this, content);


-EDIT-


i found this putPhoto(String key, SharePhoto photo) which you can use in a ShareOpenGraphObject although I don't know the key yet. There is only the "og:image" but it's type only accepts URL.


F SDK 4.0.0: GraphRequest from facebook returns null

I have the following code and what I want to obtain is user's friends names, user's friends profile pictures and user's friends facebook id:



public void testFunction(final com.facebook.AccessToken access_token){
GraphRequest request = GraphRequest.newMeRequest(
access_token,
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(
JSONObject object,
GraphResponse response) {
if(object != null) {
Log.wtf("FIRST", "JSONOBJECT: IS NULL");
}else {
Log.wtf("FIRST", "JSONOBJECT: " + object.toString());
}

if(response != null) {
Log.wtf("FIRST", "RESPONSE: IS NULL");
}else {
Log.wtf("FIRST","response: "+response.toString());
}
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,link");
request.setParameters(parameters);
request.executeAsync();
}

public void getFriendsInformation(final com.facebook.AccessToken access_token) {

GraphRequestBatch batch = new GraphRequestBatch(
GraphRequest.newMeRequest(
access_token,
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(
JSONObject jsonObject,
GraphResponse response) {
if(jsonObject != null) {
Log.wtf("FIRST", "JSONOBJECT: IS NULL");
}else {
Log.wtf("FIRST", "JSONOBJECT: " + jsonObject.toString());
}

if(response != null) {
Log.wtf("FIRST", "RESPONSE: IS NULL");
}else {
Log.wtf("FIRST","response: "+response.toString());
}
// Application code for user
}
}),
GraphRequest.newMyFriendsRequest(
access_token,
new GraphRequest.GraphJSONArrayCallback() {
@Override
public void onCompleted(
JSONArray jsonArray,
GraphResponse response) {
if(jsonArray != null) {
Log.wtf("SECOND", "jsonArray: IS NULL");
}else {
Log.wtf("SECOND", "jsonArray: " + jsonArray.toString());
}

if(response != null) {
Log.wtf("SECOND", "RESPONSE: IS NULL");
}else {
Log.wtf("SECOND","response: "+response.toString());
}
}
})
);
batch.addCallback(new GraphRequestBatch.Callback() {
@Override
public void onBatchCompleted(GraphRequestBatch graphRequests) {
// Application code for when the batch finishes
}
});
batch.executeAsync();
}


When I run the code with the accessToken IS NULL is printed in the designated logs. Shouldn't this work?


Stop Facebook probing a site for content with PHP

Okay, so when you post a link on Facebook, it does a quick scan of the page to find images and text etc. to create a sort of preview on their site. I'm sure other social networks such as Twitter do much the same, too.


Anyway, I created a sort of "one time message" system, but when you create a message and send the link in a chat on Facebook, it probes the page and renders the message as "seen".


I know that the Facebook probe has a user agent of facebookexternalhit/1.1 (+http://ift.tt/QzhITw), so I could just block all requests from anything with that user agent, but I was wondering if there's a more efficient way of achieving this with all sites that "probe" links for content?


facebook can't resolve URL

Am trying to build a facebook share button, but I keep getting an error message inside the share popup screen when I click the button



Could not resolve object at URL http://localhost:8080/App/templates/property-template.xhtml?propertyId=1#


I tried to use encodeURI and encodeURIComponent but got same result.


am using jsf with javascript to accomplish this.


JSF



<a href="#" class="btn btn-sm btn-round btn-o btn-facebook"
onclick="share(window.location.href);"><span class="fa fa-facebook"></span> Facebook</a>


javascript



function share(url) {

console.log(url);
FB.ui({
method : 'share',
href : url,
}, function(response) {
if (response && !response.error_code) {
alert('Posting completed.');
} else {
alert('Error while posting.');
}
});
}

How to change a login box to a user profile after login using Visual Studio?

So I am in the process of building a website on Visual Studio professional 2013. I have a login box set up at the top of the page. Once a user is registered their details get stored in a database. So when they click login, I want their profile to appear instead of the login box. How do I do this? Also, if anyone knows how to do something similar using facebook login, that would help too. Thanks. Sean.


Error while importing latest facebook 4.0.1 sdk into eclipse for login as facebook functionality

Error Logs


AppLink cannot be resolved to a type

DialogFragment cannot be resolved to a type

Fragment cannot be resolved to a type


Sometimes it shows the error of android:textAllCaps not resolved.


I tried to run with the jdk 1.6 as well but not solving my problem.


Thanks Vishvendu Palawat


I want to create Dynamic Products Ads for facebook but, there is no " Product catalog sales " objective while creating a Campaign

I want to build dynamic product ads for facebook, in my Business Manager Account I added Ad Account having Indian Currency and Timezone. I have created product catlog and also setup the product feed. I tried to Create Campaign in power editor for dynamic ads having objective "product sales catlog" but, there is no such objective.


desktop app for facebook, in python

can we create a desktop app which can update user's status on facebook after the user provides the login and password for his/her account, using python language? I have searched everywhere for answers but probably got answers above my level of understanding. I only came across answers that address the issue if one is trying to make an app for a website. some detailed explanation would be appreciated.


thanks in advance, regards, Ali.


Submit form in iframe

I have iframe, in the site is form (post) with button type submit


I want like something:



iframe.form.submit()


This not work - $("#iframeid").contents().find("form").submit();


How to do?


Thanks


How to Build a facebook app that uses facebook database?

I'm trying to build a facebook app that can display current playing song on the user's profile page, via a link to the app or preferably embedded on the profile page.


I read online, and found that facebook doesn't allow iframes on profiles. Due to this, I'm hoping to display tracks played via the right-panel on "home" page @ facebook.com. Spotify posts this perfectly to display what anyone is listening to via the right sidebar. I read that spotify is a facebook partner due to which any number of posts/updates are allowed via spotify. Is this valid without any payment too?


For example, I need to either post each song played to user's profile, and if that's not allowed, then a link on the profile to visit a facebook app that has the content to be displayed (now playing song).


I'm good at javascript and php, but I don't know a way of doing this... this is what I have in mind:


Let



  1. Let users sign up for the app, then let them download AMIP (tool require to log playing songs on major media players).

  2. Once they download and set it up, they should add something like: http://ift.tt/1yI0lw1 to the AMIP settings and that's almost all the settings required.

  3. Another alternative was to create a standalone php application (exe) that would send the data to facebook, and the url in AMIP could be sent to this exe. But I've never created any portable/standalone php app, I only know it exists for non-webserver alternative purpose. I thought this would required only for login purpose, cause then the app won't be secured, anyone could just enter anyone's userid in AMIP url for generating false music logs.

  4. Once the settings have been done, user starts listening to music and with AMIP the song info goes to facebook app, where it collects (if it's database driven), about 5 most recent songs with their song info.

  5. So anyone visiting the profile, can either see embedded detail, or visit via link to the app page to see the friend's current song playing info.


Now I don't know how to get this done. Any suggestions or links to tutorials/code-snippets/or someone who is good at this could just create and share the app link with me? You may consider this as an idea for a facebook app. And probably share it on github too!


Thanks.


Facebook F8: Mem Models Concept

in the talk Facebook on iOS: Inside the "Big Blue App" is Facebook talking about a data model layer concept called "Mem Models".


I find this concept quite interesting and I was wondering is Facebook developing a open source library for it? Or how is the best way to use this concept. Do you have any infos, tutorials, links to articles or so for me?


Thanks


RewriteRule in .htaccess for AngularJS prerendered posts

following this tutorial I'm trying to establish a rewrite rule for social bots in .htaccess, so my prerendered Angular SPA posts can be posted on social networks.


Prerendered posts seem to work fine:



http://ift.tt/1zxFeHz


However, the Facebook debugger still doesn't receive proper data from actual post link:



http://ift.tt/1cLGzpt


My .htaccess code:



ErrorDocument 404 /index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_USER_AGENT} (Facebot|Twitterbot|Pinterest|Google.*snippet)
RewriteRule service/(\d*) http://ift.tt/1zxFeHB [P]
</IfModule>


Would appreciate any suggestions in modifying the file.


Initialize Facebook Utils

I am trying to use the Parse login and sign up views. Specifically I am trying to log in using facebook with the parse login view.


Everything works fine except when i click the "login with facebook button" the app crashes. It gives me the following crash report


'You must initialize PFFacebookUtils with a call to +initializeFacebookWithApplicationLaunchOptions'


I have searched everywhere and apparently I am meant to add in [PFFacebookUtils initializeFacebook]; However initializeFacebook gives me an error, I think its outdated.


Apparently with the new code I am meant to write this [PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:(NSDictionary *)launchOptions]; but it gives me an error when I try run the app saying 'You have to call setApplicationId:clientKey: on Parse to configure Parse.' which is weird because I have called setApplicationId?


Can anyone please help me out! It would be greatly appreciated, Thanks.


Why FB like button in my website is showing only for users from US ip address?

I have added a FB like button to my website last week and i found like button didnt appear in my website. After lots of troubleshooting, came to know that, like button is showing up only for US ip addtress and its not showing up if an user is browsing from non-us IP address. Please help me in this


Using og:image For Custom Feed Aggregator

I'm working on a custom RSS feed aggregator which parses RSS feeds from various news-type sites, shows a summary and links back to the original site. Nothing terribly exciting.


I'm trying to get an image for each article as well by using the original page's og:image meta tag.


However, I'm finding that a lot of the URLs in the og:image tag return 400, 403 or 404 errors when programatically accessing the images.


Some seem to check for a browser's User Agent string in the headers, so for testing only, I've set my User-Agent string header to that of Safari's: this gets some og:image links working, but it is not an acceptable solution (a crawler masquerading as a browser).


This does not work for the majority of images though, which continue to return 400/403.


Assuming that all the sites I've tested do not have missing image files and they are proactively preventing anyone other than Facebook/Twitter from using those images, is there any other way to reliably and programmatically retrieve images to display in an RSS aggregator?


Feedly etc al all seem to have images for the vast majority of their aggregated content, so I'm not clear as to why I'm having such difficulty.


How to get the IDs of the Facebook users who shared a post in PHP? [on hold]

How to get the IDs of the Facebook users who shared a post, using PHP? For example all the people below:


http://ift.tt/1yCkuDe


i want all the user ids that are populated on the above page i have tried to scrape the page but no vain can anybody help me


Rails 4, devise, omniauth, facebook: problems when regular sign up involves nested forms

I am trying to set up facebook login integration with omniauth and devise.


Note that I have a MEMBER model which contains the devise info and a USER model that contains the member profile info (to keep them separate)


On the sign up page, the user has a nested form in the member sign up form and receives all the user data at that time. Once the member is saved, the email value for the saved member is also entered into the user table like so



class Member < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable, :omniauthable

after_save :update_user

def update_user
user.email = self.email
user.save
end


I have the standard model method for the facebook data processing.....



def self.process_omniauth(auth)
where(provider: auth.provider, uid: auth.uid, email: auth.info.email).first_or_create do |member|
member.provider = auth.provider
member.uid = auth.uid
member.email = auth.info.email
end
end


But of course, in this case, there is no nested form so the 'user' is not instantiated and it throws an error when the update_user method is called on saving the member.


How can I modify this method above to instantiate a new user, when signing up via the facebook pathway?


Facebook connect and phonegap

i'm making a phonegap web application and i need to put Facebook's login in it.


i was not able to install phonegap's Facebook login but i find this very interesting library http://ift.tt/PSB2l0 i installed and it works fine on my iphone with phonegap desktop app (by using phonegap localhost as Valid OAuth redirect URIs in Facebook for example: http://localhost:3000/pathto/index.html) but when i open my local project from file://pathto/index.html it doesn't works, the redirect uri is invalid.


1- is there a way to allow all redirect uri? 2- when i build the app with build.phonegap and make the iphone/android app it will work with this redirect uri? if not? what is the redirect uri that i should put?


:app:dexDebug UNEXPECTED TOP-LEVEL EXCEPTION:

I am building my project and after i add some codes from facebook for integration I faced :app:dexDebug UNEXPECTED TOP-LEVEL EXCEPTION: errors


Below is my build.gradle coding



apply plugin: 'com.android.application'


android { compileSdkVersion 20 buildToolsVersion "21.1.2"



repositories {
mavenCentral()
}

defaultConfig {
applicationId "com.hong.iqfunguess"
minSdkVersion 9
targetSdkVersion 21
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
} }


dependencies {



compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:support-v4:20.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile project(':facebook') }


The errors is show as listed below


Error:Execution failed for task ':app:dexDebug'.



com.android.ide.common.internal.LoggedErrorException: Failed to run command: E:\Android SDK\build-tools\21.1.2\dx.bat --dex --no-optimize --output C:\Users\Admin\Desktop\IQFunGuess April19\app\build\intermediates\dex\debug --input-list=C:\Users\Admin\Desktop\IQFunGuess April19\app\build\intermediates\tmp\dex\debug\inputList.txt Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lbolts/AggregateException; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) at com.android.dx.merge.DexMerger.merge(DexMerger.java:189) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303) at com.android.dx.command.dexer.Main.run(Main.java:246) at com.android.dx.command.dexer.Main.main(Main.java:215) at com.android.dx.command.Main.main(Main.java:106)



What's the problems? Thank you.


How to autopost to facebook page with app id

How to post to Facebook page with the App ID & Secret & Page ID without need to login with the user Admin of the page to get access token, the App owner who is the Admin of the page shouldn't be enough to auto post !?


I am using PHP & SDK4 of Facebook API.


Swift facebook SDK cancel share dialog

When I click on Cancel or Share button, the dialog always take me to my Facebook page. Is there anayway to make it return to my app when I click on Cancel or Share button. Thanks so much and sorry for my bad English.


This is my Facebook Dialog image http://ift.tt/1HlW1Uz


This is my Facebook Dialog showing code image http://ift.tt/1HlW2aN


P/s: I cannot post image here :(


ParseFacebookUtils [V4-1.9.1] logInWithReadPermissionsInBackground invalid date

Calling logInWithReadPermissionsInBackground always return null user and invalid date error



com.parse.ParseRequest$ParseRequestException: Invalid date


I'm using ParseFacebookUtils [V4-1.9.1]


here is my code



private void onLoginUserClicked ()
{
final List<String> permissions = new ArrayList<String>();
permissions.add("public_profile");
permissions.add("user_status");
permissions.add("user_friends");

ParseFacebookUtils.logInWithReadPermissionsInBackground(LoginActivity.this, permissions, new LogInCallback() {
@Override
public void done(ParseUser user, ParseException err) {
if (user == null) {
Log.d("MyApp", "Error: "+err);
} else
{
if (user.isNew()) {
Log.d("MyApp", "User signed up and logged in through Facebook!");
} else {
Log.d("MyApp", "User logged in through Facebook!");

}
}
}
});
}


nothing up-normal i cannot overcome this point any help?


couldn't make Android ParseFacebookUtils.initialize(this) to work

I added this to MyApplication .create() method



FacebookSdk.sdkInitialize(getApplicationContext());
Parse.initialize(getApplicationContext(), PARSE_APP_ID,PARSE_CLIENT_KEY);
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
ParseFacebookUtils.initialize(this);


Error:(30, 39) error: incompatible types: MyApplication cannot be converted to String ! initialize function take Context as a parameter so why it's not working ?!!!



public static void initialize(android.content.Context context) { /* compiled code */ }

How make Splash Screen/LaunchScreen to show once?

I am having a weird behavior with the Launch Screen after I login with Facebook. (Already updated to the new SDK 4/19/2015). Every time that the user returns to the main page from Facebook login (whether it's successful or not) ... the application's launch screen reloads again. Is there any way to not allow the launch screen to reload again. I only want it to load when the user first opens the application -just once ...no more than that.


Thank you!


Get all post from a friend in Facebook

I would like to get/download all the posts on a friend's wall in Facebook (at least the text, although most of these posts also have images).


Is there any easy way to do that (using any script, application, procedure, etc)?


Thanks in advance.


samedi 18 avril 2015

Facebook Graph Video API Errors

I'm using a little python script running via cron job and Facebook's Graph Video API for that posts videos to a page using video URLs that look like this:


http://ift.tt/1yCc5Ad


I am using the Non-Resumable Upload method because it requires less steps, allows me to pass video URLs instead of locally hosted files, and I also don't need to pass video file sizes over to the API like you need to do with the Resumable Upload method. Usually my video source is an MRSS or JSON feed, and video files sizes aren't always available in the feed. My Python script is pretty basic, just loops through the feed using feedparser, but maybe that's a bad approach and Facebook's video API doesn't like receiving multiple videos in a row?


Every 12 hours I'm uploading a batch of 5-8 videos and 1 out of every 6 or so return this error even though the video URLs are perfectly functionality:



"code":389,"error_subcode":1363057


Here's the full error message I'm getting during upload:



{"error":{"message":"Unable to fetch video file from URL.","type":"FacebookApiException",**"code":389,"error_subcode":1363057**,"is_transient":false,"error_user_title":"Unable to fetch video file from URL","error_user_msg":"Unable to fetch video file from URL."}}


I've tried searching though Facebook's API Error listing, and can't find either error:


http://ift.tt/1OOuaPk


And not finding much in the Video API documentation. — Has anyone seen these errors or any clue what limitations (beyond just file size and duration, which I already am aware of and am not exceeding) Facebook's video API/transcoding infrastructure may have?


Why do some Facebook posts from a private group not contain a message field?

The results I get from the Facebook Graph API (all supported versions) on a private FB group differs from what I see when I go to the actual Facebook website. Some of the posts from the private Group's /feed don't contain information such as the "message" property for some reason, even though I can see it on the website.


From Facebook.com:



Christine : Can't go anymore! Selling last minute Front Orchestra tickets to the ...


Ingrid : For Sale: Portable booster seat high chair $20 — Pick up at ...



From the Graph API:



[{
...
"message": "Can't go anymore! Selling last minute Front Orchestra tickets to the ...",

"privacy": {
"value": "",
"description": "",
"friends": "",
"allow": "",
"deny": ""
},
"type": "status",
"created_time": "2015-04-19T00:07:11+0000",
"updated_time": "2015-04-19T04:44:49+0000",
"is_hidden": false,
...

},
{
"privacy": {
"value": "",
"description": "",
"friends": "",
"allow": "",
"deny": ""
},
"type": "status",
"created_time": "2015-04-16T22:11:36+0000",
"updated_time": "2015-04-19T04:41:01+0000",
"is_hidden": false,
...
}]


You will notice that there is only a "message" field in the first post, and not in the second -- although, I don't see any reason that this should be happening.


FYI, I get the same information if I get the post details by fetching the ID of the incomplete post from the graph api.


Is there any way to hack facebook other than physical contact with his system or mob?

Other than phising or social engineering is there any proved way to hack fb account of a person? Or is there a way to steal cookies of a person without physical contact of his mob or system? But not through his connection to a public wifi. . Assume he is far away from me. .


Concern with Facebook's login decoding sign_request performance

I am completely new to the Facebook API. I would like to incorporate Facebook login into my application. I am using the Javascript SDK on the front-end to log the user in and retrieve the user_id and signed_request from Facebook. I then plan to send these two pieces of information via AJAX to my server (either php/hack (hhvm), node, java, or whichever language I can determine is quickest for decoding) every time my logged in user does an action on my application to validate if the user is indeed logged in and is the person they say they are. For me to accomplish this, I need to get decode the signed_request, for example in php:



function parse_signed_request($signed_request) {
list($encoded_sig, $payload) = explode('.', $signed_request, 2);

$secret = "appsecret"; // Use your app secret here

// decode the data
$sig = base64_url_decode($encoded_sig);
$data = json_decode(base64_url_decode($payload), true);

// confirm the signature
$expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true);
if ($sig !== $expected_sig) {
error_log('Bad Signed JSON signature!');
return null;
}

return $data;
}

function base64_url_decode($input) {
return base64_decode(strtr($input, '-_', '+/'));
}


which then I will be able to extract the following JSON object:



{
"oauth_token": "{user-access-token}",
"algorithm": "HMAC-SHA256",
"expires": 1291840400,
"issued_at": 1291836800,
"user_id": "218471"
}


to be able to compare if the user_id the user sent over matches the one in the JSON object. Then if it matches I can complete my business logic (DB manipulation).


My big concern here is a user will be sending many requests to my server, so every time I will need to decode this signed_request which can really kill my server performance. I was thinking I maybe could call Facebook from my server, pass the user_id, and receive the signed_request string, which I can then match with the signed_request string the user sent over from the client_side and see if they match. This would be more efficient, but it does not seem Facebook offers anything like this. Is there any other methods besides the heavy performing decoding to validate a user? I have gone through quite a bit of the Facebook SDK's information but could not find a solution. If I must decode, which language/library would be the best performing at this type of operation?


PS. I plan on using cordova later to create a mobile app so I must use only Javascript on the front end and can't use a server language such as php to create html for the client.


Access facebook pages remotely without standard login process

I am trying to create an application that allows access to MY facebook page. I have registered the application with facebook and have the client id and application secret (easy part).


What i want to do (in the approximate order i wish to perform)




  1. Test if user is an admin of MY website. -> i handle this myself and has nothing to do with the facebook api application itself.




  2. If the user is not an admin. i want the public data of MY page displayed



    • items i want to be able to access are user's feeds, user's photos, user's friends, user's profile




  3. If the user is an admin the user will get added permissions (once again my website will handle the authorization of such user)




    • once a user has been authorized as admin i want to run additional queries to authorize them to post updates, add/delete posts and upload photos.




    • I dont want the admin users to be forced to login as a standard user. Instead i want them to be login in automatically-without any noticeable changes to the website such as redirects.




    • I have been using cURL as the medium between my website and facebook.




    • The problem i face is that without using facebooks standard login process (ie. the individual users have to login using their credentials) i yield no results. From their i cannot get any accessTokens as to edit the pages i need user access tokens.



      1. Once this background login is completed i can use it to authorize the access tokens and have the user act on behalf of the page itself. I DO NOT WANT THE USER TO ACT AS THEMSELVES. I WANT THE USER TO ACT ON BEHALF OF THE PAGE.




    • odvisiouly, i cannot give every user this capability and that is why i handle this on my website.






Currently i am using the following code(ive tried about two dozen different variations to try and get this working and i have nothing yet)



//SET DEFAULT APP VARS
public $cookie_file_path = '/var/www/html/cookie.txt';
public $appId = 'CLIENT ID';
public $appSecret = 'APP SECRET';
public $pageId = 'PAGE ID';
public $redirectUri = 'REDIRECT URL';
public $scopes = 'SCOPES';


//GET URL CODE
function getCode(){
try{
//TEST FOR SET VARS
if(!isset($this->appId) || !isset($this->redirectUri)){
throw new Exception ("You have not set the application credentials");
}

//MAKE URL
$this->url = 'http://ift.tt/1DV8LjM'.$this->appId;
$this->url.= '&redirect_uri='.$this->redirectUri;

header("Location:". $this->url);

}catch(Exception $e){
return $this->error($e);
}

}
function http //<--this is just my cURL function


This code uses a redirect back to the page that called it and then sets a session var so it doesnt loop.


However this code only works if the user themselves has already logged into facebook.


Should I use FB.API to store player save game information?

I'm prototyping a game using the FB.SDK and Unity3d (v5.0).


While working through the tutorials on Facebook about how to use the SDK I found the use of this code slightly confusing: FB.API("/me/scores", HttpMethod.POST, OnUserInfoSaved, scoreData);


I am wondering why this is specifically referred to as "scores". Surely this can be any information I wish to store as part of this user's information?


In designing this game, the thought has occurred to me that I might just serialise the player's game information and send it up to Facebook using the API. Is this the intended use for that call or is there some reason to not do it that way?


Coding a simple SHARED Button for Facebook

Which of the 2 ways am I supposed to use to create a simple share button for Facebook in my game app?


1) import Social Framework into project and then put in the following code...



if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

[controller setInitialText:@"High score is %i"];
[self presentViewController:controller animated:YES completion:Nil];
}


2) Add Facebook SDK into your project, get a Facebook App ID by signing up to Facebook's developer program, then add App ID into .plist file, link FBSDKShareKit.framework into project and then use the code provided by Facebook (and there's a LOT of it).


The 1st way of doing it works perfectly fine. Is it a MUST for me to do it the 2nd way? If I do it the first way, would I get in trouble with Facebook or would Apple reject my app? Also, if I do it the first way does it mean I can't use the Facebook "f" logo for the Facebook SHARE button?


Facebook ApiGraph Insights from photo

I have an Android app with Facebook login. I am using the ASNE library with the next scopes: read_insights, read_stream, publish_actions, email,public_profile, user_friends.


The user I am login with, has the tester role in the developer console of facebook.


Now, I am saving the token of the user in my server (generated from the phone), and from the android device I send to my server the photo and my server is posting successfully the photo in the wall of the user (using the previous token) and I get back the PostId.


Now, I want to get the insights of this post but I the data object is empty.


I check the token permissions and it is ok:


Token debugger


And the screenshot of the insights response:


enter image description here


If I post the picture in a page, I get the insights from this post. For example:


enter image description here


Thanks for all, and sorry for my bad english


Display Login Facebook when Publish on Android?

i want to display only one button 'publish on facebook' in my app android !!! (don't display login facebook) !


when i click on 'publish on facebook', i want to : . if 'session facebook' is null : display 'login facebook' and publish automaticaly . if 'session facebook' is don't null : publish automaticaly


i try this but it is not ok ! when i close 'login facebook', the window close and reopen :-(


Thanks you very much for you helppppppppppppppppppppppppppppp



public class ExperienceDetailActivity extends Activity {

private LoginButton loginButton;
private Button postImageBtn;
private UiLifecycleHelper uiHelper;
private static final List<String> PERMISSIONS = Arrays.asList("publish_actions");

static boolean publishToFB;
static Button button_detail_FB;
static Button buttonFB;

public void postImage() {
if (checkPermissions()) {
Request uploadRequest = Request.newUploadPhotoRequest(Session.getActiveSession(), img, new Request.Callback() {
@Override
public void onCompleted(Response response) {
if (response.getError() == null)
Toast.makeText(ExperienceDetailActivity.this, getString(R.string.str_Facebook_Partage_OK), Toast.LENGTH_SHORT).show();
else {
Toast.makeText(ExperienceDetailActivity.this, getString(R.string.str_Facebook_Partage_KO), Toast.LENGTH_SHORT).show();
}
}
});

Bundle params = uploadRequest.getParameters();
Float note = Experience.getNote();
params.putString("message", getString(R.string.str_Facebook_Partage_Text));
uploadRequest.setParameters(params);
uploadRequest.executeAsync();
}
}

private void onSessionStateChange(Session session, SessionState state, Exception exception) {
if (state.isOpened()) {
buttonFB.performClick();
}
}

public boolean checkPermissions() {
Session s = Session.getActiveSession();
if (s != null) {
return s.getPermissions().contains("publish_actions");
} else
return false;
}

@Override
public void onResume() {
uiHelper.onResume();
super.onResume();
}

@Override
public void onPause() {
super.onPause();
uiHelper.onPause();
}

@Override
public void onDestroy() {
super.onDestroy();
uiHelper.onDestroy();
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
if (publishToFB == true) {
buttonFB.performClick();
}
}

@Override
public void onSaveInstanceState(Bundle savedState) {
super.onSaveInstanceState(savedState);
uiHelper.onSaveInstanceState(savedState);
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

uiHelper = new UiLifecycleHelper(this, null);
uiHelper.onCreate(savedInstanceState);

setContentView(R.layout.activity_experience_detail);

Session.StatusCallback callback = new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
onSessionStateChange(session, state, exception);
}
};
Session session = Session.getActiveSession();
if (session == null) {
if (savedInstanceState != null) {
session = Session.restoreSession(this, null, callback, savedInstanceState);
}
if (session == null) {
session = new Session(this);
}
Session.setActiveSession(session);
}
loginButton = (LoginButton) findViewById(R.id.button_detail_LoginFB);
buttonFB = (Button) findViewById(R.id.button_detail_FB);
loginButton.setPublishPermissions(Arrays.asList("publish_actions"));
buttonFB.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Session session = Session.getActiveSession();
if (session != null) {
if (session.getState() == SessionState.CREATED_TOKEN_LOADED) {
session.openForRead(null);
}
if (session.getState() == SessionState.OPENED) {
postImage();
} else {
publishToFB = true;
loginButton.performClick();
}

} else {
publishToFB = true;
loginButton.performClick();
}
}
});
}

Errors after PFUser logOut and PFFacebookUtils logInInBackgroundWithReadPermissions

I migrated my iOS code to FBSDK v4 + Parse 1.7.1 and I'm trying to handle the case of linking a user to a FB ID but it's already linked:



Another user is already linked to this facebook id. (Code: 208, Version: 1.7.1)


Everything seems to work fine after user logout and FB login but every time I alter or save the current user, or query a table, I get various errors such as:



Parse::UserCannotBeAlteredWithoutSessionError (Code: 206, Version: 1.7.1)

"PFKeychainStore" failed to set object for key 'currentUser'

no results matched the query (Code: 101, Version: 1.7.1)


Here is my code:



NSArray *permisions = [NSArray arrayWithObjects:@"public_profile", @"email", @"user_friends", nil];
[PFFacebookUtils linkUserInBackground:[PFUser currentUser] withReadPermissions:permissions block:^(BOOL succeeded, NSError *error) {

if(succeeded && !error) {
//... use data
}
else {
if(error.code == 208) {
[PFUser logOut];
[PFFacebookUtils logInInBackgroundWithReadPermissions:permissions block:^(PFUser *user, NSError *error) {
//here I get a valid user and no error but...
//after this point the errors mentioned start to show up

}

}
else
//... handle other errors
}


}];


I use Parse's automatic user until a user is linked to a FB account.


Would love some help about this, thanks!


I want users to like certain posts they are looking that. To do that I call <id>/likes as a POST-method.


The user has these permissions: basic_info, public_profile, publish_actions, read_custom_friendlists, user_friends, user_photos, user_posts


I load the posts using /feed/me, which should mean that Facebook will find those posts using their ids in subsequent calls.


The traffic to likes looks like this:



POST /v2.3/123456789012345_987654321098765/likes HTTP/1.1
Accept-Encoding: gzip
Authorization: Bearer blahblah...
User-Agent: Google-HTTP-Java-Client/1.11.0-beta (gzip)
Content-Length: 0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Host: graph.facebook.com
Connection: Keep-Alive

HTTP/1.1 400 Bad Request
Content-Type: text/javascript; charset=UTF-8
WWW-Authenticate: OAuth "Facebook Platform" "invalid_request" "(#100) Error finding the requested story"
Access-Control-Allow-Origin: *
X-FB-Rev: 1694181
Pragma: no-cache
Cache-Control: no-store
Facebook-API-Version: v2.3
Expires: Sat, 01 Jan 2000 00:00:00 GMT
X-FB-Debug: Ttvq+Mie2nN3jFdxREVlQj9pbZKanHPBUdlgNnOicrpDtOvEsrPOtoaKuQ+3w7TcG2L4lbWOLKhuDh4Zm14jlw==
Date: Fri, 17 Apr 2015 07:55:08 GMT
Connection: keep-alive
Content-Length: 99

{"error":{"message":"(#100) Error finding the requested story","type":"OAuthException","code":100}}"


I tried to make it work with Graph API Explorer. I added permission user_likes, but that didn't make it work. I added permission read_stream and suddenly it worked!


However, according to the documentation the user only needs publish_actions to like a post.


As we won't get read_stream we are stuck with what the documentation offers. Is this a bug or do we need other permissions or a different logic to make it work?


Get amount of shares

I am a little bit confused with the Facebook Graph API.


As i have found out it is possible to get the amount of shares of a specific link.


I have tried it and it works pretty well, but the problem is, that it does not count when one specific user (when I) share the link directly on my wall.


Does anyone know any possible solution to get all the shares?


All the best


Why can't I import the facebook SDK correctly?

I added correctly as a dependency and put the central maven repository as, there is no error in the import! But I can't access any method as the AppEventsLogger only says to create the class and NOT import. I'm following in the footsteps of Facebook Quick Starts.


build.gradle



apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "com.morais.daniela.doctorquiz"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
}


log



16:59:02 Gradle build finished in 52 sec

how to merge our application with Facebook advertisements?

I saw in Facebook when you want to advertise your iOS Application you can set "Deep Link (optional)" which means that if someone is already install your app on his device and see this ad will have the button Open and the ad will not tax you. On Facebook developers pages has a link GitHub You can see in the description what it contains and my question is: How can be done in Swift and how to merge my application with Facebook ADS ?


i deleted a facebook page linked to my facebook account

I deleted a Facebook business page linked to my Facebook account but i'm still getting emails for it in my name. I have since setup another business page in a different name but all the emails show up in my name still. How do I resolve this?


Using facebook sdk on Android without transferring the project to gradle

I have a huge Android project that I develop in Netbeans and now when I want to integrate face book's plugin into it, I see in facebook's tutorials that I need Android Studio and Gradle.


How can I integrate facebook's plugin without transferring whole project into gradle?


The sdk is a gradle project. I have zero knowledge in it and I didn't find anything online that gets me closer to the goal. I didn't succeed to build the SDK project once I downloaded gradle plugin.


What's Default Activity?

I am registering my app on Facebook Developer, which need to know what my Default Activity. Sorry if it's a stupid question but the Default Activity is my splashscreen (App boot with logo) or the first screen after loading the splash screen?


OG Tags via php

I'm trying to make a very simple game.


a) I let the user input his name;

b) I put this name in a canvas;

c) I generate an image (base64) whit canvas.toDataRL() and I create an image file sending the base64 URI to a php file. I'm doing it with this code:


JAVASCRIPT:



var canvas = document.getElementById("myCanvas");
var dataURL = canvas.toDataURL("image/jpeg", 0.2);
//console.log(dataURL);

// post the dataUrl to php
$.ajax({
type: "POST",
url: "upload.php",
data: {image: dataURL}
}).done(function( respond ) {
console.log(respond);
});


UPLOAD.PHP



<?php
if ( isset($_POST["image"]) && !empty($_POST["image"]) ) {
$dataURL = $_POST["image"];
$parts = explode(',', $dataURL);
$data = $parts[1];
$data = base64_decode($data);
// create a temporary unique file name
$file = "img/" . UPLOAD_DIR . uniqid() . '.png';
// write the file to the upload directory
$success = file_put_contents($file, $data);
print $success ? $file : 'Unable to save this image.';
}
?>


d) Now I'd like to use this image that I've created to set the og:image tag (to share it on Facebook)! How can I do? I've honestly no idea.


Thank you!


Understanding app hashes on facebook app

When I try and click the button "Log in with Facebook", the loading animation appears and nothing happens. If I remove all hashes it opens the login screen but fails saying there are no hashes present. Am I supposed to be using developer or release hashes? What exactly am I missing here? I'm generating the hashes with this code:



try {
PackageInfo info = getPackageManager().getPackageInfo(
"PACKAGE",
PackageManager.GET_SIGNATURES);
for (android.content.pm.Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.wtf("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (PackageManager.NameNotFoundException e) {

} catch (NoSuchAlgorithmException e) {

}


EDIT:


I have the following code for the facebook login in an android Fragment:



loginButton = (LoginButton) fragment.findViewById(R.id.login_button);
loginButton.setReadPermissions("user_friends");
// If using in a fragment
loginButton.setFragment(this);
// Other app specific specialization

// Callback registration
loginButton.registerCallback(C.callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {

Log.wtf("onSuccess",loginResult.toString());

}

@Override
public void onCancel() {

Log.wtf("onCancel","");
}

@Override
public void onError(FacebookException exception) {
Log.wtf("onError",exception.toString());
}
});