How to handle error of facebook in android - android

I am working on facebook integration in an android app. I did a lot of search about error handling of facebook inn android but nothing foung. Can anyone tell me how handle these situation in android :
1.The user changes her password which invalidates the access token.
2.The user de-authorizes your app.
3.The user logs out of Facebook.
My code of facebook integration is here :
private UiLifecycleHelper uiHelper;
private Session.StatusCallback callback = new Session.StatusCallback() {
#Override
public void call(Session session, SessionState state, Exception exception) {
onSessionStateChange(session, state, exception);
}
};
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
if ( exception instanceof FacebookOperationCanceledException ||
exception instanceof FacebookAuthorizationException)
{
new AlertDialog.Builder(MainWindow.this)
.setTitle("cancel")
.setMessage("your permission has expired.")
.setPositiveButton("ok", null)
.show();
}
}
private void onClickFacebookRequest()
{
if (session.isOpened())
{
sendRequests();
} else {
StatusCallback callback = new StatusCallback() {
public void call(Session session, SessionState state, Exception exception) {
if (exception != null) {
new AlertDialog.Builder(MainWindow.this)
.setTitle(R.string.login_failed_dialog_title)
.setMessage(exception.getMessage())
.setPositiveButton(R.string.ok_button, null)
.show();
session = createSession();
}
}
};
pendingRequest = true;
session.openForRead(new Session.OpenRequest(this).setCallback(callback));
}
}
private static final List<String> PERMISSIONS = Arrays.asList("publish_actions");
private static final String PENDING_PUBLISH_KEY = "pendingPublishReauthorization";
private void sendRequests()
{
List<String> permissions = quytechApps.getSession().getPermissions();
if (!isSubsetOf(PERMISSIONS, permissions)) {
pendingRequest = true;
Session.NewPermissionsRequest newPermissionsRequest = new Session
.NewPermissionsRequest(this, PERMISSIONS);
session.requestNewPublishPermissions(newPermissionsRequest);
return;
}
showValidationDialog("Please Wait.posting Data on Facebook");
Bitmap image = BitmapFactory.decodeResource(this.getResources(), R.drawable.splash_screen_final4);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
Bundle postParams=new Bundle();
postParams.putByteArray("photo",byteArray);
postParams.putString("message", "Hi Friends I am using Twinqli Chat App.");
Request request = new Request(Session.getActiveSession(), "me/photos", postParams, HttpMethod.POST, new Request.Callback()
{
#Override
public void onCompleted(Response response) {
// TODO Auto-generated method stub
// showPublishResult(getString(R.string.photo_post), response.getGraphObject(), response.getError());
if(response.getError() == null)
{
Log.d("GraphApiSample.java Sucesses","sucess");
dismissValidatingDialog();
}
else
{
dismissValidatingDialog();
session.closeAndClearTokenInformation();
//quytechApps.getSession().
//quytechApps.setSession(null);
// Log.d("GraphApiSample.java",""+response.getError().getErrorMessage());
}
}
});
request.executeAsync();
}
private boolean isSubsetOf(Collection<String> subset, Collection<String> superset) {
for (String string : subset) {
if (!superset.contains(string)) {
return false;
}
}
return true;
}
static final String applicationId = "390611174384274";
boolean pendingRequest;
static final String PENDING_REQUEST_BUNDLE_KEY = "com.facebook.samples.graphapi:PendingRequest";
private Session createSession()
{
Session activeSession = Session.getActiveSession();
if (activeSession == null || activeSession.getState().isClosed())
{
activeSession = new Session.Builder(this).setApplicationId(applicationId).build();
Session.setActiveSession(activeSession);
}
return activeSession;
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (qsession.onActivityResult(this, requestCode, resultCode, data) &&
pendingRequest &&
session.getState().isOpened()) {
sendRequests();
}
}
#Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
pendingRequest = savedInstanceState.getBoolean(PENDING_REQUEST_BUNDLE_KEY, pendingRequest);
}
#Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(PENDING_REQUEST_BUNDLE_KEY, pendingRequest);
}
can anyone help me . Thanks in advance.

The handleError() method noted by Ming Li is relevant to request errors. It does not handle login errors. I have not seen any examples in the Facebook docs, nor samples, as to how to handle login errors, beyond differentiating between a cancellation and an error. My suggestion is to generate erroneous conditions prior to login attempts (e.g. change the password, deauthorize the app, etc), then in the login callback look at the different values you get for error.getMessage(), and build your own mechanisms accordingly (e.g. if the word "session" appears in the message, tell the user to login to the Facebook app). Also note that getLocalizedMessage() seems not to work (as of SDK 3.5.2). You can differentiate between cancels and errors by if (exception instanceof FacebookOperationCanceledException) and if (exception instanceof FacebookAuthorizationException), but that's pretty much it.

This question is related to face book error handling and is very complex to handle .
However, when i was using the face book API, i got a list of error codes that might be returned and as a result i was able to gracefully solve this scenario . I guess what you are asking for , is graceful error handling.
First of all if it is so, a search in google reveals this url.
Now off to the fun part :
Invalidation of access token : Here the error description is : Invalid OAuth 2.0 Access Token and the error number returned is : 190
User De authorirization : This is a permission issue, so error desc is : Permissions error and error no is : 200
User logs out : When user logs out, it will lead to user data error . The error desc is : User data failure and error no is : 310.
But, there are other scenarios as well, which you need to consider. For this you can get a list of all these error codes here in this LINK .

The error handling document is here - https://developers.facebook.com/docs/reference/api/errors/
You should also look at the Scrumptious sample app, specifically the handleError() method in SelectionFragment.java, it breaks down the different cases you should handle.

Related

Android & Facebook SDK: Obtain user data without Login Button

I am losing my mind trying to integrate Facebook with an app. First of all, Fb's SDK is terrible and its making everything crash since I included it. Anyway, I am trying to obtain user data from Facebook, just his/her name, user id and email; however, I can't use the Login Button because it doesn't support Nested Fragments and it uses UiLifecycleHelper which keeps a Session open and keeps executing a callback that I only want to call once.
I don't need to keep a Session open; I will sporadically open Sessions the first time the user uses the app and if he/she wants to publish something (very rare).
So far I have tried using the Login Button, performing a simple Request and combining both. However, it seems that the SDK as a whole doesn't play very well with Nested Fragment.
This was my last attempt at making this work (these two methods are inside a Fragment. Once a button is pressed, performFacebookLogin is executed):
public void performFacebookLogin() {
Session.openActiveSession(getActivity(), true, Arrays.asList("email"), new Session.StatusCallback() {
#Override
public void call(Session session, SessionState state, Exception exception) {
if (session.isOpened()) {
Log.d("FACEBOOK", "Session has been opened");
Request.newMeRequest(session, new Request.GraphUserCallback() {
#Override
public void onCompleted(GraphUser user, Response response) {
Log.d("FACEBOOK", "onCompleted");
if (user != null) {
Log.d("DBG", buildUserInfoDisplay(user));
}
}
}).executeAsync();
}else{
//TODO: ERROR
Log.e("FACEBOOK", "Session could not be opened");
}
}
});
}
private String buildUserInfoDisplay(GraphUser user) {
StringBuilder userInfo = new StringBuilder("");
userInfo.append(String.format("Name: %s\n\n",
user.getName()));
userInfo.append(String.format("Email: %s\n\n",
user.getProperty("email")));
userInfo.append(String.format("ID: %s\n\n",
user.getId()));
return userInfo.toString();
}
So, what happens? The dialog prompt is shown in order to login using your Facebook account. But, once you press Login and the dialog disappears, nothing happens. Nothing is shown in the LogCat. I think is a problem with the onActivityResult method, because the callback is never executed. I tried re-adding the UiLifecycleHelper, but it ends up making unwanted calls to the callback (I only want to call this method once).
You are correct, you need to plumb the result through to the active Session for your callback to be activated. In your activities onActivityForResult method, call the active sessions onActivityResult, similar to this: https://github.com/facebook/facebook-android-sdk/blob/master/facebook/src/com/facebook/UiLifecycleHelper.java#L156-159
Session session = Session.getActiveSession();
if (session != null) {
session.onActivityResult(activity, requestCode, resultCode, data);
}
That would get your callback working.
So, I managed to achieve a modular approach to my problem: I created an activity that encapsulated the connection to Facebook's SDK and returns it via onActivityResult. Unfortunately, I haven't found a way to return the result to a nested fragment directly.
On a side note, you can make the activity transparent to avoid a black screen and add more permissions if you need them. Also, you can remove the onStop method if you want to keep the Session active.
Here's the code:
public class FacebookAccessActivity extends ActionBarActivity {
public static final String PARAM_PROFILE = "public_profile";
public static final String PARAM_EMAIL = "email";
public static final String PARAM_FIRSTNAME = "fname";
public static final String PARAM_LASTNAME = "lname";
public static final String PARAM_GENDER = "gender";
public static final String PARAM_BDAY = "user_birthday";
public static final String PARAM_ID = "id";
private static Session session = null;
private List<String> permissions = Arrays.asList(PARAM_EMAIL, PARAM_PROFILE, PARAM_BDAY);
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().hide();
setContentView(R.layout.view_empty);
session = Session.getActiveSession();
if (session != null)
session.closeAndClearTokenInformation();
Session.openActiveSession(this, true, permissions, new Session.StatusCallback() {
#Override
public void call(Session session, SessionState state, Exception exception) {
if (exception != null || state == SessionState.CLOSED_LOGIN_FAILED) {
exception.printStackTrace();
setResult(RESULT_CANCELED);
finish();
} else if (session.isOpened()) {
Request.newMeRequest(session, new Request.GraphUserCallback() {
#Override
public void onCompleted(GraphUser user, Response response) {
if (user != null) {
Intent i = new Intent();
i.putExtra(PARAM_FIRSTNAME, user.getFirstName());
i.putExtra(PARAM_LASTNAME, user.getLastName());
i.putExtra(PARAM_ID, user.getId());
i.putExtra(PARAM_GENDER, (String) user.getProperty(PARAM_GENDER));
i.putExtra(PARAM_BDAY, user.getBirthday());
for (String s : permissions)
i.putExtra(s, (String) user.getProperty(s));
setResult(RESULT_OK, i);
finish();
}
}
}).executeAsync();
}
}
});
}
#Override
protected void onStop() {
super.onStop();
if (session != null)
session.closeAndClearTokenInformation();
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_CANCELED ||
!Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data)) {
setResult(RESULT_CANCELED);
finish();
}
}

How to share text message on facebook in android programatically

I want to share some text as well as one picture from my app to facebook wall programatically.
I already registered my android app on facebook developer site.
I am using following code for posting the text but it is not working.It is also not giving me any error so I am totally confused what is happening inside.
public class FacebookManager {
private Activity activity;
private Session.StatusCallback statusCallback;
public UiLifecycleHelper uiHelper;
public FacebookManager(final Activity activity) {
this.activity = activity;
statusCallback = new ShareStatusCallback();
uiHelper = new UiLifecycleHelper(activity, null);
}
public void share() {
Session session = Session.getActiveSession();
if (!session.isOpened() && !session.isClosed()) {
session.openForPublish(new Session.OpenRequest(activity).setCallback(statusCallback).setPermissions("publish_actions"));
} else {
Session.openActiveSession(activity, true, statusCallback);
}
}
public void initFbSession(Bundle savedInstanceState) {
Session session = Session.getActiveSession();
if (session == null) {
if (savedInstanceState != null) {
session = Session.restoreSession(activity, null, null, savedInstanceState);
}
if (session == null) {
session = new Session(activity);
}
Session.setActiveSession(session);
}
}
private class ShareStatusCallback implements Session.StatusCallback {
#Override
public void call(Session session, SessionState state, Exception exception) {
if (!session.isOpened()) {
return;
}
if (FacebookDialog.canPresentShareDialog(activity, FacebookDialog.ShareDialogFeature.SHARE_DIALOG)) {
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(activity)
.setDescription("Test Message ")
//.setPicture("")
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
} else {
Bundle params = new Bundle();
params.putString("description", "Test Message");
// params.putString("picture", "");
WebDialog feedDialog = (
new WebDialog.FeedDialogBuilder(activity,
Session.getActiveSession(),
params)).build();
feedDialog.show();
}
}
}
}
Does it required any configuration for android app on facebook developer site to use share functionality ?
Please help me out for this.
setDescription only applies if you have a link (via setLink).
You cannot prefill the actual message itself, that's against Facebook's platform policies (the user must type in the message themselves).
We will update the javadocs so that it's more clear.

How to add permission for getting birthday from Facebook

I'm unable to add permission for birthday, please help me out...
thanks in advance.
sample source code is :
Session.openActiveSession(this, true, new Session.StatusCallback() {
// callback when session changes state
#SuppressWarnings("deprecation")
#Override
public void call(Session session, SessionState state,
Exception exception) {
if (session.isOpened()) {
// make request to the /me API
Request.executeMeRequestAsync(session,
new Request.GraphUserCallback() {
// callback after Graph API response with user
// object
#Override
public void onCompleted(GraphUser user,
Response response) {
if (user != null) {
}
}
});
}
}
});
Try this,
.setPermissions(Arrays.asList("user_birthday","email"))
private static final List PERMISSIONS = Arrays.asList(""user_birthday""); //declaration
onClickPostStatusUpdate();// on button click call this function
private void onClickPostStatusUpdate() {
performPublish(PendingAction.POST_STATUS_UPDATE);
}
private void performPublish(PendingAction action) {
Session session = Session.getActiveSession();
if (session != null) {
pendingAction = action;
if (hasPublishPermission()) {
// We can do the action right away.
handlePendingAction();
} else {
// We need to get new permissions, then complete the action when we get called back.
session.requestNewPublishPermissions(new Session.NewPermissionsRequest(this, PERMISSIONS));
}
}
}
user.getBirthday();
I remeber using that and storing it as a string.

Facebook session state OPENING

I can login to my app then share something. This needs an OPENED session state. However, when I am not logged in, then I want to share something, I need to open the session. I am using a ViewPager so e.g. when I go from one page to another and this code
Session.openActiveSession(getActivity(), true, new StatusCallback() {
#Override
public void call(Session session, SessionState state, Exception exception) {
}
});
is in the beginning of the code, then the session becomes active, and I get automatically logged in, which is wrong! That's why I put this code block into an onClickListener, so I only want to open the session if I click the share button in my app:
if (session != null && session.isOpened()) {
publishFeedDialog();
}
else {
Session.openActiveSession(getActivity(), true, new StatusCallback() {
#Override
public void call(Session session, SessionState state, Exception exception) {
}
});
publishFeedDialog();
}
private void publishFeedDialog() {
session = Session.getActiveSession();
Log.i("TAG", session.getState() + ""); //OPENING
WebDialog feedDialog = (
new WebDialog.FeedDialogBuilder(getActivity(),
Session.getActiveSession(),
params))
.setOnCompleteListener(new OnCompleteListener() {
#Override
public void onComplete(Bundle values,
FacebookException error) {
if (error == null) {
final String postId = values.getString("post_id");
if (postId != null) {
} else {
// User clicked the Cancel button
}
} else if (error instanceof FacebookOperationCanceledException) {
} else {
// Generic, ex: network error
}
}
})
.build();
feedDialog.show();
}
The error:
Attempted to use a session that was not open.
So I open the session in vain, because it is still OPENING when the WebDialog should appear.
Please help.
For me it works like this:
if (Session.getActiveSession() != null && Session.getActiveSession().isOpened()) {
publishFeedDialog();
}
else {
Session session = Session.getActiveSession();
if (!session.isOpened() && !session.isClosed()) {
// List<String> permissions = new ArrayList<String>();
// permissions.add("email");
session.openForRead(new Session.OpenRequest(this)
// .setPermissions(permissions)
.setCallback(mFacebookCallback));
} else {
Session.openActiveSession(getActivity(), true, mFacebookCallback);
}
}`
where callback is
private Session.StatusCallback mFacebookCallback = new Session.StatusCallback() {
#Override
public void
call(final Session session, final SessionState state, final Exception exception) {
if (state.isOpened()) {
String facebookToken = session.getAccessToken();
Log.i("MainActivityFaceBook", facebookToken);
Request.newMeRequest(session, new Request.GraphUserCallback() {
#Override
public void onCompleted(GraphUser user,
com.facebook.Response response) {
publishFeedDialog();
}
}).executeAsync();
Prefs.setStringProperty(getActivity(), R.string.key_prefs_facebook_token, facebookToken);
}
}
};
Try to call publishFeedDialog() in CallBack onCompleted
Try calling publishFeedDialog() from inside call() after you check for the status of the session (do not use session.isOpened(), use state.isOpened() instead). Checking the state ensures that your Session is in an open state and that it can also be used to execute requests. The StatusCallback can be called multiple times until the Session is actually open, that is why you should check the status before sending any request.
If you are opening a session from a fragment use the next openActiveSession method implementation.
openActiveSession(Context context, Fragment fragment, boolean allowLoginUI, Session.StatusCallback callback)
This works for me.

facebook error : OAuthException, errorMessage: Error validating access token in android

I am working on facebook integration on my android application. When i do wall post then facebook give me this error :
{Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 190, errorType: OAuthException, errorMessage: Error validating access token: User 100002309500077 has not authorized application 390611174384274.}, isFromCache:false}
Steps of getting this problem :
in fresh application facebook works fine. (i did login in facebook and give permission for posting and wall will be posted sucessfully on facebook).
but after it i open my facebook account and delete that facebook app from my account.
now i again click on post wall button of my android app . at this time facebbok not asking me for permission and continue with the code of wall post and gives me error posted above.
Now if i again click on share on facebook button then it gives me a exception
java.lang.UnsupportedOperationException: Session: an attempt was made to open an already opened session.
at com.facebook.Session.open(Session.java:947)
at com.facebook.Session.openForRead(Session.java:385)
at com.quytech.androidclient.MainWindow.onClickFacebookRequest(MainWindow.java:2605)
at com.quytech.androidclient.MainWindow.onOptionsItemSelected(MainWindow.java:291)
at com.actionbarsherlock.app.SherlockActivity.onMenuItemSelected(SherlockActivity.java:197)
at com.actionbarsherlock.ActionBarSherlock.callbackOptionsItemSelected(ActionBarSherlock.java:600)
at com.actionbarsherlock.internal.ActionBarSherlockCompat.onMenuItemSelected(ActionBarSherlockCompat.java:533)
at com.actionbarsherlock.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:738)
at com.actionbarsherlock.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:148)
at com.actionbarsherlock.internal.ActionBarSherlockCompat.onMenuItemClick(ActionBarSherlockCompat.java:607)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:154)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:885)
at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:545)
at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
at android.view.View$PerformClick.run(View.java:9293)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:4310)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
code which i am using :
private UiLifecycleHelper uiHelper;
private Session.StatusCallback callback = new Session.StatusCallback() {
#Override
public void call(Session session, SessionState state, Exception exception) {
onSessionStateChange(session, state, exception);
}
};
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
if ( exception instanceof FacebookOperationCanceledException ||
exception instanceof FacebookAuthorizationException)
{
new AlertDialog.Builder(MainWindow.this)
.setTitle("cancel")
.setMessage("your permission has expired.")
.setPositiveButton("ok", null)
.show();
}
}
private void onClickFacebookRequest()
{
if (session.isOpened())
{
sendRequests();
} else {
StatusCallback callback = new StatusCallback() {
public void call(Session session, SessionState state, Exception exception) {
if (exception != null) {
new AlertDialog.Builder(MainWindow.this)
.setTitle(R.string.login_failed_dialog_title)
.setMessage(exception.getMessage())
.setPositiveButton(R.string.ok_button, null)
.show();
session = createSession();
}
}
};
pendingRequest = true;
session.openForRead(new Session.OpenRequest(this).setCallback(callback));
}
}
private static final List<String> PERMISSIONS = Arrays.asList("publish_actions");
private static final String PENDING_PUBLISH_KEY = "pendingPublishReauthorization";
private void sendRequests()
{
List<String> permissions = quytechApps.getSession().getPermissions();
if (!isSubsetOf(PERMISSIONS, permissions)) {
pendingRequest = true;
Session.NewPermissionsRequest newPermissionsRequest = new Session
.NewPermissionsRequest(this, PERMISSIONS);
session.requestNewPublishPermissions(newPermissionsRequest);
return;
}
showValidationDialog("Please Wait.posting Data on Facebook");
Bitmap image = BitmapFactory.decodeResource(this.getResources(), R.drawable.splash_screen_final4);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
Bundle postParams=new Bundle();
postParams.putByteArray("photo",byteArray);
postParams.putString("message", "Hi Friends I am using Twinqli Chat App.");
Request request = new Request(Session.getActiveSession(), "me/photos", postParams, HttpMethod.POST, new Request.Callback()
{
#Override
public void onCompleted(Response response) {
// TODO Auto-generated method stub
// showPublishResult(getString(R.string.photo_post), response.getGraphObject(), response.getError());
if(response.getError() == null)
{
Log.d("GraphApiSample.java Sucesses","sucess");
dismissValidatingDialog();
}
else
{
dismissValidatingDialog();
session.closeAndClearTokenInformation();
//quytechApps.getSession().
//quytechApps.setSession(null);
// Log.d("GraphApiSample.java",""+response.getError().getErrorMessage());
}
}
});
request.executeAsync();
}
private boolean isSubsetOf(Collection<String> subset, Collection<String> superset) {
for (String string : subset) {
if (!superset.contains(string)) {
return false;
}
}
return true;
}
static final String applicationId = "390611174384274";
boolean pendingRequest;
static final String PENDING_REQUEST_BUNDLE_KEY = "com.facebook.samples.graphapi:PendingRequest";
private Session createSession()
{
Session activeSession = Session.getActiveSession();
if (activeSession == null || activeSession.getState().isClosed())
{
activeSession = new Session.Builder(this).setApplicationId(applicationId).build();
Session.setActiveSession(activeSession);
}
return activeSession;
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (qsession.onActivityResult(this, requestCode, resultCode, data) &&
pendingRequest &&
session.getState().isOpened()) {
sendRequests();
}
}
#Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
pendingRequest = savedInstanceState.getBoolean(PENDING_REQUEST_BUNDLE_KEY, pendingRequest);
}
#Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(PENDING_REQUEST_BUNDLE_KEY, pendingRequest);
}
can anyone tell me how to handle this situation. Thanks in advance.
In your code you are requesting the session for read
session.openForRead(new Session.OpenRequest(this).setCallback(callback));
and passing the permission for write thats why the exception is occured.

Categories

Resources