Skip to content

Commit 5d7515d

Browse files
authored
Missing function
1 parent 189f571 commit 5d7515d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

android_notify/an_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,16 @@ def icon_finder(icon_name):
156156
package_dir = get_package_path()
157157
return os.path.join(package_dir, "fallback-icons", icon_name)
158158

159+
def can_show_permission_request_popup():
160+
"""
161+
Check if we can show permission request popup for POST_NOTIFICATIONS
162+
:return: bool
163+
"""
164+
if not ON_ANDROID or BuildVersion.SDK_INT < 33:
165+
return False
159166

167+
return context.shouldShowRequestPermissionRationale(Manifest.POST_NOTIFICATIONS)
168+
160169
def open_settings_screen():
161170
intent = Intent()
162171
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)

0 commit comments

Comments
 (0)