-
Notifications
You must be signed in to change notification settings - Fork 508
User cancelled dialog error everytime #125
Comments
Please post the dialog you're using. |
_fbLogin(birthdayStr) {
facebookConnectPlugin.login(
['email', 'public_profile', 'user_birthday'],
(response) => {
facebookConnectPlugin.api(
'/me?fields=id,birthday,gender,first_name,age_range,last_name,name,picture.width(400),email',
[],
x => this._handleSuccessfulFbResponse(x, birthdayStr),
x => this.setState({status: 'login failed'}),
);
}, (response) => {
console.log(response);
});
} I'm using whichever version npm gives me, the plugin.xml shows this: lollipop 5.1.1 - oneplus two is the device that's getting this problem |
Ok, I've found a solution to this. It seems that I need to delete the app and install it again in order for the facebook login to work. I have no idea why, but running straight away doesn't seem to work. I presume it's something to do with the hash keys. Thanks though, I'll update if I find out more! |
I'm seeing the same issue even with a fresh test app.
See login screen and looks like I successfully login but I get an error response
|
am having this same error: error Object {errorCode: "4201", errorMessage: "User cancelled dialog"} anyone been able to fix it? |
Any updates on this ? |
Upgrading to the lastest version fixed this for me |
I had the same problem, my solution was on the login method, I made the request for all the permissions I want to use in that method. |
Experiencing the same issue currently on a Samsung s3 with 4.4.4. Working fine on my S6 with Android M though. Wondering if this is specific to older versions of Android? @jorgemejia could you elaborate at all on what your solution was? Updating to the latest version did not resolve it. |
It seems clear from this issue (and the parallel one in the original repository) that this is kind of a catch-all error for a variety of problems. Just to add my experience: I got this error as a result of sending a bad app id. Correcting that fixed the problem. As a debugging note, be sure to check the Android log (via DDMS, or whatever). That's where I was able to see the detailed exception that indicated the specific problem. |
Just so it will be mentioned here as well, my issue was with the "singleInstance" being set for android. |
For the past couple of days I had trouble getting anything to work at all (I am working in Construct 2, using Cranberrygames Phonegapp), and in XDK the jeduan facebook4 plugin. After solving everything from multidex errors and hash-keys, the final problem I was facing was this exact issue. After a couple of days of non-stop overthinking, I finally (partially) solved my problem with this one. I can't guarantee it will work for you, however, it's worth the try. What I did is to lower the version of the plugin, and I wanted to test each, but turns out the version 1.3.0 worked just fine for me, so I stuck with that. You may or may not solve your problem with this, but another thing I did (that may or may not have helped getting the thing to work) is that I have assigned the "login" AND the "get permission" request together after clicking the button you assign. Edit: Forgot to mention that for some odd reason, logging in works successfully and then from time to time, I still get the "user cancelled dialog" error. Quiting and starting the app works sometimes, but still annoying. |
i have the same error
that's my facebooklogin function in ionic 2
} who can help?` |
I was facing the same issue and the problem was with a wrong field name on the Graph API method. In this case we were passing "?fields=email,name,user_birthday,picture.width(200).height(200)" where user_birthday is not valid. Graph API returns an error and the the plugin returns it as 4201. You may check this as well. |
(Repost my comment from another thread here as its related) Ok, we came across this issue as well once just now and it is very likely related to a change in user permissions / scope that was initially accepted by the user on the first login. If you then go and change the permissions and try to log in again, Ionic2 will for a brief moment try to login and show a facebook page which is immediately dismissed and returns the response errorCode: 4201 - errorMessage: User cancelled dialog. I would assume that if there is a mismatch of permissions a user would have to accept a different set of permissions somehow? Perhaps this is missing in the cordova plugin? At present it seems the only way to adjust the permissions is to register a new application in Facebook and change the app to use a different APP_ID. Perhaps anyone can help out with this? |
happening after lastest update , it was all fine before. |
Go to you application info, then clear data and cache, that did the trick for me. |
@walfridosp we did that , it won't help . tried clearing all the info , including resetting facebook data. Nothing happens |
+1, same error here. Any update? |
@v3ss0n |
Tried creating a new cordova project and then added plugin in that. It worked. But not in already existing project. Could not detect the issue. |
hi , the problem is with android 4.4.4 please help it is important to support android 4.4.4 @jeduan please can you look into it.. |
android < 4.4.4 dosen't work. |
in this case just call facebookConnectPlugin.getLoginStatus to prevent the situation, something like: var getLoginStatus = function(){
window.facebookConnectPlugin.getLoginStatus(
function(data){
if(data.authResponse){
self.oauthDataFB = {
expires : data.authResponse.expiresIn,
access_token : data.authResponse.accessToken
};
}else{
self.oauthDataFB = null;
getLoginError({errorCode:4201});
}
},
function(e){
getLoginError(e);
}
);
};
window.facebookConnectPlugin.login(
permissions,
function(){
getLoginStatus();
},
function(e){
if(e.errorCode == 4201 && $agent.osLowerCase === 'android'){ // <--- the solution
getLoginStatus();
}else{
getLoginError(e);
}
}
); |
Any news for this issue ? It's not working for android <= 4.4. Any pr?? |
interesting @oleksiy-nesterov going to give a try. |
It's working for me now!. I founded that this plugin is incompatible with cordova-plugin-background-mode for android version <= 4.4. |
in your config.xml add this
i found that after adding the pref, the background-mode and facebook4 |
Changing the "AndroidLaunchMode" preference in config.xml did indeed solve my problems with this (thanks @adesst):
This can have a few side-effects, so read up before you switch, and decide if it's for you. E.g. Your app will potentially have multiple instances open at once, which is sometimes not a great thing. https://developer.android.com/guide/topics/manifest/activity-element.html#lmode |
Today i had the same problem (using ionic2 / fb-plugin). It looks like the demo / example on the ionic page is not correct and that causes the issue. Indeed, the error could be a bit more specific, but what i think it causes it, is the following: (thx to @Rondeus) Example from the Ionic page: If you check the Graph API from Facebook You will see, that there is no such thing like |
For me it was caused by not adding user as tester of facebook application. It was hard to find, because it sometimes failed with "User cancelled dialog" message and sometimes without any message. |
I am getting this error too. It looks like I am able to login successfully...but I get the error when trying to do a post. Just before the post I am checking login status with 👍
Login status responds with "connected" and all the tokens, expire, session data....so my issue must be related to actually trying to post something. Any ideas? |
@zaggaz - I tried what you did...deleted my app and reinstalled but that didn't change my situation. I am still getting that error when trying to post things to users FB page. My login/auth appears to work. |
Did you see this here?
Meaning at your login you will need to add that permission like so: Greetings... |
@jwiesmann - thanks for the input. I added
Then in my app I try to post something to the user's FB page and following FB page pops up on the phone (appears to be web page) saying:
And then when I close that page, my app gets the following error:
It also occurs to me the DOCS link you sent me is for the Graph API. I am trying to use the showDialog - I am wondering if that is a part of the problem. Everything I read about showDialog though indicates I should be able to post messages to a users FB page. |
I finally got it figured out. It was a combo of my hash key being wrong and passing the wrong parameters to the |
Just an FYI: You will get this error if you are trying to log the user in with the https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#login-4-24 |
I have a fresh Ionic App, no customizations except the facebook4 plugin. It doesn't work. I get the same response, "user cancelled" as the error from the then/catch. I'm also using the sample code from the readme. Error in X-Code is:
Basic setup:
|
You could check your AndroidManifest.xml <application ... > if not set, then please check your config.xml Another approach you could try is:
tq |
Hi Team! I was able to get this working by "starting over". apparently, something was off in my environment. so I
|
For signup process login with Facebook is working. But after login i need some more permissions from user. i.e "manage_pages" permission in order to get user's Instagram business account info which i need to get on a different page(Not on the signup page).In order to get Instagram basic info we need to login again with Fb in order to get required permissions. But every time i get the same error " 4201 : user cancelled dialog ". Code is working fine on ios , issue is with android only
|
This plugin is deprecated. Check out the actively maintained fork |
Whenever I use a lollipop or higher device, login always returns 4201 User cancelled dialog.
I've checked my hashes and they seem fine as it works with Wizcorp/phonegap-facebook-plugin. However the Wizcorp/phonegap-facebook-plugin doesn't work with the official push plugin due to build issues.
Any help on this would be great! The android version i'm using is 5.1.1.
The text was updated successfully, but these errors were encountered: