@@ -31,31 +31,26 @@ function handleBlockedPermission(permission: string): void {
31
31
const permissionName = permission . replace ( / _ I O S | _ A N D R O I D / , "" ) ;
32
32
33
33
if ( permissionName === "SCHEDULE_EXACT_ALARM" ) {
34
- Alert . alert ( "" , "Please allow setting alarms and reminders" , [
34
+ return Alert . alert ( "" , "Please allow setting alarms and reminders" , [
35
35
{
36
36
text : "Go to alarm settings" ,
37
37
onPress : async ( ) => {
38
- if ( Platform . OS === "android" ) {
38
+ const canSchedule = await canScheduleExactAlarms ( ) ;
39
+ if ( ! canSchedule ) {
39
40
// Check if permission is already granted
40
- const canSchedule = await canScheduleExactAlarms ( ) ;
41
- if ( ! canSchedule ) {
42
- // Open exact alarm settings - same as RNExactAlarmPermission.getPermission()
43
- await openSettings ( "alarms" ) ;
44
- }
45
- } else {
46
- openSettings ( ) ;
41
+ return openSettings ( "alarms" ) ;
47
42
}
43
+ return openSettings ( ) ;
48
44
} ,
49
45
isPreferred : true
50
46
} ,
51
47
{ text : "Cancel" , style : "cancel" }
52
48
] ) ;
53
- } else {
54
- Alert . alert ( "" , `Please allow ${ permissionName } access` , [
55
- { text : "Go to settings" , onPress : ( ) => openSettings ( ) , isPreferred : true } ,
56
- { text : "Cancel" , style : "cancel" }
57
- ] ) ;
58
49
}
50
+ return Alert . alert ( "" , `Please allow ${ permissionName } access` , [
51
+ { text : "Go to settings" , onPress : ( ) => openSettings ( ) , isPreferred : true } ,
52
+ { text : "Cancel" , style : "cancel" }
53
+ ] ) ;
59
54
}
60
55
61
56
function mapPermissionName ( permissionName : string ) : Permission | "android.permission.SCHEDULE_EXACT_ALARM" | undefined {
0 commit comments