Coder Social home page Coder Social logo

capacitor-geolocation-android12-issue's Introduction

capacitor-geolocation-android12-issue

Getting Started

  • Refer to the Capacitor Android requirements on Environment Setup
  • Clone the repo.
  • Run npm ci && npm run build && npx cap sync && npx cap open android
    • This will install dependencies, build the front-end app, sync to the native project, and open Android Studio.
  • Hook up a physical Android device with Android 12 or use an Android Virtual Device (emulator) with Android 12 (API 31) (may need to create one in Android Studio's AVD Manager).
  • In Android Studio, select the desired Android device for running the app. Then click the Run button to Run 'app'.
  • After the app has started on the device, you'll see a prompt for location permissions. Don't do anything yet.
  • Open the Google Chrome DevTools for remote inspection. In Chrome on desktop navigate to chrome://inspect/#devices and for the WebView of the app click inspect.

Reproducing the Issue

  • The relevant custom code for reproducing the issue is in /src/app/home/home.page.ts
  • In the DevTools console is where you'll see evidence of the issue.
  • Logged to the console immediately will be a call to Geolocation.checkPermissions() with a result that looks like:
    • { location: "prompt" }
  • We then call Geolocation.getCurrentPosition() which causes the location permissions prompt already visible on the screen.
  • On the location permissions prompt, select Approximate location and either While using the app or Only this time.
  • An error from the Geolocation.getCurrentPosition() call will be logged to the console:
    • { message: "Location permission was denied" }

capacitor-geolocation-android12-issue's People

Contributors

kevinkelchen avatar

Watchers

James Cloos avatar  avatar

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.