Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

How to get the logged in firebase user with native code in android studio

$
0
0

I have an application in ionic 3 with angular, I am trying to integrate instana but the apis do not have for ionic, so in the android studio I am implementing it but when making the call to firebase I always have the firebase user null

public class MainActivity extends CordovaActivity {

  public FirebaseAuth mAuth;
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // enable Cordova apps to be started in the background
    Bundle extras = getIntent().getExtras();
    if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
      moveTaskToBack(true);
    }

    // Set by <content src="index.html" /> in config.xml
    loadUrl(launchUrl);
  }

  @Override
  public void onStart() {
    super.onStart();
      mAuth = FirebaseAuth.getInstance();
  
    FirebaseUser currentUser = mAuth.getCurrentUser();
    if (currentUser != null) {
      Log.i(TAG, "onstart: " + currentUser);
    }else{
      Log.i(TAG, "onstart: null user");
    }
  }

  private void reload() { }
}

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>