mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-04 00:13:06 +08:00
feat(plugin): add MS App Center shared plugin (#3618)
* feat(plugin): add MS App Center shared plugin * docs(app-center-shared): add incompatible doc
This commit is contained in:
parent
2cb5f5c010
commit
3d7b777b19
62
src/@ionic-native/plugins/app-center-shared/index.ts
Normal file
62
src/@ionic-native/plugins/app-center-shared/index.ts
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name App Center Shared
|
||||||
|
* @capacitorincompatible true
|
||||||
|
* @description
|
||||||
|
* Exposes additional shared APIs for App Center.
|
||||||
|
*
|
||||||
|
* For more info, please see https://docs.microsoft.com/en-us/appcenter/sdk/other-apis/cordova
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { AppCenter } from '@ionic-native/app-center-shared/ngx';
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* constructor(private appCenterShared: AppCenter) { }
|
||||||
|
*
|
||||||
|
* async getInstallId() {
|
||||||
|
* const id = await this.appCenter.getInstallId();
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* async setUserId() {
|
||||||
|
* try{
|
||||||
|
* await this.appCenter.setUserId('i-am-john');
|
||||||
|
* } catch (e){
|
||||||
|
* console.log(e);
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'AppCenter',
|
||||||
|
plugin: 'cordova-plugin-appcenter-shared',
|
||||||
|
pluginRef: 'AppCenter',
|
||||||
|
repo: 'https://github.com/Microsoft/appcenter-sdk-cordova/tree/master/cordova-plugin-appcenter-shared',
|
||||||
|
platforms: ['Android', 'iOS'],
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class AppCenter extends IonicNativePlugin {
|
||||||
|
/**
|
||||||
|
* Returns AppCenter UUID.
|
||||||
|
* For more info, please see: https://docs.microsoft.com/en-us/appcenter/sdk/other-apis/cordova#identify-installations
|
||||||
|
* @returns {Promise<string>} Install ID
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getInstallId(): Promise<string> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a user ID that's used to augment crash reports.
|
||||||
|
* For more info, please see: https://docs.microsoft.com/en-us/appcenter/sdk/other-apis/cordova#identify-users
|
||||||
|
* @param {string} userId Ex. "your-user-id"
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setUserId(userId: string): Promise<void> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user