Jump to content
Android Forum - A Community For Android Users and Enthusiasts

Android app : Handling app request posted on Facebook


Birender
 Share

Recommended Posts

I went through various Facebook tutorials to handle Facebook integration into Native Android app and have achieved success implementing all flows including Facebook login, fetch user details, Share, Select friends. I am stuck in use case wherein app invite request sent by one user is handled for recipient.

Problem statement: Facebook Send requesttutorial explains well on sending app request to friend which works fine for me as i can see success response as below.

fbconnect://success?request=&to%5B0%5D=

But the next step is to handle the request. As per tutorial, once recipient user opens up the Facebook forAndroid app and tap on the notification (I am seeing under top left menu -> Apps section), the app is launched using intent containing request data which can be pulled as below.

Uri intentUri = getActivity().getIntent().getData();

Further request ID (one or more) can be fetched as below

String requestIdParam = intentUri.getQueryParameter("request_ids");

In my case, Facebook app launches installed app but intentUri (statement listed above) itself is returned as null. Hence i can't proceed further extracting request details.

Note: i could confirm that posted request contains complete info e.g. data using below method by passing hardcoded requestID obtained while posting (after logging into app as recepient user).

private void getRequestDetails(String inRequestId) {

Request request = new Request(Session.getActiveSession(),

inRequestId, null, HttpMethod.GET, new Request.Callback() {

@Override

public void onCompleted(Response response) {

Log.d (TAG, response.toString());

}

});

// Execute the request asynchronously.

Request.executeBatchAsync(request);

}

An early help/pointers will be higly appreciated. Also, is there a way to query pending app requests through Facebook API rather than invocation through Facebook native app intent invocation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...