Giter VIP home page Giter VIP logo

Comments (5)

jamesmontemagno avatar jamesmontemagno commented on June 27, 2024 1

Did you do this: https://github.com/jamesmontemagno/PermissionsPlugin#android-specific-in-your-baseactivity-or-mainactivity-for-xamarinforms-add-this-code

When you install this plugin it will also install a file called "MainApplication.cs" into your Android app and that needs to be there.

from permissionsplugin.

pradeeparutla avatar pradeeparutla commented on June 27, 2024

When I check in the code permissionStatus.Unknown is returned in the below scenario. Do I need to do anything in my application for this ? Debug.WriteLine("Unable to detect current Activity or App Context. Please ensure Plugin.CurrentActivity is installed in your Android project and your Application class is registering with Application.IActivityLifecycleCallbacks.")

from permissionsplugin.

pradeeparutla avatar pradeeparutla commented on June 27, 2024

It is now working. Application.cs class is missing from my project. Thankyou James for the reply

from permissionsplugin.

savvaskef avatar savvaskef commented on June 27, 2024

I had the exact same problem(status=unknown). but no application.cs was added nor a mainapplication.cs when i updated the Mediaplugin and installed PermissionsPlugin.
Being 'creative' i added two things mentione on the documentation on the link you provided to MainActivity.cs (it's an another developer's xamarin app ia am implementing the android version) Speicifically i added
1)
PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
on the OnRequestPermissionsResult (maybe i need to mention that there also exists a Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
on the same method)
and 2)
Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);
on the protected override void OnCreate(Bundle savedInstanceState) method.

Now the status=unkwown no longer waits but the code still has problems.namely the
await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions { CompressionQuality = 92 }); does not execute.no error , no nulls just that the debugger skips lines :(

Did I do the correct corrections?Do you have any idea why the takephotasync command is skipped?
(permissions were requested,camera opens when stepping in, but after that something is not working as it is supposed to work)

Thnx in advance,

from permissionsplugin.

Kiran23-ui avatar Kiran23-ui commented on June 27, 2024

Thanks @savvaskef
Helped me in solving the issue

from permissionsplugin.

Related Issues (20)

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.