title: react native. the close event of the application
body: <p>On one of the pages of the developed application for ios on react native there is a switch components. When interacting with them, the state of the switches is stored in the Redux storage, but when leaving the page or leaving the application, you need to send the state data to the server. Leaving the page is implemented as follows:</p>
  
  <pre><code>props.navigation.addListener('willBlur', async() =&gt; {
    props.pushDataOnServer(data, token);
  });
  </code></pre>
  
  <p>We add a navigation handler (StackNavigator) for the <code>willBlur</code> event, thus we can catch the transition to another page, but what about when closing the application directly from the edit page of the switches? Is there any event for this (e.g. <code>willExit</code>, <code>willClose</code>)? Or if you know a more effective way, please tell us</p>