-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(janalytics): add plugin (#2711)
* add janalytics native plugin * add new plugin of wechat * rm plugin wechat * Update index.ts
- Loading branch information
1 parent
10ac9ff
commit 0b97176
Showing
1 changed file
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<any>} Returns a promise that resolves when something happens | ||
*/ | ||
@Cordova() | ||
init(): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
initCrashHandler(): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
stopCrashHandler(): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
onPageStart(params: any): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
onPageEnd(params: any): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
addCountEvent(params: any): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
addCalculateEvent(params: any): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
addLoginEvent(params: any): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
addRegisterEvent(params: any): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
addBrowseEvent(params: any): Promise<any> { | ||
return; | ||
} | ||
|
||
@Cordova() | ||
addPurchaseEvent(params: any): Promise<any> { | ||
return; | ||
} | ||
} |