[TIMOB-27976] iOS 14: Expose API to use Core Location AccuracyAuthorization
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-09-16T19:34:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.2.0 |
Components | iOS |
Labels | geolocation |
Reporter | Vijay Singh |
Assignee | Vijay Singh |
Created | 2020-06-23T18:36:24.000+0000 |
Updated | 2020-09-16T19:34:40.000+0000 |
Description
Apple has exposed new APIs CoreLocation framework e.g. https://developer.apple.com/documentation/corelocation/claccuracyauthorization?changes=latest_major
https://developer.apple.com/documentation/corelocation/cllocationmanager/3600217-requesttemporaryfullaccuracyauth?changes=latest_major
https://developer.apple.com/documentation/corelocation/cllocationmanager/3600216-requesttemporaryfullaccuracyauth?changes=latest_major.
Expose new APIs in SDK to use .
New APIs-
Constants -
Ti.Geolocation.ACCURACY_AUTHORIZATION_FULL
Ti.Geolocation.ACCURACY_AUTHORIZATION_REDUCED
Property (read-only)-
Ti.Geolocation.locationAccuracyAuthorization
function -
Ti.Geolocation.requestTemporaryFullAccuracyAuthorization('purposekey1', callback);
Attachments
File | Date | Size |
---|---|---|
iOS14-request-full-accurracy.png | 2020-09-09T20:57:33.000+0000 | 476512 |
iOS14-request-permission.png | 2020-09-09T20:57:29.000+0000 | 531339 |
Test Case - Steps - 1. Create app. Add key 'purposekey1' in tiapp.xml. Follow doc to add key. 2. Run the app. On launch it should show prompt to ask location access permission with map. 3. If, on map there is precise 'on' (which means app has full accuracy authorization). Click it and make it off. 4. Give permission to location by clicking on appropriate option. 5. Click on button 'Log Constants'. It should log proper values. 6. Click on button 'Get accuracy authorization'. It should show alert 'accuracy authorization is reduced'. 7. Click on button 'Request full accuracy'. It should show prompt. On click of prompt it should show proper alert. 8. Try without adding key 'purposekey1' in tiapp.xml . On click of 'Request full accuracy' , it should show proper error. 9. Try with precise 'on' in step 3 (need to delete app first). On click of 'Request full accuracy' , it should show alert that 'App is already authorized for full accuracy'
PR - https://github.com/appcelerator/titanium_mobile/pull/11813
FR Passed Waiting for Jenkins build
Verified on: Mac OS: 10.15.4 SDK: 9.2.0.v20200915123928, 9.3.0.v20200915132757 Appc CLI: 8.1.1 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202005141803 Xcode: 12.0 GM iPhone 7Plus(v14.0 GM)