appium / io.appium.settings

App for dealing with Android settings
Apache License 2.0
122 stars 56 forks source link

GetNotifications returns nothing. #147

Closed JumBe08 closed 7 months ago

JumBe08 commented 7 months ago

Trying to use the GetNotifications method to get the current notifications at a Xiaomi Poco F3, but the array returns empty:

image

I know I've given the io.appium.settings app Notification permissions. This app is also updated to version 5.7.5. I am able to get notification data with: adb shell dumpsys notification

I was able to successfully use the very same uiautomator2 driver method on a samsung device.

Any idea what this might be?

JumBe08 commented 7 months ago

Sorted it out, but I'm leaving here what went on, maybe it will help someone in the future.

Documentation says that Notification permissions should be given to the application. However, at least here in this phone (and maybe in other Xiaomis), this isn't just about setting normal Notification permissions. These can be set at a number of places, for example:

Settings -> Apps -> Manage Apps -> Appium Settings -> Notifications -> Yes

This, however, won't be enough. You'll still need:

Settings -> Privacy Protection -> Special Permissions -> Device & app notifications -> Appium Settings -> Allow notification access