Comments (10)
This is working as intended. What you're seeing is that the user
currently has Facebook auth data attached to it, but is currently in a dirty state as the request has failed.
You should update your callback as the request has only succeeded if e != null
.
from parse-sdk-android.
When I check this function again ParseFacebookUtils.isLinked(user)
in somewhere, it's return true, but currentUser
not linked to any Facebook account, and currentUser
don't have authData
on parse.com
from parse-sdk-android.
The information isn't persisted on the server as your request failed, however, the ParseUser
you have locally has the authData
attached since it attempted to link to a Facebook account, but failed. Since it has it locally, ParseFacebookUtils.isLinked(user)
will return true
.
from parse-sdk-android.
Thank you for your feedback. We use the issues tracker here to track valid bugs in our SDK. Your question seems to be more about how to use Parse. Could you check out the following resources?
- Documentation: https://www.parse.com/docs
- Google Groups: https://groups.google.com/forum/#!forum/parse-developers
- Stack Overflow: http://stackoverflow.com/tags/parse.com
from parse-sdk-android.
This issue has not been updated for 7 days. If you have additional information to help pinpoint this issue as an SDK bug, please comment on this issue. We will close this issue in 7 days if no additional information is provided. Thank you for your feedback.
from parse-sdk-android.
We are closing this issue due to another 7 days of inactivity. If you have additional information to help pinpoint this issue as an SDK bug, please reopen it with the additional information.Thank you for your feedback.
from parse-sdk-android.
This behavior of ParseFacebookUtils library does not seem to be correct. Because this may produce inconsistencies in some cases as on server user is saved as Anonymous user whereas on device it is non-Anonymous user. So I think ParseFacebookUtils.isLinked(user) should return false after failed linking.
Also although I am an Android developer but I think on iOS platform, if this 208 error occurs, iOS version of this library does not start returning true for ParseFacebookUtils.isLinked(user) instead it returns false. This iOS sdk behavior seems consistent with the server state and I think same should be in Android.
For solutions, I tried to use persistent storage for tracking if user is actually not linked, which was overkill. Then I have managed to retain correct state by calling ParseFacebookUtils.unlink(user) for current user in case 208 error had occurred. I am not sure if this workaround is correct, but it seems to be working.
By the way even if this buggy behavior seems fine this should be mentioned in docs and sample codes.
It has possible workarounds, but I still think that library behavior needs to be changed.
from parse-sdk-android.
@grantland could you please help a little here.
Could this issue be reopened as suggested in my last comment, or should I create new issue for it, or is it not worth it?
from parse-sdk-android.
@SobanMahmood I tried to find some solution for this problem, Finally I called unlikFacebook account if I got error code 208 in response, I wrote some code like below:
List<String> permissions = Arrays.asList("public_profile", "email", "user_birthday");
ParseFacebookUtils.linkWithReadPermissionsInBackground(currentUser, getActivity(), permissions, new SaveCallback() {
@Override
public void done(ParseException e) {
if (e != null) {
// has error
if (e.getCode() == 208) {
ParseFacebookUtils.unlinkInBackground(ParseUser.getCurrentUser());
MaterialDialogUtils.showOopsMaterialDialogs(getActivity(), "Another user is already linked to this facebook ID. Please try another FB account.");
} else {
MaterialDialogUtils.showOopsMaterialDialogs(getActivity(), "Can't link your account to FB. Code = " + e.getCode());
}
} else if (LoginHelper.isLinkedWithFacebook()) {
// linked success
}
}
});
Hope it will help some one have same problem. :)
from parse-sdk-android.
Thank you @kenilt . That seems to be working. I am using the similar solution. For more consistency with future version changes, I have also included ParseFacebookUtils.isLinked(user)
condition before calling unlink in case of error 208 like this.
...
if (e.getCode() == 208) {
if (ParseFacebookUtils.isLinked(ParseUser.getCurrentUser())) {
ParseFacebookUtils.unlinkInBackground(ParseUser.getCurrentUser());
}
MaterialDialogUtils.showOopsMaterialDialogs(getActivity(), "Another user is already linked to this facebook ID. Please try another FB account.");
} else {
MaterialDialogUtils.showOopsMaterialDialogs(getActivity(), "Can't link your account to FB. Code = " + e.getCode());
}
...
from parse-sdk-android.
Related Issues (20)
- logInWithReadPermissionsInBackground sends out an verification email HOT 2
- Publish to Maven Central repository HOT 8
- Migrate ParseLiveQuery over here HOT 3
- Migrate and resurrect ParseUI HOT 3
- ParseFile uploads multiple times HOT 2
- 📣 Contributors wanted! HOT 1
- i/o failure HOT 2
- Cloud code progressCallback HOT 1
- Facebook Login not working when Facebook app is not installed HOT 2
- Could not find com.github.parse-community.Parse-SDK-Android:bolts-tasks:4.2.0 HOT 11
- Preventing Session Copy On Rooted Devices By Encrypting Current Session Files HOT 1
- Not able to Log/Print URL/cURl in android studio HOT 2
- IllegalArgumentException when initializing Parse HOT 20
- README Getting Started guide is out of date HOT 2
- SafeParseDelegate's name param being ignored on `setValue` function HOT 1
- Add option to pass additional parameters to backend when saving/uploading file HOT 1
- Dashboard HOT 1
- Even if “linkWithInBackground” fails(code208), the data will be cached locally, causing problems with this “isLinked” HOT 1
- Compose Preview crashes because of Parse init HOT 3
- Add support for uploading files from a content Uri HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parse-sdk-android.