From 0b9717636c4220ce06f883e85eb75dadde99b7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=84=E6=BD=AE=E5=84=BF?= <1029278668@qq.com> Date: Sat, 15 Sep 2018 17:02:53 +0800 Subject: [PATCH] feat(janalytics): add plugin (#2711) * add janalytics native plugin * add new plugin of wechat * rm plugin wechat * Update index.ts --- src/@ionic-native/plugins/janalytics/index.ts | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 src/@ionic-native/plugins/janalytics/index.ts diff --git a/src/@ionic-native/plugins/janalytics/index.ts b/src/@ionic-native/plugins/janalytics/index.ts new file mode 100644 index 000000000..a90f409ef --- /dev/null +++ b/src/@ionic-native/plugins/janalytics/index.ts @@ -0,0 +1,95 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +/** + * @name jAnalytics + * @description + * This plugin does something + * + * @usage + * ```typescript + * import { JAnalytics } from '@ionic-native/JAnalytics'; + * + * + * constructor(private jAnalytics: JAnalytics) { } + * + * ... + * + * + * this.jAnalytics.functionName('Hello', 123) + * .then((res: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'JAnalytics', + plugin: 'cordova-plugin-janalytics', + pluginRef: 'JAnalytics', + repo: 'https://github.com/jpush/cordova-plugin-janalytics', + install: + 'ionic cordova plugin add cordova-plugin-janalytics --variable APP_KEY=YOUR_APP_KEY', + installVariables: ['APP_KEY'], + platforms: ['Android', 'iOS'] +}) +@Injectable() +export class JAnalytics extends IonicNativePlugin { + /** + * This function does something + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + init(): Promise { + return; + } + + @Cordova() + initCrashHandler(): Promise { + return; + } + + @Cordova() + stopCrashHandler(): Promise { + return; + } + + @Cordova() + onPageStart(params: any): Promise { + return; + } + + @Cordova() + onPageEnd(params: any): Promise { + return; + } + + @Cordova() + addCountEvent(params: any): Promise { + return; + } + + @Cordova() + addCalculateEvent(params: any): Promise { + return; + } + + @Cordova() + addLoginEvent(params: any): Promise { + return; + } + + @Cordova() + addRegisterEvent(params: any): Promise { + return; + } + + @Cordova() + addBrowseEvent(params: any): Promise { + return; + } + + @Cordova() + addPurchaseEvent(params: any): Promise { + return; + } +}