{"action":"created","issue":{"url":"https://api.github.com/repos/Wizcorp/phonegap-facebook-plugin/issues/979","labels_url":"https://api.github.com/repos/Wizcorp/phonegap-facebook-plugin/issues/979/labels{/name}","comments_url":"https://api.github.com/repos/Wizcorp/phonegap-facebook-plugin/issues/979/comments","events_url":"https://api.github.com/repos/Wizcorp/phonegap-facebook-plugin/issues/979/events","html_url":"https://github.com/Wizcorp/phonegap-facebook-plugin/pull/979","id":68411000,"number":979,"title":"auth_type: 'rerequest' support","user":{"login":"robotvert","id":514215,"avatar_url":"https://avatars.githubusercontent.com/u/514215?v=3","gravatar_id":"","url":"https://api.github.com/users/robotvert","html_url":"https://github.com/robotvert","followers_url":"https://api.github.com/users/robotvert/followers","following_url":"https://api.github.com/users/robotvert/following{/other_user}","gists_url":"https://api.github.com/users/robotvert/gists{/gist_id}","starred_url":"https://api.github.com/users/robotvert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robotvert/subscriptions","organizations_url":"https://api.github.com/users/robotvert/orgs","repos_url":"https://api.github.com/users/robotvert/repos","events_url":"https://api.github.com/users/robotvert/events{/privacy}","received_events_url":"https://api.github.com/users/robotvert/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-04-14T15:24:54Z","updated_at":"2015-07-10T23:49:47Z","closed_at":"2015-04-14T16:33:37Z","pull_request":{"url":"https://api.github.com/repos/Wizcorp/phonegap-facebook-plugin/pulls/979","html_url":"https://github.com/Wizcorp/phonegap-facebook-plugin/pull/979","diff_url":"https://github.com/Wizcorp/phonegap-facebook-plugin/pull/979.diff","patch_url":"https://github.com/Wizcorp/phonegap-facebook-plugin/pull/979.patch"},"body":"Addresses issues #837 and #642 \r\n\r\nadd 'rerequest' to the permissions array to re-ask for declined permissions, for instance:\r\n\r\n```javascript\r\n// first call\r\nfacebookConnectPlugin.login(['email'], ....)\r\n\r\n// after the user declined the email permission, to retry:\r\nfacebookConnectPlugin.login(['email', 'rerequest'], ....)\r\n```\r\n\r\nsee [the facebook docs](https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.3#re-asking-declined-permissions) for the proper way to use this great power which of course comes with great responsibility.\r\n\r\nnot too happy about the mixing of permissions and auth_type but it keeps the whole thing simple and backward compatible this way."},"comment":{"url":"https://api.github.com/repos/Wizcorp/phonegap-facebook-plugin/issues/comments/120552138","html_url":"https://github.com/Wizcorp/phonegap-facebook-plugin/pull/979#issuecomment-120552138","issue_url":"https://api.github.com/repos/Wizcorp/phonegap-facebook-plugin/issues/979","id":120552138,"user":{"login":"seblau","id":3884582,"avatar_url":"https://avatars.githubusercontent.com/u/3884582?v=3","gravatar_id":"","url":"https://api.github.com/users/seblau","html_url":"https://github.com/seblau","followers_url":"https://api.github.com/users/seblau/followers","following_url":"https://api.github.com/users/seblau/following{/other_user}","gists_url":"https://api.github.com/users/seblau/gists{/gist_id}","starred_url":"https://api.github.com/users/seblau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seblau/subscriptions","organizations_url":"https://api.github.com/users/seblau/orgs","repos_url":"https://api.github.com/users/seblau/repos","events_url":"https://api.github.com/users/seblau/events{/privacy}","received_events_url":"https://api.github.com/users/seblau/received_events","type":"User","site_admin":false},"created_at":"2015-07-10T23:49:47Z","updated_at":"2015-07-10T23:49:47Z","body":"Still **not working** here (Ionic Framework & iOS) despite a checked out `develop`-branch.\r\n\r\nThe Facebook Login redirects me to the following URL:\r\n`https://m.facebook.com/v2.2/dialog/oauth?sdk_version=3.21.1& [...] &scope=email,user_birthday,user_events,rerequest [...]`\r\n\r\nThe **rerequest** should definitely not appear in the `scope`-parameter in the url. It should rather be a separate url field like: `auth_type=rerequest`.\r\n\r\n@robotvert: Your new `login`-function is responsible for extracting the `rerequest`from the permissions list into an own url field. Unfortunately, for some reason it shows no effect, because the `rerequest`-permission entry gets handled like a permission and is not extracted from the list by the login function.\r\n\r\n        // Attach this to a UI element, this requires user interaction.\r\n        login: function (permissions, s, f) {\r\n            // JS SDK takes an object here but the native SDKs use array.\r\n            var options = {};\r\n            if (permissions && permissions.length > 0) {\r\n                var index = permissions.indexOf('rerequest');\r\n                if (index > -1) {\r\n                    permissions.splice(index, 1);\r\n                    options.auth_type = 'rerequest';\r\n                }\r\n                options.scope = permissions.toString();\r\n            }\r\n            \r\n            FB.login(function (response) {\r\n                if (response.authResponse) {\r\n                    s(response);\r\n                } else {\r\n                    f(response.status);\r\n                }\r\n            }, options);\r\n        },\r\n\r\nDoes anyone have a plane why this is the way it is?"}}