Calendar.createEventAsync - entire `url` parameter is url-encoded
See original GitHub issueSummary
When using the url
parameter with Calendar.createEventAsync
(and presumably also Calendar.updateEventAsync
), the link added to the event is not functional if it contains a protocol, port, or path.
If the event details contain url: "https://github.com/expo"
then the calendar event’s URL will be created as https%3A%2F%2Fgithub.com%2Fexpo
, with slashes, colons, etc. URL-encoded despite being functional parts of the URL itself. The URL looks correct when you view the event, but it will be inactive because of the invalid format, and editing the event reveals the encoding issue.
I’m on version 8.3.0
but it looks like master
is still using URLHostAllowedCharacterSet as of right now. (I don’t really read Objective-C, but this forum post identified that character set as the problem and it makes sense to me.)
screenshots
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
No response
Environment
Expo CLI 4.8.1 environment info: System: OS: macOS 11.4 Shell: 3.1.2 - /usr/local/bin/fish Binaries: Node: 14.17.3 - ~/.asdf/installs/nodejs/14.17.3/bin/node npm: 6.14.13 - ~/.asdf/installs/nodejs/14.17.3/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.3 - /Users/jason/.asdf/shims/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 IDEs: Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild npmPackages: expo: ^37.0.12 => 37.0.12 react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5 react-native-web: ^0.14.8 => 0.14.8 react-navigation: ^4.4.0 => 4.4.0 Expo Workflow: bare
Reproducible demo or steps to reproduce from a blank project
import * as Calendar from "expo-calendar";
async function addTestEvent() {
const defaultCalendar = await Calendar.getDefaultCalendarAsync();
const eventDetails = {
title: "test event",
startDate: "2021-07-17T03:00:00.000Z",
endDate: "2021-07-17T05:00:00.000Z",
timeZone: "America/Chicago",
allDay: false,
url: "https://github.com/expo",
};
await Calendar.createEventAsync(defaultCalendar.id, eventDetails);
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.
This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.