@@ -186,7 +186,7 @@ firebase.init = function (arg) {
186186
187187 // Facebook
188188 if ( typeof ( com . facebook ) !== "undefined" ) {
189- com . facebook . FacebookSdk . sdkInitialize ( appModule . android . context ) ;
189+ com . facebook . FacebookSdk . sdkInitialize ( com . tns . NativeScriptApplication . getInstance ( ) ) ;
190190 fbCallbackManager = com . facebook . CallbackManager . Factory . create ( ) ;
191191 appModule . android . on ( appModule . AndroidApplication . activityResultEvent , function ( eventData ) {
192192 if ( eventData . requestCode !== GOOGLE_SIGNIN_INTENT_ID ) {
@@ -280,7 +280,7 @@ firebase.getRemoteConfigDefaults = function (properties) {
280280} ;
281281
282282firebase . _isGooglePlayServicesAvailable = function ( ) {
283- var context = appModule . android . context ;
283+ var context = com . tns . NativeScriptApplication . getInstance ( ) ;
284284 var playServiceStatusSuccess = com . google . android . gms . common . ConnectionResult . SUCCESS ; // 0
285285 var playServicesStatus = com . google . android . gms . common . GoogleApiAvailability . getInstance ( ) . isGooglePlayServicesAvailable ( context ) ;
286286 return playServicesStatus === playServiceStatusSuccess ;
@@ -304,7 +304,7 @@ firebase.analytics.logEvent = function (arg) {
304304 }
305305 }
306306
307- com . google . firebase . analytics . FirebaseAnalytics . getInstance ( appModule . android . currentContext || appModule . android . context ) . logEvent ( arg . key , bundle ) ;
307+ com . google . firebase . analytics . FirebaseAnalytics . getInstance ( appModule . android . currentContext || com . tns . NativeScriptApplication . getInstance ( ) ) . logEvent ( arg . key , bundle ) ;
308308
309309 resolve ( ) ;
310310 } catch ( ex ) {
@@ -326,7 +326,7 @@ firebase.analytics.setUserProperty = function (arg) {
326326 return ;
327327 }
328328
329- com . google . firebase . analytics . FirebaseAnalytics . getInstance ( appModule . android . currentContext || appModule . android . context ) . setUserProperty ( arg . key , arg . value ) ;
329+ com . google . firebase . analytics . FirebaseAnalytics . getInstance ( appModule . android . currentContext || com . tns . NativeScriptApplication . getInstance ( ) ) . setUserProperty ( arg . key , arg . value ) ;
330330
331331 resolve ( ) ;
332332 } catch ( ex ) {
@@ -605,7 +605,7 @@ firebase.login = function (arg) {
605605 }
606606 } ) ;
607607
608- firebase . _mGoogleApiClient = new com . google . android . gms . common . api . GoogleApiClient . Builder ( appModule . android . context )
608+ firebase . _mGoogleApiClient = new com . google . android . gms . common . api . GoogleApiClient . Builder ( com . tns . NativeScriptApplication . getInstance ( ) )
609609 . addOnConnectionFailedListener ( onConnectionFailedListener )
610610 . addApi ( com . google . android . gms . auth . api . Auth . GOOGLE_SIGN_IN_API , googleSignInOptions )
611611 . build ( ) ;
@@ -745,7 +745,7 @@ firebase.createUser = function (arg) {
745745 reject ( "Creating a user failed. " + ( task . getException ( ) && task . getException ( ) . getReason ? task . getException ( ) . getReason ( ) : task . getException ( ) ) ) ;
746746 } else {
747747 var user = task . getResult ( ) . getUser ( ) ;
748- resolve ( { key : user . getUid ( ) } ) ;
748+ resolve ( toLoginResult ( user ) ) ;
749749 }
750750 }
751751 } ) ;
0 commit comments