From ce2cc1b815b309ab4ca77b5af86726ac32b86807 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Tue, 9 May 2017 23:53:15 +0200 Subject: [PATCH] feat(intercom): add Intercom plugin (#1504) --- src/@ionic-native/plugins/intercom/index.ts | 158 ++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 src/@ionic-native/plugins/intercom/index.ts diff --git a/src/@ionic-native/plugins/intercom/index.ts b/src/@ionic-native/plugins/intercom/index.ts new file mode 100644 index 0000000000..8d6c4dcc03 --- /dev/null +++ b/src/@ionic-native/plugins/intercom/index.ts @@ -0,0 +1,158 @@ +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Injectable } from '@angular/core'; + +/** + * @name Intercom + * @description + * This is a plugin that allows your Ionic app to use Intercom for iOS and/or Intercom for Android. + * Follow the offical documentation to setup this plugin correctly: https://developers.intercom.com/docs/cordova-phonegap-configuration + * + * @usage + * ```typescript + * import { Intercom } from '@ionic-native/intercom'; + * + * + * constructor(private intercom: Intercom) { } + * + * ... + * + * this.intercom.registerUnidentifiedUser(); + * ... + * this.intercom.registerForPush(); + * + * ``` + */ +@Plugin({ + pluginName: 'Intercom', + plugin: 'cordova-plugin-intercom', + pluginRef: 'intercom', + repo: 'https://github.com/intercom/intercom-cordova', + platforms: ['Android', 'iOS'], +}) +@Injectable() +export class Intercom extends IonicNativePlugin { + + /** + * Register a identified user + * @param options {any} Options + * @return {Promise} Returns a promise + */ + @Cordova() + registerIdentifiedUser(options: any): Promise { return; } + + /** + * Register a unidentified user + * @param options {any} Options + * @return {Promise} Returns a promise + */ + @Cordova() + registerUnidentifiedUser(options: any): Promise { return; } + + /** + * This resets the Intercom integration's cache of your user's identity and wipes the slate clean. + * @return {Promise} Returns a promise + */ + @Cordova() + reset(): Promise { return; } + + /** + * + * @param secureHash {string} + * @param secureData {any} + * @return {Promise} Returns a promise + */ + @Cordova() + setSecureMode(secureHash: string, secureData: any): Promise { return; } + + /** + * + * @param secureHash {string} + * @return {Promise} Returns a promise + */ + @Cordova() + setUserHash(secureHash: string): Promise { return; } + + /** + * + * @param attributes {any} + * @return {Promise} Returns a promise + */ + @Cordova() + updateUser(attributes: any): Promise { return; } + + /** + * + * @param eventName {string} + * @param metaData {any} + * @return {Promise} Returns a promise + */ + @Cordova() + logEvent(eventName: string, metaData: any): Promise { return; } + + /** + * + * @return {Promise} Returns a promise + */ + @Cordova() + displayMessenger(): Promise { return; } + + /** + * + * @return {Promise} Returns a promise + */ + @Cordova() + displayMessageComposer(): Promise { return; } + + /** + * + * @param initialMessage {string} + * @return {Promise} Returns a promise + */ + @Cordova() + displayMessageComposerWithInitialMessage(initialMessage: string): Promise { return; } + + /** + * + * @return {Promise} Returns a promise + */ + @Cordova() + displayConversationsList(): Promise { return; } + + /** + * + * @return {Promise} Returns a promise + */ + @Cordova() + unreadConversationCount(): Promise { return; } + + /** + * + * @param visibility {string} + * @return {Promise} Returns a promise + */ + @Cordova() + setLauncherVisibility(visibility: string): Promise { return; } + + /** + * + * @param visibility {string} + * @return {Promise} Returns a promise + */ + @Cordova() + setInAppMessageVisibility(visibility: string): Promise { return; } + + /** + * + * @return {Promise} Returns a promise + */ + @Cordova() + hideMessenger(): Promise { return; } + + /** + * + * @return {Promise} Returns a promise + */ + @Cordova() + registerForPush(): Promise { return; } + +}