Take the 2-minute tour ×

I'm currently developing a feature in my application that will allow users to invite their Facebook friends and for that they and the friend will receive a reward/gift.

So for that purpose I using the Facebook request option. So I went over the following 2 docs:



Now this works great if both devices have the application installed and I send request from one to another and can retrieve additional data that the sender sent using this method:

    private void getRequestData(final String inRequestId) {
    // Create a new request for an HTTP GET with the
    // request ID as the Graph path.
    Request request = new Request(Session.getActiveSession(), 
            inRequestId, null, HttpMethod.GET, new Request.Callback() {

                public void onCompleted(Response response) {
                    // Process the returned response
                    GraphObject graphObject = response.getGraphObject();
                    FacebookRequestError error = response.getError();
                    // Default message
                    String message = "Incoming request";
                    if (graphObject != null) 
                        CupsLog.d(TAG, "getRequestData -> graphObject != null: "+ graphObject.toString());
                        // Check if there is extra data
                        if (graphObject.getProperty("data") != null) 
                            CupsLog.d(TAG, "getRequestData -> graphObject.getProperty(data) != null");
                                // Get the data, parse info to get the key/value info
                                JSONObject dataObject = new JSONObject((String)graphObject.getProperty("data"));
                                // Get the value for the key - badge_of_awesomeness
                                String reward = dataObject.getString("reward");
                                // Get the value for the key - social_karma
                                String coffeeCups = dataObject.getString("coffee_cups");
                                // Get the sender's name
                                JSONObject fromObject = (JSONObject) graphObject.getProperty("from");
                                String sender = fromObject.getString("name");
                                String title = sender+" sent you a gift";
                                // Create the text for the alert based on the sender
                                // and the data
                                message = title + "\n\n" + 
                                    "reward: " + reward + 
                                    " coffeeCups: " + coffeeCups;
                            } catch (JSONException e) {
                                message = "Error getting request info";
                        } else if (error != null) {
                            message = "Error getting request info";
                            CupsLog.d(TAG, "getRequestData -> graphObject.getProperty(data) == null");
                    Toast.makeText(SocialFeaturesActivity.this, message, Toast.LENGTH_LONG).show();
    // Execute the request asynchronously.

The Question: If the receiver will get this request in Facebook, but will not have it installed, this request will redirect him to Google Play to install the app. After he installs the app and open it for the first time? Is there s way to receive this data anyway?

Thanks in advance.

share|improve this question
Currently, no. You will need to keep track of it server side (if you have one). –  Ming Li Dec 5 '13 at 19:04
How can I keep track of it in server? I will have to log every time one of my users sent a request to each one of his friends and then verify that this user has logged in my application. This is impossible in my case... –  Emil Adz Dec 5 '13 at 21:13
@MingLi is there maybe another way in Facebook framework to perform this action? –  Emil Adz Dec 5 '13 at 21:13
add comment


Your Answer



Browse other questions tagged or ask your own question.