Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14062] iOS Calendar: EventsAuthorizationResponse always return success in the first time even if the user press 'Don't Allow' button on the dialog requesting permission

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-03T17:23:31.000+0000
Affected Version/sRelease 3.1.0
Fix Version/s2013 Sprint 14, 2013 Sprint 14 API, Release 3.1.2, Release 3.2.0
ComponentsiOS
Labelscalendar, iOS, qe-testadded, triage
ReporterMeenakshi Pathak
AssigneeSabil Rahim
Created2013-05-31T04:54:59.000+0000
Updated2013-08-23T11:10:52.000+0000

Description

EventsAuthorizationResponse always return success in the first time even if the user press 'Don't Allow' button on the dialog requesting permission. Here is the test case:
if(Ti.Calendar.eventsAuthorization == Ti.Calendar.AUTHORIZATION_AUTHORIZED) {
   // performCalendarReadFunctions();
 } else {
    Ti.Calendar.requestEventsAuthorization(function(e){
        if (e.success) {
           alert('You have granted access to the calendar');
            //performCalendarReadFunctions();
        } else {
            alert('Access to calendar is not allowed');
        }
    });

}
Scenarios which are tested are as follow: 1. First time authorization and user press 'Don't allow' button: We get 'Success' alert but still No calendar is shown. 2. After first authorization when 'Don't allow' was pressed : We get 'error' callback. 3. First time authorization and user press 'OK' button : We get 'Success' alert and calendar is shown.

Comments

  1. Sabil Rahim 2013-07-02

    PR against master https://github.com/appcelerator/titanium_mobile/pull/4435
  2. Vishal Duggal 2013-07-25

    Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/4494
  3. Lokesh Choudhary 2013-08-15

    Verified the fix & now it returns 'access to calendar is not allowed' the first time after pressing 'don't allow' button. Thus closing. Environment: Appcel Studio : 3.1.2.201308091728 Ti SDK : 3.1.2.v20130814124556 Mac OSX : 10.8.4 Alloy : 1.2.0-beta CLI - 3.1.2-alpha Iphone5 - 6.0

JSON Source