Cordova Facebook plugin


#1

Hi everybody.

I am using $cordovaFacebook plugin and my question is: How to keep FB Login on session?
Curiously, the web version is working but iOS version not.
My code:

(controllers.js)

angular.module('starter.controllers', [])

.controller('HomeCtrl', ['$scope', '$cordovaFacebook', '$state', function($scope, $cordovaFacebook, $state) {	
	$scope.FacebookLoginBtn = function() {
		$cordovaFacebook.login(["public_profile", "email", "user_friends", "user_relationship_details", "user_photos"])
		.then(function(success) {  
			$state.go('perfil');
		}, function (error) {
		  // error
		  console.log(error);
		});
	};
}])

.controller('PerfilCtrl', ['$scope', '$cordovaFacebook', function ($scope, $cordovaFacebook) {
	$cordovaFacebook.api("me/picture?redirect=false&type=large", ["public_profile"])
    .then(function (success) {
    	$scope.foto = success.data;
    	// console.log(success.data);
    }, function (error) {
		console.log(error);
	});

	$cordovaFacebook.api("me", ["public_profile"])
	.then(function(success) {
		$scope.me = success;
		// console.log(success);
	}, function (error) {
		console.log(error);
	});
}])