From 260b120e0e22dccd29b5221a8f1420334205c82b Mon Sep 17 00:00:00 2001 From: John Borges Date: Mon, 8 Feb 2021 13:24:34 -0500 Subject: [PATCH 1/2] feat(plugin): add MS App Center shared plugin --- .../plugins/app-center-shared/index.ts | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/@ionic-native/plugins/app-center-shared/index.ts diff --git a/src/@ionic-native/plugins/app-center-shared/index.ts b/src/@ionic-native/plugins/app-center-shared/index.ts new file mode 100644 index 0000000000..caf407f69c --- /dev/null +++ b/src/@ionic-native/plugins/app-center-shared/index.ts @@ -0,0 +1,61 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +/** + * @name App Center Shared + * @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} Install ID + */ + @Cordova() + getInstallId(): Promise { + 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} + */ + @Cordova() + setUserId(userId: string): Promise { + return; + } +} From 0cb835e1e2eb52e36944590f87a3574d06de77a6 Mon Sep 17 00:00:00 2001 From: John Borges <1888122+johnborges@users.noreply.github.com> Date: Mon, 8 Feb 2021 15:04:58 -0500 Subject: [PATCH 2/2] docs(app-center-shared): add incompatible doc --- src/@ionic-native/plugins/app-center-shared/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/@ionic-native/plugins/app-center-shared/index.ts b/src/@ionic-native/plugins/app-center-shared/index.ts index caf407f69c..180e3a6fe6 100644 --- a/src/@ionic-native/plugins/app-center-shared/index.ts +++ b/src/@ionic-native/plugins/app-center-shared/index.ts @@ -3,6 +3,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name App Center Shared + * @capacitorincompatible true * @description * Exposes additional shared APIs for App Center. *