In the earlier articles, we saw how to deploy APPs programmatically. In this Article, as a continuation, let us see how to make an APP available for all the Existing Sites in the SharePoint Tenant and even the new sites which will be created in future will also have this APP. This concept is known as APP Stapling. Even this also have its own limitations.
The major limitation is, the APP Installed and Un Installed Events will not be triggered. As an output, this cannot be directly used for remote event receivers. We can use this for remote event receivers with some sort of work around. But they are logical implementation. Now, in this article, let us focus on the Technical implementation alone.
Now, I am focusing on how to implement App Stapling alone. The Pros and Cons of APP Stapling can be read from many sources.
In simple words, instead of deploying the APP in any Site Collection, we are going to deploy the APP on the APP Catalog Site itself. In Office 365, APP Catalog is a special site collection, on which the APPS will be uploaded and will be available to deploy on all the site collections within the tenant.
With this brief introduction, let us see how to do this.
1. Prepare the APP Package.
2. Login to the APP Catalog Site Collection.
3. In my case, it is https://******.sharepoint.com/sites/AppCatalog
4. Click on “APPs for SharePoint”
5. Upload the APP.
6. Go to Site Contents.
7. Click on Add an APP
8. The Uploaded APP will be listed on the page.
9. Add the APP.
10. Trust it.
11. Now, the APP got Installed.
12. Click on the Eclipse.
13. Select the Deployment.
14. We will be seeing the Manage APP Deployments Screen.
16. On which Select the Criteria. In my case, I wanted to deploy this APP on All the Community Sites. Hence, I chose the Community Sites on the Site Templates and Click OK.
18. Prompted with Trust again. Click Trust.
19. Now, let me go back to my Community Site. The app will be listed on the Site Contents.
21. This will be deployed, even if we create a new Community Site also.
Hope this is useful for the developers who are dealing with a huge number of sites in their tenant.