title: Firebase 3 with ionic 2 google authentication
body: <p>I am new to mobile app development and ionic 2. I get the google authentication working fine for a web app using angularfire2 but that doesn't work on a mobile device (yet?).
  I am using ionic 2 version 2.0.0-beta.35 and firebase 3.2.1</p>
  
  <p>Searching led me to the understanding that for the time being I need to use the google+ plugin for cordova, which I have installed.</p>
  
  <p>I am trying this method in my ts code:</p>
  
  <pre><code>loginWithGooglePlugin()
  {
      return Observable.create(observer =&gt;
      {
          // note for iOS the googleplus plugin requires ENABLE_BITCODE to be turned off in the Xcode
          window.plugins.googleplus.login(
              {
                  'scopes': 'profile email', // optional, space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.
                  'webClientId': '_google_client_app_id_.apps.googleusercontent.com',
                  'offline': true, // optional, but requires the webClientId - if set to true the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server
              },
              function (authData)
              {
                  console.log('got google auth data:', JSON.stringify(authData, null, 2));
                  let provider = firebase.auth.GoogleAuthProvider.credential(authData.idToken, authData.accessToken);
                  firebase.auth().signInWithCredential(provider).then((success) =&gt;
                  {
                      console.log('success!', JSON.stringify(success, null, 2));
                      observer.next(success);
                  }, (error) =&gt;
                  {
                      console.log('error', JSON.stringify(error, null, 2))
                  });
              },
              function (msg)
              {
                  this.error = msg;
              }
          );
      });
  }
  </code></pre>
  
  <p>But the compiler keeps complaining about two things:
  1. window.plugins is unknown. How can I convince ts that it's there?</p>
  
  <ol start="2">
  <li>There is no <code>credential</code> on the <code>GoogleAuthProvider</code> object. Searching yielded this link: <a href="https://firebase.google.com/docs/reference/android/com/google/firebase/auth/GoogleAuthProvider" rel="nofollow">firebase docs</a> which says there was a method <code>getCredential</code>, which is not recognized either.</li>
  </ol>
  
  <p>My <code>typings</code> seem to be fine. <code>GoogleAuthProvider</code> itself is recognized.</p>
  
  <p>How can I fix this?</p>