Giter Club home page Giter Club logo

Comments (15)

wtto00 avatar wtto00 commented on August 16, 2024 3

Hithere, Did you add

<preference name="android-targetSdkVersion" value="33" />

in the config.xml?

Greetings, Simeon

save me! Thanks

from cordova-plugin-android-permissions.

mickjol avatar mickjol commented on August 16, 2024 1

I had the same problem.
OS: Android 13
Compile with SDK 32 or 33

When I made the "requestPermission" for POST_NOTIFICATIONS, I receive an error :

{
    error: "requestPermission"
    message: "Unknown error."
}

I try to request READ_CONTACTS and I receive success with { hasPermission: false } and nothing shown

from cordova-plugin-android-permissions.

SimeonLukas avatar SimeonLukas commented on August 16, 2024 1

Hithere, Did you add
<preference name="android-targetSdkVersion" value="33" />
in the config.xml?
Greetings, Simeon

where is those config.xml file location ?

For projects created with the Cordova CLI (described in The Command-Line Interface), this file can be found in the top-level directory:

app/config.xml

Link to Cordova Documentation

Hope this helps.

Greetings

from cordova-plugin-android-permissions.

kotran88 avatar kotran88 commented on August 16, 2024

same. not working
nothing show....

from cordova-plugin-android-permissions.

lxbbright39 avatar lxbbright39 commented on August 16, 2024

Hi, I have the same problem has anyone found a solution for this issue?

from cordova-plugin-android-permissions.

petercutting avatar petercutting commented on August 16, 2024

I have the same problem. The Allow permission modal is NOT shown for POST_NOTIFICATIONS

If I change permission to CAMERA then it works - the Allow permission modal IS shown. BUT not the first time. The app must be restarted for it to start working. Weird

    Android Target SDK: android-33
    Android Compile SDK: 33

is there an alternate plugin?

from cordova-plugin-android-permissions.

jcruz1289 avatar jcruz1289 commented on August 16, 2024

Add the required permission here:
image

from cordova-plugin-android-permissions.

SimeonLukas avatar SimeonLukas commented on August 16, 2024

Hithere,
Did you add

<preference name="android-targetSdkVersion" value="33" />

in the config.xml?

Greetings,
Simeon

from cordova-plugin-android-permissions.

brandaopj avatar brandaopj commented on August 16, 2024

i have the same problem:

image

from cordova-plugin-android-permissions.

matodrobec avatar matodrobec commented on August 16, 2024

I have same problem

<preference name="android-targetSdkVersion" value="33" />
 permissions
                .hasPermission(
                    permissions.POST_NOTIFICATION,
                    (status: any) => {
                        if (!status.hasPermission) {
                            permissions
                                .requestPermission(
                                    permissions.POST_NOTIFICATION,
                                    (data: any) => {
                                        console.log('PERMISIONS', data);
                                        result.resolve(true);
                                    },
                                    () => {
                                        result.reject(false);
                                    }
                                )
                        }
                    }
                );

from cordova-plugin-android-permissions.

renofizaldy avatar renofizaldy commented on August 16, 2024

Hithere, Did you add

<preference name="android-targetSdkVersion" value="33" />

in the config.xml?

Greetings, Simeon

where is those config.xml file location ?

from cordova-plugin-android-permissions.

matodrobec avatar matodrobec commented on August 16, 2024

Hi,

permissions.POST_NOTIFICATION is still not working.
I am using cordova android 11 and the persmission window have not shown.

from cordova-plugin-android-permissions.

wtto00 avatar wtto00 commented on August 16, 2024

Use this plugin cordova.plugins.diagnostic.

from cordova-plugin-android-permissions.

matodrobec avatar matodrobec commented on August 16, 2024

Hi @wtto00

thx for advice and I tested it. I found usefull these two methods isRemoteNotificationsEnabled and switchToNotificationSettings

   let diagnostic = (cordova.plugins as any)?.diagnostic;

    diagnostic.isRemoteNotificationsEnabled((enabled) => {
      console.log("Remote notifications are " + (enabled ? "enabled" : "disabled"));
    }, (error) => {
      console.error("The following error occurred: " + error);
    });

    diagnostic.switchToNotificationSettings();

from cordova-plugin-android-permissions.

kenfouo avatar kenfouo commented on August 16, 2024

This is what worked for me with the plugin .

    var permissions = cordova.plugins.permissions;
    permissions 
    .hasPermission(
        permissions.POST_NOTIFICATIONS,
        (status) => {
            if (!status.hasPermission) {
                permissions
                    .requestPermission(
                        permissions.POST_NOTIFICATIONS,
                        (data) => {
                            alert('PERMISIONS: ' + JSON.stringify(data));
                        },
                        (err) => {
                            alert('PERMISIONS: ' + JSON.stringify(err));
                        }
                    )
            }
        }
    );

add this to the manifest:

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

from cordova-plugin-android-permissions.

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.