Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional common fields #3

Open
TheAlmightyBob opened this issue Apr 18, 2015 · 10 comments
Open

Additional common fields #3

TheAlmightyBob opened this issue Apr 18, 2015 · 10 comments

Comments

@TheAlmightyBob
Copy link
Owner

TheAlmightyBob commented Apr 18, 2015

Anything else?

@nielscup
Copy link

Yes, I would like some sort of tag property that I can set, and the user cannot change (easily). This way I can easily filter all events that were created by my app in order to update or delete them.

@TheAlmightyBob
Copy link
Owner Author

Interesting idea. I'd have to look into what support exists on each of the platforms for this (mainly due to the "user cannot change (easily)" part..). I had assumed that apps would just create their own calendars for this purpose...

If this was built-in to the API instead (e.g. a parameter to specify that you only want your events), would that seem reasonable? I'm just thinking that the different platforms might offer different ways to achieve that scenario (which may work/perform better than just post-filtering the returned events according to a custom property).

Two quick notes:

  1. This should actually be a new issue. This issue was specifically about just exposing the additional simple fields that are already visible on the native calendars.
  2. I'm a bit in-transition right now and won't be able to get to this very soon (project has not been abandoned though).

@nielscup
Copy link

Maybe creating a new calendar would also be a possibility, I hadn't thought of that option yet. The reason I need this feature is because I need to build functionality to export a duty roster, which I need to be able to update. I was planning to start with that functionality tomorrow, so I will have a look myself. If I make any changes I will commit them, thanks!

@nielscup
Copy link

I tried the option to create a calendar but on iOS the GetCalendars does not retrieve the newly created calendar. Also the Testapp Calendars_CreateCalendar_IsFoundByGetCalendar fails. Is this a known issue, or is it just my device?

@TheAlmightyBob
Copy link
Owner Author

I created a new issue for your original request, to try to keep this issue from filling up with comments that aren't directly related to it.

Please feel free to create a new issue for the error you are seeing as well.

It is definitely not a known issue (otherwise there would be an issue here for it!).

CreateCalendar is not throwing an exception? Does the Calendar it returns have ExternalID populated?

@TheAlmightyBob
Copy link
Owner Author

Niels, I'm betting that you encountered issue #10 . A fix is in the works.

@nielscup
Copy link

nielscup commented Feb 11, 2016

Ah Thanks, for the notification! Actually I didn’t encounter this issue because I have only tested with google calendar so far. Otherwise I would have raised an issue, or try to fix it myself ;-)

@cce32
Copy link

cce32 commented Jan 11, 2018

I am also looking for a way to add some metadata to an event I create so later the app can determine if said event already exists in which case allow edit/delete else do the add.

Based on the Calendars_AddOrUpdateEvent_NonexistentEventCreatesNew() unit test I thought maybe I could supply the CalendarEvent.ExternalID and then use it to get the event but ExternalID seems to be the OS generated value in my experiments (numeric in Android, GUID in iOS).

Thanks for this plugin!

@TheAlmightyBob
Copy link
Owner Author

@cce32 Correct, ExternalID is OS-generated. This has actually come up a few times in recent months as a point of confusion, so probably need to reevaluate making that a readonly property at some point. (or maybe if I'd called it "PlatformID" instead of "ExternalID" that would have helped :-P )

Generally, the recommended approach is to store the IDs of events you create in your app (sqlite, settings, text file, whatever) rather than try to tag the events as being "owned" by your app. For the most part, if your app can put custom data into an event property, the user can also view/edit that data (there are occasional platform-specific exceptions but this is a cross-platform library). This issue in particular is about identifying simple fields that exist on every platform but are not yet being exposed by this library, and I'm not aware of any such field that would serve your purpose.

Thanks for using this plugin. :)

@cce32
Copy link

cce32 commented Jan 11, 2018

@TheAlmightyBob thank you for the response.

I plan to create a lookup and store it on the device per your guidance.

I agree removing the public setter for ExternalID would clarify the intent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants