Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.
This repository was archived by the owner on May 15, 2024. It is now read-only.

[Bug] iOS 17+ Calendar Permissions not working when setting the first time #2105

@mh05

Description

@mh05

Description

iOS 17 and higher doesn't show any permission popup when requesting Calendar.Write or Calendar.Read for the first time both on (Mai)Permission and via EventStore (Eventstore throwns an error ->

-requestAccessToEntityType:completion: has been deprecated-calling this method is no longer allowed.
Instead, use -requestFullAccessToEventsWithCompletion:, -requestWriteOnlyAccessToEventsWithCompletion:, or -requestFullAccessToRemindersWithCompletion:
)

Steps to Reproduce

  1. Make a new ios application (dotnet 7+)
  2. Add true to project files
  3. Add NSCalendarsUsageDescription description to info.list
  4. Add an button to screen with click event
  5. Start and press on the button

note: When the user declines the permission

Example code: With (maui)permission

    private async Task RequestCalendarPermissions()
   {	
        var permissionWrite = await Permissions.CheckStatusAsync<Permissions.CalendarWrite>();
		var permissionRead = await Permissions.CheckStatusAsync<Permissions.CalendarRead>();

		
        if (permissionWrite != PermissionStatus.Granted)
        {
	   BeginInvokeOnMainThread(() => Permissions.RequestAsync<Permissions.CalendarWrite>()); 	
        }		

        if (permissionRead != PermissionStatus.Granted)
        {
           BeginInvokeOnMainThread(() => Permissions.RequestAsync<Permissions.CalendarRead>());
        }        
    }

Example code without (maui)Permission

private async Task RequestEventPermission()
	{
        var store = new EKEventStore();
        var setPermission = await store.RequestAccessAsync(EKEntityType.Event);
        //results in error from ios
      
	}

Expected Behavior

1:
Permission popup for with
"name app" Would like to Access Your Calander
description from info.plist

2:
Settings -> Privancy & Security -> Calendars -> "App name" toggle switch on (at least when you accept it)

3:
Settings -> "App name" -> Allow "app name" To Acces -> Calendars.

Actual Behavior

Apps doesn't show any popup

Basic Information

  • Version with issue:
  • Last known good version: till ios 17
  • IDE: Vs for mac
  • Platform Target Frameworks:
    • iOS: 17.0 (simulator and device)
    • Android: N/A
    • UWP: N/A
  • Android Support Library Version:
  • Nuget Packages:
  • MAUI Essentials
  • Affected Devices:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions