fuse-open / fuselibs

Fuselibs is the Uno-libraries that provide the UI framework used in Fuse apps
https://npmjs.com/package/@fuse-open/fuselibs
MIT License
176 stars 72 forks source link

InAppBrowser Launcher #1412

Closed ichan-mb closed 2 years ago

ichan-mb commented 3 years ago

launch InAppBrowser using SFSafariViewController on iOS and Chrome CustomTabs on Android

Example:

App Background="#000">
    <JavaScript>
        module.exports.launch = function(args) {
            var inAppBrowser = require("FuseJS/InAppBrowser");
            inAppBrowser.openUrl("https://fuseopen.com");
        }
    </JavaScript>
    <StackPanel Margin="20">
        <Button Margin="10" Text="Launch InApp Browser">
            <Clicked>
                <LaunchInAppBrowser Url="https://fuseopen.com" />
            </Clicked>
        </Button>
        <Button Margin="10" Text="Launch InApp Browser Via JS">
            <Clicked Handler="{launch}" />
        </Button>
    </StackPanel>
</App>

This PR contains:

ichan-mb commented 3 years ago

The test is failing on AppVeyor: https://ci.appveyor.com/project/fusetools/fuselibs-public/builds/38573794#L189

some references:

but testing on my local computer it works fine without modification on build.gradle as per reference suggests 🤔

mortend commented 2 years ago

I will try looking into the AppVeyor one day soon, and maybe we'll get this in for 2.0.

ckarmy commented 2 years ago

Any news about this?

mvondoyannick commented 2 years ago

Any news about this?

Waiting and waiting again 😃

mortend commented 2 years ago

@ichan-mb We got this error message on AppVeyor now when I tried.

AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): androidx.browser.trusted.TrustedWebActivityDisplayMode androidx.browser.trusted.TrustedWebActivityDisplayMode.fromBundle(android.os.Bundle)","sources":[{}],"tool":"D8"}
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform artifact 'browser.aar (androidx.browser:browser:1.3.0)' to match attributes {artifactType=android-dex, dexing-enable-desugaring=false, dexing-is-debuggable=true, dexing-min-sdk=16}.
      > Execution failed for DexingNoClasspathTransform: C:\Users\appveyor\.gradle\caches\transforms-2\files-2.1\6561b190abd9d36b94db9426221c2199\browser-1.3.0\jars\classes.jar.
         > Error while dexing.

https://ci.appveyor.com/project/fusetools/fuselibs-public/builds/41511066#L203

It sounds like we need to bump min SDK from 16 to 24 to make this work.

Anagrr commented 2 years ago

[Require("Gradle.Dependency.Implementation", "androidx.browser:browser:1.3.0")]

this line cause the error during the build

Anagrr commented 2 years ago

https://stackoverflow.com/a/59184225 look what I found

Seems like we can change 1.3.0 version 1.0.0 and this should solve the problem

UPD

Or even 1.2.0 https://androidx.tech/artifacts/browser/browser/1.2.0-rc01

This will allows not to change minSdk

mortend commented 2 years ago

@Anagrr Nice! I have tried different versions of androidx.browser:browser:

ichan-mb commented 2 years ago

I have made changes, now AppVeyor run successful