title: Android 23+ - Exclude GCM Registration ID from backup
body: <p>I have an app which uses Azure to send Push notifications.  Azure in turn, uses GCM to send to Android devices.  </p>
  
  <p>I'm noticing that I have a warning in my AndroidManifest.xml stating </p>
  
  <blockquote>
    <p>On SDK version 23 and up, your app data will be automatically backed
    up, and restored on app install. Your GCM regid will not work across
    restores, so you must ensure that it is excluded from the back-up set.
    Use the attribute android:fullBackupContent to specify an @xml
    resource which configures which files to backup.</p>
  </blockquote>
  
  <p>I have following the instructions here <a href="https://developer.android.com/training/backup/autosyncapi.html?hl=in#configuring" rel="noreferrer">https://developer.android.com/training/backup/autosyncapi.html?hl=in#configuring</a></p>
  
  <p>however I am stumped as to how to exclude the GCM regID from the backup?  Here is my current setup.</p>
  
  <p>Manifest</p>
  
  <pre><code>&lt;application
          android:allowBackup="true"
          android:fullBackupContent="@xml/backup_scheme"
          ........
  </code></pre>
  
  <p>res/xml/backup_scheme.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;full-backup-content&gt;
      &lt;exclude domain="sharedpref" path=""/&gt;
  &lt;/full-backup-content&gt;
  </code></pre>
  
  <p>What do I put as path?  Am I supposed to have a physical file somewhere I exclude?  </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>So I think I figured it out.  In my RegistrationIntentService.java file, I store the users registrationID in the shared preferences under the string "registrationID".  So I'm assuming I use the following...</p>
  
  <pre><code>&lt;exclude domain="sharedpref" path="registrationID"/&gt;
  </code></pre>
  
  <p>right?</p>