Git Product home page Git Product logo

plugin.xf.appinstallhelper's Introduction

Hi there ๐Ÿ‘‹. I am Jimmy Pun from Hong Kong / Australia

I am a full stack developer proficient in .Net development on web API (C# .NET Core), mobile application (Xamarin Forms), web application (Angular 2+) and Windows application (WPF).

Top Langs Jimmy's GitHub stats

plugin.xf.appinstallhelper's People

Contributors

jimmypun610 avatar noismaster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

plugin.xf.appinstallhelper's Issues

Java.Lang.NullPointerException on Android 10 device

Hi Jimmy~ Excellent work, we all appreciated that! Here we encountered a little problem:

When attempting to install on Android 10 devices,
An error showed up:
Java.Lang.NullPointerException: 'Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference'

The code is as follows:
string apkPath = "file:///storage/emulated/0/Download/AppName.1.0-8.apk";
await Plugin.XF.AppInstallHelper.CrossInstallHelper.Current.InstallApp(apkPath, Plugin.XF.AppInstallHelper.Abstractions.InstallMode.OutOfAppStore);

Anything we are doing wrong? Please help. Thanks~

Compatible with MAUI, the next version of Xamarin

Hi Jimmy,
The AppInstallHelper is great. It simplifies the code of updating app packages. Thanks a lot.
Are there any plan of releasing a version which works with MAUI preview (the enhancement version of Xamarin)?

Best Regards,
Sunshine

AskForRequiredPermission always return false on samsung sm-n986w android 13.0 api 33

public static async Task AskForRequiredPermission()
{
try
{
var canRequestInstallPackage = true;
if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
canRequestInstallPackage = Platform.CurrentActivity.PackageManager.CanRequestPackageInstalls();

            if (!canRequestInstallPackage)
            {
                Platform.CurrentActivity.StartActivity(new Intent(
                    Android.Provider.Settings.ActionManageUnknownAppSources,
                    Android.Net.Uri.Parse("package:" + Android.App.Application.Context.PackageName)));
            }

            var writeStatus = await Permissions.CheckStatusAsync<Permissions.StorageWrite>();
            if (writeStatus != PermissionStatus.Granted)
            {
                **await Permissions.RequestAsync<Permissions.StorageWrite>();**
            }
            writeStatus = await Permissions.CheckStatusAsync<Permissions.StorageWrite>();

            var readStatus = await Permissions.CheckStatusAsync<Permissions.StorageRead>();
            if (readStatus != PermissionStatus.Granted)
            {
                **await Permissions.RequestAsync<Permissions.StorageRead>();**
            }

            readStatus = await Permissions.CheckStatusAsync<Permissions.StorageRead>();

            if (writeStatus == PermissionStatus.Granted && readStatus == PermissionStatus.Granted && canRequestInstallPackage)
                return true;
        }
        catch (Exception ex)
        {
            //Something went wrong
        }
        return false;
    }

MAUI Android file_paths.xml Build Action cannot set to "AndroidResource"

Hi Jimmy,
I tried to set the file_paths.xml's "Build Action" as instructed by your readme documentation, but there is no such option as "AndroidResource" in the dropdown list, and manually setting this string causes a popup error -- "An error has occurred while saving the edited properties listed below: Build Action. One or more values are invalid. The item type 'AndroidResource' is not supported by this project item provider."

 I also checked your maui demo project, your project actually has this "AndroidResource" option. Weird. Are there any workarounds about this issue?  Environment: the latest VS preview / MAUI / Windows11 version.

 Thanks.
 Best Regards

updating app

Hi, i am using this to install a newer version of the app, but everytime the installer run, it always gives me "Parse error: There is a problem parsing the package" any idea?

Windows UWP integration (Code snippet attached)

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;
        }
    }
}

}

ERROR when Using API 30

hello there some restriction in using Externale storage starting from Andriod 11 , can you please find a solution for this problmme thanks

NullPointerException when invoke AppInstallHelper.InstallationHelper.InstallApp

I have tried on different devices, and they all throw this:

Java.Lang.NullPointerException: 'Attempt to invoke virtual method 'boolean android.content.Intent.migrateExtraStreamToClipData(android.content.Context)' on a null object reference'

when invoke this line:

await Plugin.XF.AppInstallHelper.InstallationHelper.InstallApp(apkPath, Plugin.XF.AppInstallHelper.InstallMode.OutOfAppStore);

any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.