In earlier blog posts on this site I have demonstrated various techniques / approaches that enable App Makers to incorporate highly optimized photos / images within their own apps that are stored in SharePoint Online document libraries.
In the earliest of my blogs on this topic I detailed by way of example how one could leverage the SharePoint RenderListDataAsStream REST API to implement such a solution, and subsequently shared the source code for the two demo apps depicts in the initial blog.
Subsequent to those blogs, Microsoft released an updated version of a subset of the Graph APIs that now enables apps and toolsets such as Flow to consume the updated Graph APIs by passing a temporary authentication token, alleviating the need for app developers to first register an app in Azure.
- Working with SharePoint sites in Microsoft Graph
- Displaying file thumbnails from a SharePoint library in PowerApps
This change now makes in possible for Citizen Developers to consume at least some content exposed by the broader set of Graph APIs within their own apps without requiring adequate permissions in Azure and far more developer-oriented technical expertise to create even the simplest of apps leveraging PowerApps and Flow.
Microsoft deem leveraging the updated Graph APIs as a recommended approach as compared to the technique I had earlier blogged on (that is still an alternate approach) that enabled similar outcomes using the SharePoint RenderListDataAsStream REST API.
The corresponding Graph APIs are considered the recommended technique approach now primarily for security concerns in addition to the limited documentation available for RenderListDataAsStream API and because the schema for said API may well change in future, potentially breaking your apps should you have leveraged that pattern.
Following the updated release of these new Graph APIs, I refactored one of the two demo apps I showcased in my initial blog post to instead consume the Graph APIs, such that it is now evident that both techniques are equally highly efficient and are similar in terms of complexity as this relates to implementing an app leveraging either of these two patterns.
As I have previously gone into extensive detail elaborating on the code relating to the specific functionality implemented in the Graph API technique, for this blog I wanted showcase the genuine levels of image optimization achieved using the Graph APIs by equally demonstrating within the app the extent of the optimization achieved by visually comparing the size and quality of the photos rendered within the app against that of the original photos stored in a SharePoint Online Site Assets document library.
The demo video speaks volumes to this particular point!
The takeaway from this post is that regardless of your specific reasons for wanting to display images within your apps, techniques such as the one showcased in this blog will almost certainly improve the overall performance of your app, which in turn naturally enhances the user experience whilst you equally will marvel at how efficient your apps render photos / images stored in SharePoint Online document libraries (not attachments in Lists).
Source code for mobile demo app
The source code including the mobile PowerApp and associated Flow have been shared on GitHub ?.