|
1 |
| -import { Common } from './clevertap.common'; |
| 1 | +import { Common } from "./clevertap.common"; |
2 | 2 | import { CleverTap as CleverTapInterface } from "./";
|
3 |
| -import { on as onApplicationEvent, launchEvent } from "tns-core-modules/application"; |
| 3 | +import { |
| 4 | + on as onApplicationEvent, |
| 5 | + launchEvent |
| 6 | +} from "tns-core-modules/application"; |
4 | 7 |
|
5 | 8 | declare const CleverTap;
|
6 | 9 |
|
7 | 10 | export class CleverTapImpl extends Common implements CleverTapInterface {
|
8 |
| - |
9 |
| - constructor() { |
10 |
| - super(); |
11 |
| - onApplicationEvent(launchEvent, (args) => { |
12 |
| - CleverTap.autoIntegrate(); |
13 |
| - }); |
14 |
| - } |
15 |
| - |
16 |
| - register() { |
17 |
| - throw new Error("Method not implemented."); |
18 |
| - } |
19 |
| - |
20 |
| - updateProfile(profile: any) { |
21 |
| - CleverTap.sharedInstance().profilePush(profile); |
22 |
| - } |
23 |
| - |
24 |
| - pushEvent(event: string, eventMeta: any) { |
25 |
| - CleverTap.sharedInstance().recordEventWithProps(event, eventMeta); |
26 |
| - } |
27 |
| - |
28 |
| - pushChargedEvent(chargeDetails: any, items: any) { |
29 |
| - CleverTap.sharedInstance().recordChargedEventWithDetailsAndItems(chargeDetails, items); |
30 |
| - } |
31 |
| - |
32 |
| - onUserLogin(profile: any) { |
33 |
| - CleverTap.sharedInstance().onUserLogin(profile); |
34 |
| - } |
35 |
| - |
36 |
| - profileGetProperty(propertyName: string) { |
37 |
| - return CleverTap.sharedInstance().profileGet(propertyName); |
38 |
| - } |
| 11 | + constructor() { |
| 12 | + super(); |
| 13 | + onApplicationEvent(launchEvent, args => { |
| 14 | + CleverTap.autoIntegrate(); |
| 15 | + }); |
| 16 | + } |
| 17 | + |
| 18 | + register() { |
| 19 | + throw new Error("Method not implemented."); |
| 20 | + } |
| 21 | + |
| 22 | + updateProfile(profile: any) { |
| 23 | + CleverTap.sharedInstance().profilePush(profile); |
| 24 | + } |
| 25 | + |
| 26 | + pushEvent(event: string, eventMeta: any) { |
| 27 | + CleverTap.sharedInstance().recordEventWithProps(event, eventMeta); |
| 28 | + } |
| 29 | + |
| 30 | + pushChargedEvent(chargeDetails: any, items: any) { |
| 31 | + CleverTap.sharedInstance().recordChargedEventWithDetailsAndItems( |
| 32 | + chargeDetails, |
| 33 | + items |
| 34 | + ); |
| 35 | + } |
| 36 | + |
| 37 | + onUserLogin(profile: any) { |
| 38 | + CleverTap.sharedInstance().onUserLogin(profile); |
| 39 | + } |
| 40 | + |
| 41 | + profileGetProperty(propertyName: string) { |
| 42 | + return CleverTap.sharedInstance().profileGet(propertyName); |
| 43 | + } |
| 44 | + |
| 45 | + public async setLocation() { |
| 46 | + throw new Error("Method not implemented."); |
| 47 | + } |
| 48 | + |
| 49 | + public pushFcmRegistrationId(fcmRegId) { |
| 50 | + throw new Error("Method not implemented."); |
| 51 | + } |
| 52 | + |
| 53 | + public handleMessage(message): boolean { |
| 54 | + throw new Error("Method not implemented."); |
| 55 | + } |
39 | 56 | }
|
40 | 57 |
|
41 | 58 | export const cleverTap = new CleverTapImpl();
|
0 commit comments