question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calendar.createEventAsync - entire `url` parameter is url-encoded

See original GitHub issue

Summary

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

Screen Shot 2021-07-27 at 3 45 14 PM

Screen Shot 2021-07-27 at 3 45 04 PM

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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, Mar 28, 2022

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.

0reactions
github-actions[bot]commented, Mar 21, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - Adding appointment to calendar using Expo ...
I was having a hard time getting the calendar ID as it is a requirement for the new createEventAsync() API. this is the...
Read more >
Eventid URL parameter - Trumba Help
Appended to the trumbaEmbed parameter in a URL-encoded query string. I'd like to see a complete list of URL parameters. Application. Must accompany...
Read more >
Filter URL parameters - 25Live Help
To see results when you filter, your published calendar must include events that use the fields and field values represented by the parameters...
Read more >
Calendar URL generator which parameters - Google Support
I want to generate a Google Calendar link event with a repeat parameters. ... the 'recur' parameter with a standard RRULE (URL encoded),...
Read more >
Calendar - Expo Documentation
Provides an API for interacting with the device's system calendars, events, reminders, ... createEventAsync(calendarId, eventData) ... URL for the attendee.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found