title: Uninstall tracking iOS and Android apps with inactive device token and silent push
body: <p>There are several posts and discussions about uninstall tracking of iOS and Android apps.
  We would like to achieve this as well and tried the suggested solutions, but we found out, that this does not work as expected.</p>
  
  <p>The way this should be done is to send a silent push to the device token and then checking the response if it was successfully.
  In our case, the response is always</p>
  
  <p>success:1 </p>
  
  <p>until the device itself requests or receives a new token and this only happens when the app is installed. </p>
  
  <p>Maybe the token expires on its own, but this is not an option (I found a comment who mentioned the token will expire after 24 months, this is to long for uninstall tracking).</p>
  
  <p>Maybe we are doing something wrong, but this is our way:</p>
  
  <p>Silent push via <a href="https://fcm.googleapis.com/fcm/send" rel="nofollow noreferrer">https://fcm.googleapis.com/fcm/send</a></p>
  
  <pre><code>{
  "to" : "{device-token}",
  "content_available": true,
  }
  </code></pre>
  
  <p>respond is</p>
  
  <pre><code>{
  "multicast_id": {any-id},
  "success": 1,
  "failure": 0,
  "canonical_ids": 0,
  "results": [
      {
          "message_id": "{any-id}"
      }
  ]
  }
  </code></pre>
  
  <p>this response only gets success:0 failure:1 when the app itself receives / requests a new token, and the message is sent to a previous one, but this is only the case when it is still installed.</p>
  
  <p>Another idea would be to send a silent push, which triggers a web call from the app to the server. If the call is received during a defined time, the app is installed, if not, its marked as uninstalled. But this only works if the app is not fully closed on android (force close).</p>
  
  <p>We also tried the ttl or apns-expiration but this does not work as well as we expect it.</p>
  
  <p>Question:
  what do we have to change in order to recognise the uninstall via silent push notification, or what are the requirements to achieve this or we have to be aware of?
  How and when is the push token invalid when an app gets uninstalled?</p>