Removal of an add-in only moves the add-in to the user's recycle bin.Two more steps are required before the App Uninstalling event is triggered.Add-in events are also handled by remote web services, but they are configured differently in the add-in package from list and list item RERs, so they are treated as a separate category of component.For an add-in event, the remote web service is registered in the add-in manifest, not in an add-in web Feature.The main purpose of a handler for this event is to delete or recycle things that were deployed with a App Installed (or an App Updated) handler.
There are three add-in events as described in the next sections.
For more information, see Include rollback logic and "already done" logic in your add-in event handlers.
Note When you install an add-in with Tenant scope, it is installed to the add-in catalog site collection and the App Installed event runs then and only then.
This last task triggers the App Uninstalling event.
The App Uninstalling event is synchronous and you can use it to cancel the uninstallation, which would leave the add-in in the second stage recycle bin.
To change the events that the remote event receiver handles, open Solution Explorer, open the Properties window for the remote event receiver, expand the Share Point Events node, and then set only the events that you want to handle to True.