title: Firebase RealTime Database + Google Sign In
body: <p>How can I use Firebase Realtime Database when I only want to use the Google Sign-In? Is there a way to tell the database that I am logged in?</p>
  
  <p>As default the rules say:</p>
  
  <pre><code>write: auth != null 
  read: auth != null
  </code></pre>
  
  <p>How can I tell the DB that after I signed in through Google Sign-In that <code>"auth != null"</code>.</p>
  
  <p>I hope I made myself clear, if not please let me know.</p>
  
  <p><strong>EDIT:</strong>
  I changed the Rules to the below but still, nothing</p>
  
  <pre><code>{
    "rules": {
      ".read": "auth != null &amp;&amp; auth.provider == 'google'",
      ".write": "auth != null &amp;&amp; auth.provider == 'google'"
    }
  }
  </code></pre>
  
  <p>So it seems like I am prepared because in the Rule-Simulator it works but I still don't know how to tell the DB that after I signed in to my Google Account in my Android phone.</p>
  
  <p>After I login I do a simple write:</p>
  
  <pre><code>DatabaseReference mDatabaseReference = FirebaseDatabase.getInstance().getReference("message");
  mDatabaseReference.setValue("HELLO");
  </code></pre>