expo-calendar 11.3.0 → 11.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/android/build.gradle +2 -2
- package/ios/EXCalendar/EXCalendar.m +11 -11
- package/ios/EXCalendar/EXCalendarPermissionRequester.m +45 -11
- package/ios/EXCalendar/EXRemindersPermissionRequester.m +36 -2
- package/package.json +2 -2
- package/plugin/build/withCalendar.js +8 -0
- package/plugin/src/withCalendar.ts +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 11.3.2 — 2023-09-28
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- On `iOS`, fix check that determines if the version of Xcode supports `iOS 17`. ([#24655](https://github.com/expo/expo/pull/24655) by [@alanjhughes](https://github.com/alanjhughes))
|
|
18
|
+
|
|
19
|
+
## 11.3.1 — 2023-09-25
|
|
20
|
+
|
|
21
|
+
### 🐛 Bug fixes
|
|
22
|
+
|
|
23
|
+
- On `iOS`, fix permissions error on `iOS 17`. ([#24545](https://github.com/expo/expo/pull/24545) by [@alanjhughes](https://github.com/alanjhughes))
|
|
24
|
+
|
|
13
25
|
## 11.3.0 — 2023-06-21
|
|
14
26
|
|
|
15
27
|
### 🐛 Bug fixes
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '11.3.
|
|
6
|
+
version = '11.3.2'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -67,7 +67,7 @@ android {
|
|
|
67
67
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
68
68
|
targetSdkVersion safeExtGet("targetSdkVersion", 33)
|
|
69
69
|
versionCode 17
|
|
70
|
-
versionName '11.3.
|
|
70
|
+
versionName '11.3.2'
|
|
71
71
|
}
|
|
72
72
|
lintOptions {
|
|
73
73
|
abortOnError false
|
|
@@ -381,11 +381,11 @@ EX_EXPORT_METHOD_AS(saveEventAsync,
|
|
|
381
381
|
calendarEvent.recurrenceRules = nil;
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
384
|
+
if (url) {
|
|
385
|
+
NSURLComponents *URLComponents = [NSURLComponents componentsWithString:url];
|
|
386
|
+
if (URLComponents && URLComponents.URL) {
|
|
387
|
+
calendarEvent.URL = URLComponents.URL;
|
|
388
|
+
}
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
if (startDate) {
|
|
@@ -651,11 +651,11 @@ EX_EXPORT_METHOD_AS(saveReminderAsync,
|
|
|
651
651
|
reminder.recurrenceRules = nil;
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
654
|
+
if (url) {
|
|
655
|
+
NSURLComponents *URLComponents = [NSURLComponents componentsWithString:url];
|
|
656
|
+
if (URLComponents && URLComponents.URL) {
|
|
657
|
+
reminder.URL = URLComponents.URL;
|
|
658
|
+
}
|
|
659
659
|
}
|
|
660
660
|
|
|
661
661
|
if (startDate) {
|
|
@@ -773,7 +773,7 @@ EX_EXPORT_METHOD_AS(requestCalendarPermissionsAsync,
|
|
|
773
773
|
[EXPermissionsMethodsDelegate askForPermissionWithPermissionsManager:_permissionsManager
|
|
774
774
|
withRequester:[EXCalendarPermissionRequester class]
|
|
775
775
|
resolve:resolve
|
|
776
|
-
reject:reject];
|
|
776
|
+
reject:reject];
|
|
777
777
|
}
|
|
778
778
|
|
|
779
779
|
EX_EXPORT_METHOD_AS(getRemindersPermissionsAsync,
|
|
@@ -14,13 +14,23 @@
|
|
|
14
14
|
EXPermissionStatus status;
|
|
15
15
|
EKAuthorizationStatus permissions;
|
|
16
16
|
|
|
17
|
-
NSString *
|
|
17
|
+
NSString *description;
|
|
18
|
+
if (@available(iOS 17, *)) {
|
|
19
|
+
description = @"NSCalendarsFullAccessUsageDescription";
|
|
20
|
+
} else {
|
|
21
|
+
description = @"NSCalendarsUsageDescription";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
NSString *calendarUsageDescription = [[NSBundle mainBundle] objectForInfoDictionaryKey:description];
|
|
25
|
+
|
|
18
26
|
if (!calendarUsageDescription) {
|
|
19
|
-
|
|
27
|
+
NSString *message = [NSString stringWithFormat:@"This app is missing %@, so calendar methods will fail. Add this key to your bundle's Info.plist.", description];
|
|
28
|
+
EXFatal(EXErrorWithMessage(message));
|
|
20
29
|
permissions = EKAuthorizationStatusDenied;
|
|
21
30
|
} else {
|
|
22
31
|
permissions = [EKEventStore authorizationStatusForEntityType:EKEntityTypeEvent];
|
|
23
32
|
}
|
|
33
|
+
|
|
24
34
|
switch (permissions) {
|
|
25
35
|
case EKAuthorizationStatusAuthorized:
|
|
26
36
|
status = EXPermissionStatusGranted;
|
|
@@ -33,6 +43,7 @@
|
|
|
33
43
|
status = EXPermissionStatusUndetermined;
|
|
34
44
|
break;
|
|
35
45
|
}
|
|
46
|
+
|
|
36
47
|
return @{
|
|
37
48
|
@"status": @(status)
|
|
38
49
|
};
|
|
@@ -42,15 +53,38 @@
|
|
|
42
53
|
{
|
|
43
54
|
EKEventStore *eventStore = [[EKEventStore alloc] init];
|
|
44
55
|
EX_WEAKIFY(self)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
#if defined(__IPHONE_17_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >=__IPHONE_17_0
|
|
57
|
+
if (@available(iOS 17.0, *)) {
|
|
58
|
+
[eventStore requestFullAccessToEventsWithCompletion:^(BOOL granted, NSError * _Nullable error) {
|
|
59
|
+
EX_STRONGIFY(self)
|
|
60
|
+
if (error && error.code != 100) {
|
|
61
|
+
reject(@"E_CALENDAR_ERROR_UNKNOWN", error.localizedDescription, error);
|
|
62
|
+
} else {
|
|
63
|
+
resolve([self getPermissions]);
|
|
64
|
+
}
|
|
65
|
+
}];
|
|
66
|
+
} else {
|
|
67
|
+
[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
|
|
68
|
+
EX_STRONGIFY(self)
|
|
69
|
+
// Error code 100 is a when the user denies permission; in that case we don't want to reject.
|
|
70
|
+
if (error && error.code != 100) {
|
|
71
|
+
reject(@"E_CALENDAR_ERROR_UNKNOWN", error.localizedDescription, error);
|
|
72
|
+
} else {
|
|
73
|
+
resolve([self getPermissions]);
|
|
74
|
+
}
|
|
75
|
+
}];
|
|
76
|
+
}
|
|
77
|
+
#else
|
|
78
|
+
[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
|
|
79
|
+
EX_STRONGIFY(self)
|
|
80
|
+
// Error code 100 is a when the user denies permission; in that case we don't want to reject.
|
|
81
|
+
if (error && error.code != 100) {
|
|
82
|
+
reject(@"E_CALENDAR_ERROR_UNKNOWN", error.localizedDescription, error);
|
|
83
|
+
} else {
|
|
84
|
+
resolve([self getPermissions]);
|
|
85
|
+
}
|
|
86
|
+
}];
|
|
87
|
+
#endif
|
|
54
88
|
}
|
|
55
89
|
|
|
56
90
|
|
|
@@ -14,13 +14,23 @@
|
|
|
14
14
|
EXPermissionStatus status;
|
|
15
15
|
EKAuthorizationStatus permissions;
|
|
16
16
|
|
|
17
|
-
NSString *
|
|
17
|
+
NSString *description;
|
|
18
|
+
if (@available(iOS 17, *)) {
|
|
19
|
+
description = @"NSRemindersFullAccessUsageDescription";
|
|
20
|
+
} else {
|
|
21
|
+
description = @"NSRemindersUsageDescription";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
NSString *remindersUsageDescription = [[NSBundle mainBundle] objectForInfoDictionaryKey:description];
|
|
25
|
+
|
|
18
26
|
if (!remindersUsageDescription) {
|
|
19
|
-
|
|
27
|
+
NSString *message = [NSString stringWithFormat:@"This app is missing %@, so reminders methods will fail. Add this key to your bundle's Info.plist.", description];
|
|
28
|
+
EXFatal(EXErrorWithMessage(message));
|
|
20
29
|
permissions = EKAuthorizationStatusDenied;
|
|
21
30
|
} else {
|
|
22
31
|
permissions = [EKEventStore authorizationStatusForEntityType:EKEntityTypeReminder];
|
|
23
32
|
}
|
|
33
|
+
|
|
24
34
|
switch (permissions) {
|
|
25
35
|
case EKAuthorizationStatusAuthorized:
|
|
26
36
|
status = EXPermissionStatusGranted;
|
|
@@ -33,6 +43,7 @@
|
|
|
33
43
|
status = EXPermissionStatusUndetermined;
|
|
34
44
|
break;
|
|
35
45
|
}
|
|
46
|
+
|
|
36
47
|
return @{
|
|
37
48
|
@"status": @(status)
|
|
38
49
|
};
|
|
@@ -42,6 +53,28 @@
|
|
|
42
53
|
{
|
|
43
54
|
EKEventStore *eventStore = [[EKEventStore alloc] init];
|
|
44
55
|
EX_WEAKIFY(self)
|
|
56
|
+
#if defined(__IPHONE_17_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_17_0
|
|
57
|
+
if (@available(iOS 17.0, *)) {
|
|
58
|
+
[eventStore requestFullAccessToRemindersWithCompletion:^(BOOL granted, NSError * _Nullable error) {
|
|
59
|
+
EX_STRONGIFY(self)
|
|
60
|
+
if (error && error.code != 100) {
|
|
61
|
+
reject(@"E_CALENDAR_ERROR_UNKNOWN", error.localizedDescription, error);
|
|
62
|
+
} else {
|
|
63
|
+
resolve([self getPermissions]);
|
|
64
|
+
}
|
|
65
|
+
}];
|
|
66
|
+
} else {
|
|
67
|
+
[eventStore requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError *error) {
|
|
68
|
+
EX_STRONGIFY(self)
|
|
69
|
+
// Error code 100 is a when the user denies permission; in that case we don't want to reject.
|
|
70
|
+
if (error && error.code != 100) {
|
|
71
|
+
reject(@"E_REMINDERS_ERROR_UNKNOWN", error.localizedDescription, error);
|
|
72
|
+
} else {
|
|
73
|
+
resolve([self getPermissions]);
|
|
74
|
+
}
|
|
75
|
+
}];
|
|
76
|
+
}
|
|
77
|
+
#else
|
|
45
78
|
[eventStore requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError *error) {
|
|
46
79
|
EX_STRONGIFY(self)
|
|
47
80
|
// Error code 100 is a when the user denies permission; in that case we don't want to reject.
|
|
@@ -51,6 +84,7 @@
|
|
|
51
84
|
resolve([self getPermissions]);
|
|
52
85
|
}
|
|
53
86
|
}];
|
|
87
|
+
#endif
|
|
54
88
|
}
|
|
55
89
|
|
|
56
90
|
@end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-calendar",
|
|
3
|
-
"version": "11.3.
|
|
3
|
+
"version": "11.3.2",
|
|
4
4
|
"description": "Provides an API for interacting with the device's system calendars, events, reminders, and associated records.",
|
|
5
5
|
"main": "build/Calendar.js",
|
|
6
6
|
"types": "build/Calendar.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"expo": "*"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "b0019af6dd5a36e908618c388ab5f3053afc61c0"
|
|
44
44
|
}
|
|
@@ -13,6 +13,14 @@ const withCalendar = (config, { calendarPermission, remindersPermission } = {})
|
|
|
13
13
|
calendarPermission || config.ios.infoPlist.NSCalendarsUsageDescription || CALENDARS_USAGE;
|
|
14
14
|
config.ios.infoPlist.NSRemindersUsageDescription =
|
|
15
15
|
remindersPermission || config.ios.infoPlist.NSRemindersUsageDescription || REMINDERS_USAGE;
|
|
16
|
+
config.ios.infoPlist.NSCalendarsFullAccessUsageDescription =
|
|
17
|
+
calendarPermission ||
|
|
18
|
+
config.ios.infoPlist.NSCalendarsFullAccessUsageDescription ||
|
|
19
|
+
CALENDARS_USAGE;
|
|
20
|
+
config.ios.infoPlist.NSRemindersFullAccessUsageDescription =
|
|
21
|
+
remindersPermission ||
|
|
22
|
+
config.ios.infoPlist.NSRemindersFullAccessUsageDescription ||
|
|
23
|
+
REMINDERS_USAGE;
|
|
16
24
|
return config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
|
|
17
25
|
'android.permission.READ_CALENDAR',
|
|
18
26
|
'android.permission.WRITE_CALENDAR',
|
|
@@ -18,6 +18,15 @@ const withCalendar: ConfigPlugin<
|
|
|
18
18
|
config.ios.infoPlist.NSRemindersUsageDescription =
|
|
19
19
|
remindersPermission || config.ios.infoPlist.NSRemindersUsageDescription || REMINDERS_USAGE;
|
|
20
20
|
|
|
21
|
+
config.ios.infoPlist.NSCalendarsFullAccessUsageDescription =
|
|
22
|
+
calendarPermission ||
|
|
23
|
+
config.ios.infoPlist.NSCalendarsFullAccessUsageDescription ||
|
|
24
|
+
CALENDARS_USAGE;
|
|
25
|
+
config.ios.infoPlist.NSRemindersFullAccessUsageDescription =
|
|
26
|
+
remindersPermission ||
|
|
27
|
+
config.ios.infoPlist.NSRemindersFullAccessUsageDescription ||
|
|
28
|
+
REMINDERS_USAGE;
|
|
29
|
+
|
|
21
30
|
return AndroidConfig.Permissions.withPermissions(config, [
|
|
22
31
|
'android.permission.READ_CALENDAR',
|
|
23
32
|
'android.permission.WRITE_CALENDAR',
|