Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17450] Android: Ti.Calendar.Event should expose the attendees of the meeting invite as a property (Parity with iOS)

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-08-30T15:15:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.0
ComponentsAndroid
Labelscalendar, parity
ReporterBert Grantges
AssigneeYordan Banev
Created2014-08-03T16:46:19.000+0000
Updated2017-08-30T15:15:15.000+0000

Description

All properties associated with a Calendar Event should be exposed. Currently for example you can't see the attendees of the event, which is an important aspect of the Calendar event.

Comments

  1. Kiley Williams 2014-10-21

    Has there been any review of this issue? It seems that it is exposing a property that is cleanly available through both the Android Platform and the iOS platform. I'd like to help on this if possible, since it is directly impacting a project I am working on. Let me know if I can help!
  2. Ingo Muschenetz 2014-10-21

    Hi [~Yrkh8trnoy], we have reviewed it, but not scheduled it for a release. I would expect that you should be able to view the existing calendar code and see if you can arrive at a proposed implementation. I would suggest first coming up with a proposal of what the property would look like.
  3. Kiley Williams 2014-10-21

    Thanks for the quick reply @ingo. Since the property is an array of EKParticipant objects (for iOS, haven't checked Android yet). Keeping in mind that on iOS, "attendees" is a read-only property, and they suggest not creating new EKParticipant object, here's what i am thinking: * Create an EKParticipantProxy (or some better name) that I can then access through my Titanium code and iterate over it there. This seems to be overkill, especially for a read-only, 5-property object, but it seems like the only actual valid way of doing it.
  4. Kiley Williams 2016-02-17

    So I see this was never resolved and has popped up as an issue once again in our code.
  5. Melissa Chan 2016-03-03

    Hi, I've started to use the Ti.Calendar.Event in my code and this functionality will be important for me. This issue seems to be a couple years old and I was wondering if there are any updates on it?
  6. Srikanth Sombhatla 2016-04-26

    iOS: https://developer.apple.com/library/ios/documentation/EventKit/Reference/EKParticipantClassRef/index.html#//apple_ref/c/tdef/EKParticipantType Android: http://developer.android.com/guide/topics/providers/calendar-provider.html#attendees Not all properties can be mapped since there is certain variation or non-existing properties. The following can be considered name: The attendee name email: The attendee email. For iOS this is URL.resourceSpecifier http://stackoverflow.com/questions/13642786/how-to-get-ekevent-ekparticipant-email role: Role of attendee - required, optional. EKParticipant.role in iOS, ATTENDEE_TYPE in Android. status: Attendee status - unknown, accepted, declined, tentative.
  7. Kiley Williams 2016-05-04

    Thanks @Srikanth. Looking forward to working with it soon! I'm guessing the Windows implementation of this would be via hyperloop?
  8. Kiley Williams 2016-05-22

    Hi folks, I see this is in progress. How's it coming along?
  9. Srikanth 2016-06-03

    PR for iOS and Android: https://github.com/appcelerator/titanium_mobile/pull/7981 Use the following app.js to test the code
       var calendars = [];
       var selectedCalendarName;
       var selectedid;
       var pickerData = [];
       var osname = Ti.Platform.osname;
       
       var win = Ti.UI.createWindow({
         backgroundColor: 'white',
         exitOnClose: true,
         fullscreen: false,
         layout: 'vertical',
         title: 'Calendar Demo'
       });
       
       win.addEventListener('open', function() {
       	if (Ti.Calendar.hasCalendarPermissions()) {
       	    performCalendarReadFunctions();
       	} else {
       	    Ti.Calendar.requestCalendarPermissions(function(e) {
       	        if (e.success) {
       	            performCalendarReadFunctions();
       	        } else {
       	            Ti.API.error(e.error);
       	            alert('Access to calendar is not allowed');
       	        }
       	    });
       	}
       });
       
       function performCalendarReadFunctions() {
           var calendar;
           if (osname === 'android') {
              calendar = Ti.Calendar.selectableCalendars[0];
           } else {
       	   calendar = Ti.Calendar.defaultCalendar;
           }
           console.log('Using calendar:'+calendar.name);
       
           var currentYear = 2016;
           var events = calendar.getEventsInMonth(currentYear, 5);
           if (events && events.length) {
                 console.log(events.length + ' event(s) in ' + currentYear);
                 for (var i = 0; i < events.length; i++) {
                 	var theEvent = events[i];
                 	console.log('event '+theEvent.id+' '+theEvent.title);
                 	printAttendees(theEvent.attendees);
                 }
           } else {
                 console.log('No events');
           }
       }
       
       function printAttendees(attendees) {
       	Ti.API.info('attendees:'+attendees.length);
       	for (var i = 0; i < attendees.length; i++) {
       	 var e = attendees[i];
       	 	Ti.API.info('------------------------------------');
               Ti.API.info('name:'+e.name);
               Ti.API.info('email:'+e.email);
               var role = e.role;
               Ti.API.info('role:');
               if (role == Ti.Calendar.ATTENDEE_ROLE_REQUIRED) 
               	Ti.API.info('ATTENDEE_ROLE_REQUIRED');
               else if (role === Ti.Calendar.ATTENDEE_ROLE_OPTIONAL)		
               	Ti.API.info('ATTENDEE_ROLE_OPTIONAL');
               var status = e.status;
               Ti.API.info('status:');
               if (status === Ti.Calendar.ATTENDEE_STATUS_ACCEPTED) 
               	Ti.API.info('ATTENDEE_STATUS_ACCEPTED');
               else if (status === Ti.Calendar.ATTENDEE_STATUS_DECLINED)
               	Ti.API.info('ATTENDEE_STATUS_DECLINED');
               else if (status === Ti.Calendar.ATTENDEE_STATUS_TENTATIVE)
               	Ti.API.info('ATTENDEE_STATUS_TENTATIVE');
               else 
               	Ti.API.info('ATTENDEE_STATUS_UNKNOWN');
       
               if (e.isOrganiser) {
               	Ti.API.info('Organiser:YES');
               } else {
               	Ti.API.info('Organiser:NO');
               }
               Ti.API.info('------------------------------------');
           }
       }
       
       function showCalendars(calendars) {
           for (var i = 0; i < calendars.length; i++) {
               Ti.API.info(calendars[i].name);
           }
       }
       
       win.open();
       
  10. Ashraf Abu 2016-06-20

    PR has been closed and rejected as the Android portion doesn't compile.
  11. Kiley Williams 2016-07-01

    Has there been any new movement on this folks?
  12. Hans Knöchel 2017-01-18

    Scheduling for 6.2.0 for now. TIMOB-18927 exposed this for iOS, the Android equivalent should be handled in this ticket.
  13. Yordan Banev 2017-08-16

    PR: https://github.com/appcelerator/titanium_mobile/pull/9325
  14. Lokesh Choudhary 2017-08-21

    FR Passed for master. PR merged.
  15. Yordan Banev 2017-08-30

    6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9376

JSON Source