Plugin.XF.AppInstallHelper icon indicating copy to clipboard operation
Plugin.XF.AppInstallHelper copied to clipboard

Windows UWP integration (Code snippet attached)

Open SunshineSpring666 opened this issue 3 years ago • 2 comments
trafficstars

Hi Jimmy, UWP support of specifying path to download and installing the app package can be done by the following platform specific code. I tried to integrate this into your source code to support Windows platform, but haven't figured it out. Is it possible for you to integrate this code into this wonderful AppInstallHelper?

//---------UWP code (Tested) using Applicat.Common; using Applicat.UWP; using System; using System.IO; using System.Threading.Tasks;

[assembly: Xamarin.Forms.Dependency(typeof(Update))] namespace Applicat.UWP { public class Update : IUpdate { public string SpecifyFilePath(string fileName) { return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), fileName); }

    public async Task<bool> Install(string stringUri)
    {
        try
        {
            return await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-appinstaller:?source=" + stringUri));
        }
        catch (Exception ex)
        {
            return false;
        }
    }
}

}

SunshineSpring666 avatar Jul 20 '22 12:07 SunshineSpring666

Hi,

I have no planning to implement to UWP... But I am happy if you could create a pull request to improve the code

JimmyPun610 avatar Jul 20 '22 12:07 JimmyPun610

OK, Jimmy, thanks.

SunshineSpring666 avatar Jul 21 '22 09:07 SunshineSpring666