Hi,
We’ve been trying to get Native FB Login working (we have the in app browser login working). For some reason when I’m injecting $ionicFacebookAuth in my controller or service, I get “Unknown provider: $ionicFacebookAuthProvider”. This is how my code looks:
package.json
"@ionic/cloud": "^0.13.0",
config.xml
<plugin name="cordova-plugin-facebook4" spec="~1.7.4">
<variable name="APP_ID" value="12345"/>
<variable name="APP_NAME" value="xyz"/>
</plugin>
index.html
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<script src="lib/bluebird.min.js"></script>
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic.cloud.min.js"></script>
app.js
angular.module('app', ['ionic', 'ionic.cloud', 'app.controllers', 'app.routes', 'app.directives','app.services'])
.config(function($ionicCloudProvider) {
$ionicCloudProvider.init({
"core": {
"app_id": "12345"
},
"auth": {
"facebook": {
"scope": ["email", "public_profile"]
}
}
});
})
controllers.js
.controller('loginCtrl', ['$scope', '$stateParams','$ionicAuth', '$ionicUser','$http','$state', 'AuthService',
function ($scope, $stateParams, $ionicAuth, $ionicUser, $http, $state, AuthService) {
$scope.loginToFB = function() {
AuthService.loginFB();
};
services.js
function($ionicFacebookAuth, $ionicAuth, $ionicUser, $ionicHistory, $http, $state, SecureStorageService) {
this.loginFB = function () {
....
At this point I haven’t even attempted to actually login (using $ionicFacebookAuth.login().then…)
I have the inapp browser login working just fine, but I wanted to get the native logging working. I have the cordova plugin installed and everything. For some reason I’m not able to get past this error.
I realise that this seems like a n00b problem, I apologise in advance for that. But for some reason I just cannot solve this and would appreciate any help.
Thank you!