NEW EXPERIENCES IN 6 SHORT STEPS
Users can customize iOS App Icons after downloading their Xamarin app
Programmatically change iOS Xamarin app icon dynamically
At December’s Xamarin Community Standup, the Senior Microsoft Xamarin PM David Ortinau, talked about how the official GitHub app impressed him because it allowed him to update the app icon ‘after’ installing the app. He also mentioned that it is a possibility to do with Xamarin, but there isn’t a Xamarin article about it. I was curious to see how to do it and realized it’s really simple. You can also hop straight to the code sample on my GitHub.
Getting Started
Since it’s the simplest and most versatile, I will use a Blank Xamarin Forms App template from Visual Studio for this sample. We will access the Native iOS API’s using Dependency Services, as detailed by Microsoft Xamarin here.
Core Project: First, we will start by creating an IIconSwitchService
interface that contains the contract that will be used to communicate between the Xamarin.Forms code and Native iOS UI:
public interface IIconSwitchService{
Task SwitchAppIcon(string iconName);
}