title: Changing badge count in Push Notifications with Expo in background and foreground
body: <p>I was looking into ways to send push notifications to a native app and reading the expo documentation, I got confused by two bits of information that seem to contradict each other. </p>
  
  <blockquote>
    <p>Notifications will appear in the system notification tray as you've
    come to expect, and tapping them will <strong><em>open</em></strong>/<strong><em>foreground</em></strong> the app.</p>
  </blockquote>
  
  <p>(source: <a href="https://docs.expo.io/versions/latest/guides/push-notifications" rel="nofollow noreferrer">https://docs.expo.io/versions/latest/guides/push-notifications</a>)</p>
  
  <p>But in the section 'why not expo'  it states :</p>
  
  <blockquote>
    <p>Expo apps don't support background code execution (running code when
    the app is not foregrounded or the device is sleeping). This means you
    cannot use background geolocation, play audio in the background,
    handle <strong><em>push notifications in the background</em></strong>, and more.</p>
  </blockquote>
  
  <p>(source: <a href="https://docs.expo.io/versions/latest/introduction/why-not-expo" rel="nofollow noreferrer">https://docs.expo.io/versions/latest/introduction/why-not-expo</a>)</p>
  
  <p>That seems contradictory since 'foregrounding' or 'opening' an app implies that it was running in the background how I see it. </p>
  
  <p>In the end I would like to change the notification badge of an app icon with this, but given this info it's not clear to me if this is possible ?   In IOS and Android ? </p>