Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
#115 Facebook Authentication Redirect
Browse files Browse the repository at this point in the history
#107 Facebook Login does not return any result in iOS
  • Loading branch information
EddyVerbruggen committed Aug 29, 2016
1 parent 9e28222 commit 055d33c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
29 changes: 20 additions & 9 deletions firebase.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,32 @@ firebase.addAppDelegateMethods = function(appDelegate) {

if (typeof(GIDSignIn) !== "undefined") {
appDelegate.prototype.applicationOpenURLOptions = function (application, url, options) {

return GIDSignIn.sharedInstance().handleURLSourceApplicationAnnotation(
var result = false;
if (typeof(FBSDKApplicationDelegate) !== "undefined") {
result = FBSDKApplicationDelegate.sharedInstance().applicationOpenURLSourceApplicationAnnotation(
application,
url,
options.valueForKey(UIApplicationOpenURLOptionsSourceApplicationKey),
options.valueForKey(UIApplicationOpenURLOptionsAnnotationKey));
}
// for iOS >= 9
result = result || GIDSignIn.sharedInstance().handleURLSourceApplicationAnnotation(
url,
options.valueForKey(UIApplicationOpenURLOptionsSourceApplicationKey),
options.valueForKey(UIApplicationOpenURLOptionsAnnotationKey));
return result;
};
/* no need for this one
appDelegate.prototype.signDidDisconnectWithUserWithError = function (signIn, user, error) {

// Untested, so commented out
/*
appDelegate.prototype.signDidDisconnectWithUserWithError = function (signIn, user, error) {
if (error === null) {
console.log("--- OK in signDidDisconnectWithUserWithError");
} else {
console.log("--- error in signDidDisconnectWithUserWithError: " + error.localizedDescription);
console.log("--- error in signDidDisconnectWithUserWithError: " + error.localizedDescription);
}
};
*/
};
*/
}

// making this conditional to avoid http://stackoverflow.com/questions/37428539/firebase-causes-issue-missing-push-notification-entitlement-after-delivery-to ?
Expand Down Expand Up @@ -327,7 +338,7 @@ firebase.init = function (arg) {
firebase.notifyAuthStateListeners({
loggedIn: user !== null,
user: toLoginResult(user)
});
});
};
FIRAuth.auth().addAuthStateDidChangeListener(firebase.authStateListener);
}
Expand Down Expand Up @@ -585,7 +596,7 @@ firebase.login = function (arg) {
//fbSDKLoginManager.loginBehavior = FBSDKLoginBehavior.Web;
var scope = ["public_profile", "email"];

if(arg.scope) {
if (arg.scope) {
scope = arg.scope;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-plugin-firebase",
"version": "3.5.3",
"version": "3.5.4",
"description" : "Fire. Base. Firebase!",
"main" : "firebase.js",
"nativescript": {
Expand Down

0 comments on commit 055d33c

Please sign in to comment.