Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

no touch when using local file:// and pull-to-refresh #60

Open
cpg opened this issue Oct 5, 2019 · 10 comments
Open

no touch when using local file:// and pull-to-refresh #60

cpg opened this issue Oct 5, 2019 · 10 comments
Assignees
Labels
jasonette-android Jasonette Android related issues

Comments

@cpg
Copy link

cpg commented Oct 5, 2019

Describe the bug
when unsing "$pull": { "type": "$reload" } in an action and the background is an html with url of file://... the app loses touch

Example Jasonette Document URL

{
    "$jason": {
        "head": {
            "title": "Some Title",
            "actions": {
                "$foreground": { "type": "$reload" },
                "$show": { "type": "$render" },
                "$pull": { "type": "$reload" }
            }
        },
        "body": {
            "background": {
                "type": "html",
                "url": "file://index.html",
                "style": { "background": "#111111", "progress": "#fd4f00"  },
                "action": {
                    "type": "$default"
                }
            }
        }
    }
}

for index.html, you can curl -o index.html this

To Reproduce
Steps to reproduce the behavior:

  1. set the hello.json to the above
  2. get the index.html in the file/ area
  3. run
  4. try to move around the page or tap

then change the url from index.html to the url. it will allow touch and run just fine

Smartphone (please complete the following information):

  • Device: Pixel
  • OS: Android 6, 7 8, 9, 10

Compilation:

  • master and develop branches
@clsource clsource added the jasonette-android Jasonette Android related issues label Oct 5, 2019
@panterozo
Copy link

In the meanwhile, you can try whitout $pull action, and the touch should work, but, you would't have $pull. Im working on a solution

@e1sep0
Copy link

e1sep0 commented Jun 10, 2021

Hello, i have similar issue. Have you found solution?

@clsource
Copy link
Contributor

Ok we will have this issue revised so we can find out why this is happening and if can be solved

@e1sep0
Copy link

e1sep0 commented Jun 10, 2021

Thanks a lot) And one more problem but offtop)
When i build APK with Webview, i want to use html5 camera on my website.
When i test application on usb connected phone through android studio, all is fine, permissions for camera works and camera swithes on.
But when i build apk file, download it to my phone and install it, application doesnt require any permissions, and camera doent work, till i manually set permission through phone settings -> applications.
How can i switch camera permissions during installing? In AndroidManifest i use 22 SDK version/
Thank you =)

@clsource
Copy link
Contributor

Please check latest version in develop new permissions were added to the manifest :)

@e1sep0
Copy link

e1sep0 commented Jun 11, 2021

No results, unfortunately, i`ve got new develop version, but there are no permissions
image
In AndroidManifest added rules:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />

@e1sep0
Copy link

e1sep0 commented Jun 11, 2021

I`ve added to JasonAgentService.java:363 rows:

agent.setWebChromeClient(new WebChromeClient() {
                        @Override public void onPermissionRequest(final PermissionRequest request) {
                            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                request.grant(request.getResources());
                            }
                        }

And got error when trying acces to camera:

E/cr_VideoCapture: allocate: manager.openCamera: 
    java.lang.SecurityException: validateClientPermissionsLocked:1066: Caller "com.jasonette" (PID 10229, UID 25387) cannot open camera "1" without camera permission
        at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:747)
        at android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(CameraManager.java:405)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:567)
        at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:495)
        at fQ3.startCaptureMaybeAsync(chromium-Monochrome.aab-stable-443006623:11)
     Caused by: android.os.ServiceSpecificException: validateClientPermissionsLocked:1066: Caller "com.jasonette" (PID 10229, UID 25387) cannot open camera "1" without camera permission (code 1)
        at android.os.Parcel.createException(Parcel.java:1967)
        at android.os.Parcel.readException(Parcel.java:1921)
        at android.os.Parcel.readException(Parcel.java:1871)
        at android.hardware.ICameraService$Stub$Proxy.connectDevice(ICameraService.java:343)
        at android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(CameraManager.java:369)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:567) 
        at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:495) 
        at fQ3.startCaptureMaybeAsync(chromium-Monochrome.aab-stable-443006623:11) 

@clsource
Copy link
Contributor

I tested with this json on iOS and it seems it needs at least an empty sections property before the backgroundproperty.

I havent tested on Android yet but maybe this would work.

{
    "$jason": {
        "head": {
            "title": "Reload webpage on pull",
            "actions": {
                "$pull": {
                    "type": "$agent.request",
                    "options": {
                        "id": "$webcontainer",
                        "method": "(() => window.location.reload())",
                        "params": []
                    }
                }
            }
        },
        "body": {
            "sections": [{"items": [{}]}],
            "background": {
                "type": "html",
                "url": "file://web.html",
                "action": {
                      "type": "$default"
                }
            }
        }
    }
}

@e1sep0
Copy link

e1sep0 commented Jul 7, 2021

I tested with this json on iOS and it seems it needs at least an empty sections property before the backgroundproperty.

I havent tested on Android yet but maybe this would work.

{
    "$jason": {
        "head": {
            "title": "Reload webpage on pull",
            "actions": {
                "$pull": {
                    "type": "$agent.request",
                    "options": {
                        "id": "$webcontainer",
                        "method": "(() => window.location.reload())",
                        "params": []
                    }
                }
            }
        },
        "body": {
            "sections": [{"items": [{}]}],
            "background": {
                "type": "html",
                "url": "file://web.html",
                "action": {
                      "type": "$default"
                }
            }
        }
    }
}

Not working on Android ((

@e1sep0
Copy link

e1sep0 commented Dec 1, 2021

HAve somebody solved issue ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
jasonette-android Jasonette Android related issues
Projects
None yet
Development

No branches or pull requests

4 participants