Skip to content

Commit

Permalink
feat(diagnostics): Add support for new iOS14-LocationAccuracy Permiss…
Browse files Browse the repository at this point in the history
…ion (#3490)

* feat(diagnostics): add support for new iOS14-LocationAccuracy Permission

* linting fixed
  • Loading branch information
EinfachHans authored Aug 14, 2020
1 parent b4462d5 commit ccca644
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/@ionic-native/plugins/diagnostic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ export class Diagnostic extends IonicNativePlugin {
WHEN_IN_USE: 'when_in_use',
};

/**
* iOS ONLY
* Location accuracy authorization
*/
locationAccuracyAuthorization: {
FULL: 'full';
REDUCED: 'reduced';
};

permissionGroups = {
CALENDAR: ['READ_CALENDAR', 'WRITE_CALENDAR'],
CAMERA: ['CAMERA'],
Expand Down Expand Up @@ -929,4 +938,36 @@ export class Diagnostic extends IonicNativePlugin {
getMotionAuthorizationStatus(): Promise<string> {
return;
}

/**
* Returns the location accuracy authorization for the application on iOS 14+. Note: calling on iOS <14 will result in the Promise being rejected.
*
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#getlocationaccuracyauthorization)
*
* @return {Promise<string>}
*/
@Cordova({ platform: ['iOS'] })
getLocationAccuracyAuthorization(): Promise<string> {
return;
}

/**
* Requests temporary access to full location accuracy for the application on iOS 14+.
*
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#requesttemporaryfullaccuracyauthorization)
*
* @return {Promise<string>}
*/
@Cordova({ platforms: ['iOS'] })
requestTemporaryFullAccuracyAuthorization(purpose: string): Promise<string> {
return;
}

/**
* Registers a function to be called when a change in location accuracy authorization occurs on iOS 14+.
*
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#registerLocationAccuracyAuthorizationChangeHandler)
*/
@Cordova({ platforms: ['iOS'], sync: true })
registerLocationAccuracyAuthorizationChangeHandler(handler: Function): void {}
}

0 comments on commit ccca644

Please sign in to comment.