I have a problem with an Ionic Framework app that uses Parse.com’s Facebook Login.
I have followed the instructions on the Parse.com website (https://parse.com/docs/js_guide#fbusers-setup) and have had no luck, spent the entire day on it today.
The code I have in my app.js
Parse.initialize('xxxxxx', 'xxxxx');
window.fbAsyncInit = function() {
// FB.init({
// appId : 'xxxxxxxx',
// status : true,
// xfbml : true,
// version : 'v2.0'
// });
Parse.FacebookUtils.init({
appId: 'xxxxxx',
cookie: true,
status: true,
useCachedDialogs: false,
logging: true,
oauth: true
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
var currentUser = Parse.User.current();
$rootScope.user = null;
$rootScope.loggedIn = false;
if (currentUser) {
$rootScope.user = currentUser;
$rootScope.loggedIn = true;
}
$rootScope.userActionText = $rootScope.loggedIn ? 'Sign out' : 'Create account';
});
The settings I have on the FB app:
Basic Settings: https://www.dropbox.com/s/3c6vib6i323bbvf/Basic.png?dl=0
Advanced Settings: https://www.dropbox.com/s/f5q3rgh7v014ohf/Advanced.png?dl=0
I use the iOS Simulator and ran the app on the device. After tapping “Login with Facebook” it goes to a “browser” type of screen and shows the following error:
Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App’s settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App’s domains.
I have tried:
- Every single Google result with the error message and relevant results
- Adding in channel URL’s hosting on myapp.parseapp.com/channel.html
- Using the FB.init method that is commented out
- Changing up the FB App settings from localhost to a online domain
- Different variations of the init key:val
Does anyone have experience with Parse.com and Ionic Framework who could shed some light on what I can do to solve this problem?