answerstu

Facebook Login Graph API returns wrong profile picture URL

I'm using Facebook graph API by calling https://graph.facebook.com/v2.10/me?access_token=xxxxxxxxxxxxxxxxxx&fields=id,email,name,first_name,last_name,gender,age_range,picture.width(512).height(512),locale,link,timezone,updated_time which returns the json response I was expecting. Something like this:{ "id": "1234567890987654321", "email": "xxxxxx\u0040example.com", "name": "xxxx xxxx", "first_name": "xxxx", "last_name": "xxxx", "gender": "xxxxx", "age_range": { "min": 21 }, "picture": { "data": { "height"...Read more

facebook - codename one FB authentication

I have been using the following code String clientId = "1171134366245722";String redirectURI = "http://www.codenameone.com/";String clientSecret = "XXXXXXXXXXXXXXXXXXXXXXXXXX";Login fb = FacebookConnect.getInstance();fb.setClientId(clientId);fb.setRedirectURI(redirectURI);fb.setClientSecret(clientSecret);//Sets a LoginCallback listenerfb.setCallback(...);//trigger the login if not already logged inif(!fb.isUserLoggedIn()){ fb.doLogin();} else { //get the token and now you can query the facebook String token = fb.getAccessToken().getTo...Read more

facebook - codename one sharebutton 400: Bad Request

I've been trying to use the native sharebutton integrated into the Codename one project, except that when I click "Post", a "400 : Bad Request" error appears. No exception is thrown, and I have no stacktrace in my console.Code : ShareButton sb = new ShareButton(); sb.addActionListener((evt) -> { System.out.println("clicked"); }); hi.add(sb); sb.setImageToShare("file://home/230r3EdWRk4kP6WDiMBM", "image/jpg"); sb.setTextToShare("Test facebook"); hi.show();Another inssue is that the text to share is invisible.Scree...Read more

Codenameone ShareButton - Sharing URL and Image content to Facebook

I have a Codenameone ShareButton in my app, when pressed opens a dialog containing a list of the standard social media apps, that i have on my device, eg. Facebook, SMS, Email, Twitter.I am trying to get a combination of text, image and URL into the ShareButton dialog for Facebook, but failing. It seems to work for the other types of media. I have scoured StackOverflow without luck on this one.I can share an image to facebook successfully:ShareButton sb = new ShareButton();sb.setImageToShare(imageFile, "image/png");I can share a URL to facebook...Read more

Posting text and image to my Facebook 'wall' from Codenameone app

What I am trying to do from my Codenameone app, in Eclipse, is to send a piece of Text and an Image to my Facebook wall. Simple (or is it). Can anyone explain to me how to achieve this in Java (in a CN1 app) please?I am not wanting the user to login to facebook in my app. Instead, to achieve this in the same way that many mainstream apps do this (eg. BBC News app) where they use the Facebook app, that is already installed on the device, in the list of destinations to Share to, which resolves the FaceBook connection issue. If the user doesn't ha...Read more

How to enable Facebook authentication for Codename One on Android

I have been struggling with this for a few hours. Here's the steps I take:Create a new bare bones Codename One app with main package com.recipes.auth and main class FacebookAuthCreate facebook app for android, setting package name to com.recipes.auth and setting the main class name to FacebookAuthSubThen, generate hash and paste it. The hash is created using:keytool -exportcert -alias (your_keystore_alias) -keystore (path_to_your_keystore) | openssl sha1 -binary | openssl base64Add build hint in Codename One facebook.appIdWrite the following co...Read more

codenameone - Codename One - Facebook Marketing API

I was looking for a way to integrate my CodenameOne app with Facebook. Particularly to collect data aimed to improve the adds shown on Facebook to users who have, for example, installed the app. What I found for integration with Facebook on CN1 is (mainly) this https://www.codenameone.com/javadoc/com/codename1/social/FacebookConnect.htmlThis seems useful for publishing photos or posts to Facebook as a user, but not for gathering data as I need it. Is there a way to access this part of the Facebook SDK in CN1? If there isn´t is this planned for ...Read more

facebook - Ideas for designing a Secure, "Low Cost" method for confirming client-side game results

This is more a system design question/challenge, than a coding question.Basically, I'm thinking of throwing together a Bejeweled-esque game on Facebook using just HTML, CSS, and javascript. This is mostly out of a desire to learn all the little caveats of FBJS via a non-trivial project.So here's the deal. When developing for Facebook, actual API calls are very expensive; not only is there an additional POST to the Facebook servers, there's also the api call limit and throttling to worry about. In a nutshell, the fewer calls to Facebook the b...Read more

facebook - Application Request Limit issue (Occuring Random with Random Scenarios)

I have tried raising this concern on Facebook/Support/Bugs but they said I should post implementation issues here. I have read it everywhere and it seems to be quiet open issue till now. I am not sure, If this will be solved or not. So, what we are doing is, we have clients - Android and iOS.Apps on Android/iOS allows users to login into the app and generate the token on the basis of permissions set we have, and we are passing this token to server for fetching further data as and when required for client. As our userbase is increasing we are ge...Read more

Validate Facebook work position targeting IDs

Our Facebook Ad system uses work position in its targeting spec as documented here: https://developers.facebook.com/docs/marketing-api/targeting-specs/v2.3#education_and_workplaceSometimes Facebook deletes existing work positions and API requests to update the targeting spec fails:{ "error": { "message": "Invalid parameter", "type": "FacebookApiException", "code": 100, "error_subcode": 1487079, "is_transient": false, "error_user_title": "Invalid Targeting Spec", "error_user_msg": "The speci...Read more

How can I save player's score to Facebook with default permissions?

I'm trying to integrate Facebook with my game in a very simple way - I want player to be able to see results (scores) of his friends.Getting friends results is easy - you can just use HTTP GET request to "/APP_ID/scores" to get a list of all friends playing this game and their scores.You can do this with the default Facebook permissions with no problem.But how do you update these scores? According to Facebook docs you have to have publish_actions permission in order to use HTTP POST request to "/USER_ID/scores". Which requires Facebook review ...Read more

facebook - Payments in our game stopped working, "object does not exist"

Our in-game transactions suddenly stopped working properly in one of our games. When a player tries to buy something, they are charged, but then an unknown error occurs and the player is not provided the items they tried to purchase.Here is the screenshot: https://i.gyazo.com/e7beb162e9e94c9dd50008f1e0b6b78c.pngAccording to our investigation, the object ID coming to our payment callback cannot be found, even through the Graph API explorer.Here's an example:Our server receives the following data from payment callback: {"object":"payments","entr...Read more

Firebase SSO Auth not working in Facebook In App Browser

We are using Firebase Auth and provide Google and Facebook login on our site.We are a publisher and most of our stories are published as Instant Articles. However, some articles are locked and requires subscribers to login to read the full content.This works in a normal browser, but when opening a non-IA link in FB In App Browser, the login popup appears but remains blank, and does not close. Users are not signed in and can't login. We are using:firebase.auth().signInWithPopup(provider)I was wondering if there are any ways besides the signInWit...Read more