Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Android 13 (API 33) #113

Open
Houdhey opened this issue Jul 28, 2022 · 5 comments
Open

Support Android 13 (API 33) #113

Houdhey opened this issue Jul 28, 2022 · 5 comments

Comments

@Houdhey
Copy link

Houdhey commented Jul 28, 2022

Android 13 is gonna be released on August.
Any detail for supporting it?

Especially refering to this : https://developer.android.com/about/versions/13/behavior-changes-13

With the new permissions

<manifest ...>
    <!-- Required only if your app targets Android 13. -->
    <!-- Declare one or more the following permissions only if your app needs
    to access data that's protected by them. -->
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
    <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />

    <!-- Required to maintain app compatibility. -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
                     android:maxSdkVersion="32" />
    <application ...>
        ...
    </application>
</manifest>
@NeoLSN
Copy link
Owner

NeoLSN commented Aug 4, 2022

Currently, no plan.
If you have any plan to support this new feature. You can create a PR, I can help to release it.

@NeilCresswell
Copy link
Contributor

I found your plugin to be very useful thank you, so had a go at adding the new permissions for Android 13 and have submitted a PR:
#116

As well as the permissions the OP mentioned, POST_NOTIFICATIONS is now also needed if you want to do push notifications.

@NeilCresswell
Copy link
Contributor

@NeoLSN kindly merged in PR #116 already.

@TDola
Copy link

TDola commented Nov 25, 2022

I am having some difficulty with this too.

I need to request, and check permissions, and close the app if the user rejects a permission.
That's fine, but on Android 33, I have to somehow know that, if your on 33, ask for read media, if your on less than 33, ask for external storage read. If you ask for both on 33, it ignores external storage read, then tells you you don't have permission when you check for it.
So how are you supposed to know what API version the phone has to know what to request?

Also, READ_MEDIA_IMAGES doesn't seem to actually work, it always returns false to the hasPermission and doesn't pop up asking for access on Android 33 Emulator.
When I try on my actual Android 33 phone (Pixel 7) it just works without the need for permission.
This is affecting cordova-camera gallery picker.

@ghenry22
Copy link

ghenry22 commented Mar 3, 2023

@TDola you can use the cordova diagnostic plugin core module to check the OS version. Then make the appropriate call using a simple if statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants