[TIMOB-19844] Android: If either uses-permission is missing hasCalendarPermissions will always be false but requestCalendarPermissions returns success
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 5.1.0 |
| Fix Version/s | n/a |
| Components | Android |
| Labels | n/a |
| Reporter | Fokke Zandbergen |
| Assignee | Unknown |
| Created | 2015-11-02T15:31:23.000+0000 |
| Updated | 2018-02-28T19:55:48.000+0000 |
Description
Until TIMOB-7949 is resolved you have to manually add this to your tiapp.xml:
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
But if either is missing (e.g. because you don't need WRITE) weird stuff happens:
1. Ti.Calendar.hasCalendarPermissions() will always be false
2. Ti.Calendar.requestCalendarPermissions will always show the dialog and if you grant permissions call back with success:true.
I'd assume Ti.Calendar.requestCalendarPermissions to always call back with success:false - as it does when you don't have either user-permission in place.
I think the best approach is to resolve TIMOB-7949 and with that this one as well.
Will be fixed with TIMOB-19933