When a user installs an app from the marketplace the following events are fired:
INSTALLED
ENABLED
In this case the app is ENABLED and the user is ready to use the app.
When a user uninstalls an app the following events are fired:
DISABLED
UNINSTALLED
In this case the app is UNINSTALLED and the user cannot use the app.
Case 1: Site rename
This blog post says that the INSTALLED event is fired when a user renames its site and the
app will be notified with the new base URL:
In this case the app is INSTALLED and no ENABLED event is fired. Is it the normal behaviour?
Let me answer your questions here about Case 1: Q : In this case the app is INSTALLED and no ENABLED event is fired. Is it the normal behaviour?
A : Yes, this is the normal behaviour. The installed endpoint is used to send information on the site rename event and the app remains enabled
Q : What should the user see in this case?
A : If any logic is required by the app for site renames, please configure it using the INSTALLED event. In general, we do not expect the user to see anything unusual or even to be aware of this operation. The app will continue to work as normal.
Q: A working app like in the ENABLED case?
A : Yes, this is correct.
For context and a bit of history, the ENABLED and DISABLED lifecycle events were associated with the ability to enable and disable the apps via the UI. The option in the UI has now been removed but, in case of a app installation both INSTALLED and ENABLED will be fired at the same time. In a similar way both DISABLED and UNISTALLED events are fired when the app is uninstalled. In case of a site rename though, just the INSTALLED will be sent.
About Case 2:
Let me know if you are still looking for those answers and I can try to get a team member to help.
Q: Which events are fired automatically by the marketplace and when? A: Each site, approximately every 6 hours, checks the marketplace for new app versions. If the app version does not require manual approval (i.e. it has no change in scopes), it is installed automatically and the INSTALLED event is sent.
Q: Which events are fired when the user approves manually the changes? A: if the new app version requires a manual approval, the user approval triggers an installation and the INSTALLED event is sent.
Q: How should work the app if the user does not approve the changes manually? A: For changes requiring approval and until an approval is not granted, no installation will occur and therefore the INSTALLED event will not be fired.