zendesk / belvedere

An image picker library for Android
Apache License 2.0
145 stars 23 forks source link

camera thumb isn't shown on API 30 if targetSdk 30 #125

Open TwoEightNine opened 3 years ago

TwoEightNine commented 3 years ago

lib version: 3.0.0-RC android version: 11

issue: devs add belvedere either using implementation steps in README.md or using code from sample app. but if you do that, you mark that camera thumb isn't shown on Android 11 but shown on other versions => there is no way to attach photos directly from camera on Android 11.

reproducible case:

  1. run sample app 'as is' on emulator with API 30
  2. try to attach photo

    fix: to specify a query in AndroidManifest if an app is going to have targetSdk 30. like this:

    <queries>
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>
    </queries>

note: this is because belvedere tries to resolve an intent to determine if a device can take photos (see MediaSource.hasCamera(Context)). android 11 introduced some changes in package visibility. devs now should declare in Manifest an intent they want to be resolved. intents that are not specified in Manifest become unresolved

i think this piece of code should be noticed in README.md and also be inculded in the sample app.