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

Commit 4d4a4d4

Browse files
#115 Facebook Authentication Redirect
#107 Facebook Login does not return any result in iOS
1 parent cb05a8c commit 4d4a4d4

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

firebase.ios.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,32 @@ firebase.addAppDelegateMethods = function(appDelegate) {
3838

3939
if (typeof(GIDSignIn) !== "undefined") {
4040
appDelegate.prototype.applicationOpenURLOptions = function (application, url, options) {
41-
42-
return GIDSignIn.sharedInstance().handleURLSourceApplicationAnnotation(
41+
var result = false;
42+
if (typeof(FBSDKApplicationDelegate) !== "undefined") {
43+
result = FBSDKApplicationDelegate.sharedInstance().applicationOpenURLSourceApplicationAnnotation(
44+
application,
45+
url,
46+
options.valueForKey(UIApplicationOpenURLOptionsSourceApplicationKey),
47+
options.valueForKey(UIApplicationOpenURLOptionsAnnotationKey));
48+
}
49+
// for iOS >= 9
50+
result = result || GIDSignIn.sharedInstance().handleURLSourceApplicationAnnotation(
4351
url,
4452
options.valueForKey(UIApplicationOpenURLOptionsSourceApplicationKey),
4553
options.valueForKey(UIApplicationOpenURLOptionsAnnotationKey));
54+
return result;
4655
};
47-
/* no need for this one
48-
appDelegate.prototype.signDidDisconnectWithUserWithError = function (signIn, user, error) {
56+
57+
// Untested, so commented out
58+
/*
59+
appDelegate.prototype.signDidDisconnectWithUserWithError = function (signIn, user, error) {
4960
if (error === null) {
5061
console.log("--- OK in signDidDisconnectWithUserWithError");
5162
} else {
52-
console.log("--- error in signDidDisconnectWithUserWithError: " + error.localizedDescription);
63+
console.log("--- error in signDidDisconnectWithUserWithError: " + error.localizedDescription);
5364
}
54-
};
55-
*/
65+
};
66+
*/
5667
}
5768

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

588-
if(arg.scope) {
599+
if (arg.scope) {
589600
scope = arg.scope;
590601
}
591602

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-plugin-firebase",
3-
"version": "3.5.3",
3+
"version": "3.5.4",
44
"description" : "Fire. Base. Firebase!",
55
"main" : "firebase.js",
66
"nativescript": {

0 commit comments

Comments
 (0)