I used the below code to integrate app invite via Facebook. This code is working fine with out any issues. Once the invite is received from in facebook, i clicked the notification in this case,
- In case the app is not installed in the device, it redirect to app download page (Google play store).
- If the device having the app it doesn't open. It shows "There is a problem open this app." How can i open my app via facebook invite.
My code:
Bundle params = new Bundle();
params.putString("message", "Learn how to make your Android apps social");
// params.putString("filters", "app_users");
params.putString("filters", "app_non_users");
WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(FacebookFriendsList.this, Session.getActiveSession(), params)).setOnCompleteListener(new OnCompleteListener()
{
@Override
public void onComplete(Bundle values, FacebookException error)
{
if (error != null)
{
if (error instanceof FacebookOperationCanceledException)
{
Toast.makeText(getApplicationContext(), "Request cancelled", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "Network Error", Toast.LENGTH_SHORT).show();
}
}
else
{
final String requestId = values.getString("request");
Log.e("Facebook Invite Request ID ---->", requestId);
if (requestId != null)
{
Toast.makeText(getApplicationContext(), "Request sent", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "Request cancelled", Toast.LENGTH_SHORT).show();
}
}
}
}).build();
requestsDialog.show();
Aucun commentaire:
Enregistrer un commentaire