@ua/capacitor-airship 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/UaCapacitorAirship.podspec +18 -0
- package/android/build.gradle +72 -0
- package/android/src/main/AndroidManifest.xml +33 -0
- package/android/src/main/java/com/airship/capacitor/AirshipCapacitorVersion.kt +7 -0
- package/android/src/main/java/com/airship/capacitor/AirshipPlugin.kt +331 -0
- package/android/src/main/java/com/airship/capacitor/CapacitorAutopilot.kt +39 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/esm/AirshipActions.d.ts +18 -0
- package/dist/esm/AirshipActions.js +20 -0
- package/dist/esm/AirshipActions.js.map +1 -0
- package/dist/esm/AirshipAnalytics.d.ts +30 -0
- package/dist/esm/AirshipAnalytics.js +39 -0
- package/dist/esm/AirshipAnalytics.js.map +1 -0
- package/dist/esm/AirshipChannel.d.ts +61 -0
- package/dist/esm/AirshipChannel.js +87 -0
- package/dist/esm/AirshipChannel.js.map +1 -0
- package/dist/esm/AirshipContact.d.ts +48 -0
- package/dist/esm/AirshipContact.js +68 -0
- package/dist/esm/AirshipContact.js.map +1 -0
- package/dist/esm/AirshipFeatureFlagManager.d.ts +24 -0
- package/dist/esm/AirshipFeatureFlagManager.js +28 -0
- package/dist/esm/AirshipFeatureFlagManager.js.map +1 -0
- package/dist/esm/AirshipInApp.d.ts +30 -0
- package/dist/esm/AirshipInApp.js +39 -0
- package/dist/esm/AirshipInApp.js.map +1 -0
- package/dist/esm/AirshipLocale.d.ts +24 -0
- package/dist/esm/AirshipLocale.js +31 -0
- package/dist/esm/AirshipLocale.js.map +1 -0
- package/dist/esm/AirshipMessageCenter.d.ts +77 -0
- package/dist/esm/AirshipMessageCenter.js +99 -0
- package/dist/esm/AirshipMessageCenter.js.map +1 -0
- package/dist/esm/AirshipPlugin.d.ts +31 -0
- package/dist/esm/AirshipPlugin.js +15 -0
- package/dist/esm/AirshipPlugin.js.map +1 -0
- package/dist/esm/AirshipPreferenceCenter.d.ts +38 -0
- package/dist/esm/AirshipPreferenceCenter.js +49 -0
- package/dist/esm/AirshipPreferenceCenter.js.map +1 -0
- package/dist/esm/AirshipPrivacyManager.d.ts +38 -0
- package/dist/esm/AirshipPrivacyManager.js +48 -0
- package/dist/esm/AirshipPrivacyManager.js.map +1 -0
- package/dist/esm/AirshipPush.d.ts +184 -0
- package/dist/esm/AirshipPush.js +232 -0
- package/dist/esm/AirshipPush.js.map +1 -0
- package/dist/esm/AirshipRoot.d.ts +49 -0
- package/dist/esm/AirshipRoot.js +55 -0
- package/dist/esm/AirshipRoot.js.map +1 -0
- package/dist/esm/AttributeEditor.d.ts +54 -0
- package/dist/esm/AttributeEditor.js +76 -0
- package/dist/esm/AttributeEditor.js.map +1 -0
- package/dist/esm/EventType.d.ts +25 -0
- package/dist/esm/EventType.js +14 -0
- package/dist/esm/EventType.js.map +1 -0
- package/dist/esm/ScopedSubscriptionListEditor.d.ts +59 -0
- package/dist/esm/ScopedSubscriptionListEditor.js +62 -0
- package/dist/esm/ScopedSubscriptionListEditor.js.map +1 -0
- package/dist/esm/SubscriptionListEditor.d.ts +50 -0
- package/dist/esm/SubscriptionListEditor.js +56 -0
- package/dist/esm/SubscriptionListEditor.js.map +1 -0
- package/dist/esm/TagEditor.d.ts +46 -0
- package/dist/esm/TagEditor.js +46 -0
- package/dist/esm/TagEditor.js.map +1 -0
- package/dist/esm/TagGroupEditor.d.ts +60 -0
- package/dist/esm/TagGroupEditor.js +60 -0
- package/dist/esm/TagGroupEditor.js.map +1 -0
- package/dist/esm/index.d.ts +20 -0
- package/dist/esm/index.js +25 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types.d.ts +651 -0
- package/dist/esm/types.js +167 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/plugin.cjs.js +1278 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +1281 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/AirshipCapacitorAutopilot.swift +94 -0
- package/ios/Plugin/AirshipCapacitorBootstrap.h +8 -0
- package/ios/Plugin/AirshipCapacitorBootstrap.m +24 -0
- package/ios/Plugin/AirshipCapacitorVersion.swift +7 -0
- package/ios/Plugin/AirshipPlugin.h +7 -0
- package/ios/Plugin/AirshipPlugin.m +9 -0
- package/ios/Plugin/AirshipPlugin.swift +557 -0
- package/ios/Plugin/Info.plist +24 -0
- package/package.json +75 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
import { AttributeEditor } from './AttributeEditor';
|
|
3
|
+
import { SubscriptionListEditor } from './SubscriptionListEditor';
|
|
4
|
+
import { TagEditor } from './TagEditor';
|
|
5
|
+
import { TagGroupEditor } from './TagGroupEditor';
|
|
6
|
+
import type { AirshipPluginWrapper } from './AirshipPlugin';
|
|
7
|
+
import type { ChannelCreatedEvent } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Airship channel.
|
|
10
|
+
*/
|
|
11
|
+
export declare class AirshipChannel {
|
|
12
|
+
private readonly plugin;
|
|
13
|
+
constructor(plugin: AirshipPluginWrapper);
|
|
14
|
+
/**
|
|
15
|
+
* Gets the device tags.
|
|
16
|
+
* @returns A promise with the result.
|
|
17
|
+
*/
|
|
18
|
+
getTags(): Promise<string[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the channel Id.
|
|
21
|
+
*
|
|
22
|
+
* @returns A promise with the result.
|
|
23
|
+
*/
|
|
24
|
+
getChannelId(): Promise<string | null | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Gets a list of the channel's subscriptions.
|
|
27
|
+
* @returns A promise with the result.
|
|
28
|
+
*/
|
|
29
|
+
getSubscriptionLists(): Promise<string[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Edits tags.
|
|
32
|
+
* @returns A tag group editor.
|
|
33
|
+
*/
|
|
34
|
+
editTags(): TagEditor;
|
|
35
|
+
/**
|
|
36
|
+
* Edits tag groups.
|
|
37
|
+
* @returns A tag group editor.
|
|
38
|
+
*/
|
|
39
|
+
editTagGroups(): TagGroupEditor;
|
|
40
|
+
/**
|
|
41
|
+
* Edits attributes.
|
|
42
|
+
* @returns An attribute editor.
|
|
43
|
+
*/
|
|
44
|
+
editAttributes(): AttributeEditor;
|
|
45
|
+
/**
|
|
46
|
+
* Edits subscription lists.
|
|
47
|
+
* @returns A subscription list editor.
|
|
48
|
+
*/
|
|
49
|
+
editSubscriptionLists(): SubscriptionListEditor;
|
|
50
|
+
/**
|
|
51
|
+
* Enables channel creation if channel creation has been delayed.
|
|
52
|
+
* It is only necessary to call this when isChannelCreationDelayEnabled
|
|
53
|
+
* has been set to `true` in the airship config.
|
|
54
|
+
* Deprecated. Use the Private Manager to disable all features instead.
|
|
55
|
+
*/
|
|
56
|
+
enableChannelCreation(): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Adds a channel created listener
|
|
59
|
+
*/
|
|
60
|
+
onChannelCreated(listener: (event: ChannelCreatedEvent) => void): Promise<PluginListenerHandle>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { AttributeEditor } from './AttributeEditor';
|
|
2
|
+
import { EventType } from './EventType';
|
|
3
|
+
import { SubscriptionListEditor } from './SubscriptionListEditor';
|
|
4
|
+
import { TagEditor } from './TagEditor';
|
|
5
|
+
import { TagGroupEditor } from './TagGroupEditor';
|
|
6
|
+
/**
|
|
7
|
+
* Airship channel.
|
|
8
|
+
*/
|
|
9
|
+
export class AirshipChannel {
|
|
10
|
+
constructor(plugin) {
|
|
11
|
+
this.plugin = plugin;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Gets the device tags.
|
|
15
|
+
* @returns A promise with the result.
|
|
16
|
+
*/
|
|
17
|
+
getTags() {
|
|
18
|
+
return this.plugin.perform('channel#getTags');
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Gets the channel Id.
|
|
22
|
+
*
|
|
23
|
+
* @returns A promise with the result.
|
|
24
|
+
*/
|
|
25
|
+
getChannelId() {
|
|
26
|
+
return this.plugin.perform('channel#getChannelId');
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Gets a list of the channel's subscriptions.
|
|
30
|
+
* @returns A promise with the result.
|
|
31
|
+
*/
|
|
32
|
+
getSubscriptionLists() {
|
|
33
|
+
return this.plugin.perform('channel#getSubscriptionLists');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Edits tags.
|
|
37
|
+
* @returns A tag group editor.
|
|
38
|
+
*/
|
|
39
|
+
editTags() {
|
|
40
|
+
return new TagEditor((operations) => {
|
|
41
|
+
return this.plugin.perform('channel#editTags', operations);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Edits tag groups.
|
|
46
|
+
* @returns A tag group editor.
|
|
47
|
+
*/
|
|
48
|
+
editTagGroups() {
|
|
49
|
+
return new TagGroupEditor((operations) => {
|
|
50
|
+
return this.plugin.perform('channel#editTagGroups', operations);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Edits attributes.
|
|
55
|
+
* @returns An attribute editor.
|
|
56
|
+
*/
|
|
57
|
+
editAttributes() {
|
|
58
|
+
return new AttributeEditor((operations) => {
|
|
59
|
+
return this.plugin.perform('channel#editAttributes', operations);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Edits subscription lists.
|
|
64
|
+
* @returns A subscription list editor.
|
|
65
|
+
*/
|
|
66
|
+
editSubscriptionLists() {
|
|
67
|
+
return new SubscriptionListEditor((operations) => {
|
|
68
|
+
return this.plugin.perform('channel#editSubscriptionLists', operations);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Enables channel creation if channel creation has been delayed.
|
|
73
|
+
* It is only necessary to call this when isChannelCreationDelayEnabled
|
|
74
|
+
* has been set to `true` in the airship config.
|
|
75
|
+
* Deprecated. Use the Private Manager to disable all features instead.
|
|
76
|
+
*/
|
|
77
|
+
enableChannelCreation() {
|
|
78
|
+
return this.plugin.perform('channel#enableChannelCreation');
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Adds a channel created listener
|
|
82
|
+
*/
|
|
83
|
+
onChannelCreated(listener) {
|
|
84
|
+
return this.plugin.addListener(EventType.ChannelCreated, listener);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=AirshipChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirshipChannel.js","sourceRoot":"","sources":["../../src/AirshipChannel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EACL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOlD;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB,YAA6B,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAE7D;;;OAGG;IACI,OAAO;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACI,YAAY;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACI,oBAAoB;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,OAAO,IAAI,SAAS,CAAC,CAAC,UAA0B,EAAE,EAAE;YAClD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;IACD;;;OAGG;IACI,aAAa;QAClB,OAAO,IAAI,cAAc,CAAC,CAAC,UAA+B,EAAE,EAAE;YAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACI,cAAc;QACnB,OAAO,IAAI,eAAe,CAAC,CAAC,UAAgC,EAAE,EAAE;YAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACI,qBAAqB;QAC1B,OAAO,IAAI,sBAAsB,CAC/B,CAAC,UAAuC,EAAE,EAAE;YAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,+BAA+B,EAAE,UAAU,CAAC,CAAC;QAC1E,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,qBAAqB;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,QAA8C;QACpE,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAA;IACpE,CAAC;CACF","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nimport type { AttributeOperation } from './AttributeEditor';\nimport { AttributeEditor } from './AttributeEditor';\nimport { EventType } from './EventType';\nimport type {\n SubscriptionListOperation} from './SubscriptionListEditor';\nimport {\n SubscriptionListEditor\n} from './SubscriptionListEditor';\nimport type { TagOperation } from './TagEditor';\nimport { TagEditor } from './TagEditor';\nimport type { TagGroupOperation } from './TagGroupEditor';\nimport { TagGroupEditor } from './TagGroupEditor';\nimport type { AirshipPluginWrapper } from './AirshipPlugin';\nimport type { ChannelCreatedEvent } from './types';\n\n\n\n\n/**\n * Airship channel.\n */\nexport class AirshipChannel {\n constructor(private readonly plugin: AirshipPluginWrapper) {}\n\n /**\n * Gets the device tags.\n * @returns A promise with the result.\n */\n public getTags(): Promise<string[]> {\n return this.plugin.perform('channel#getTags');\n }\n\n /**\n * Gets the channel Id.\n *\n * @returns A promise with the result.\n */\n public getChannelId(): Promise<string | null | undefined> {\n return this.plugin.perform('channel#getChannelId');\n }\n\n /**\n * Gets a list of the channel's subscriptions.\n * @returns A promise with the result.\n */\n public getSubscriptionLists(): Promise<string[]> {\n return this.plugin.perform('channel#getSubscriptionLists');\n }\n\n /**\n * Edits tags.\n * @returns A tag group editor.\n */\n public editTags(): TagEditor {\n return new TagEditor((operations: TagOperation[]) => {\n return this.plugin.perform('channel#editTags', operations);\n });\n }\n /**\n * Edits tag groups.\n * @returns A tag group editor.\n */\n public editTagGroups(): TagGroupEditor {\n return new TagGroupEditor((operations: TagGroupOperation[]) => {\n return this.plugin.perform('channel#editTagGroups', operations);\n });\n }\n\n /**\n * Edits attributes.\n * @returns An attribute editor.\n */\n public editAttributes(): AttributeEditor {\n return new AttributeEditor((operations: AttributeOperation[]) => {\n return this.plugin.perform('channel#editAttributes', operations);\n });\n }\n\n /**\n * Edits subscription lists.\n * @returns A subscription list editor.\n */\n public editSubscriptionLists(): SubscriptionListEditor {\n return new SubscriptionListEditor(\n (operations: SubscriptionListOperation[]) => {\n return this.plugin.perform('channel#editSubscriptionLists', operations);\n },\n );\n }\n\n /**\n * Enables channel creation if channel creation has been delayed.\n * It is only necessary to call this when isChannelCreationDelayEnabled\n * has been set to `true` in the airship config.\n * Deprecated. Use the Private Manager to disable all features instead.\n */\n public enableChannelCreation(): Promise<void> {\n return this.plugin.perform('channel#enableChannelCreation');\n }\n\n /**\n * Adds a channel created listener\n */\n public onChannelCreated(listener: (event: ChannelCreatedEvent) => void): Promise<PluginListenerHandle> {\n return this.plugin.addListener(EventType.ChannelCreated, listener)\n }\n}\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AttributeEditor } from './AttributeEditor';
|
|
2
|
+
import { ScopedSubscriptionListEditor } from './ScopedSubscriptionListEditor';
|
|
3
|
+
import { TagGroupEditor } from './TagGroupEditor';
|
|
4
|
+
import type { AirshipPluginWrapper } from './AirshipPlugin';
|
|
5
|
+
import type { SubscriptionScope } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Airship contact.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AirshipContact {
|
|
10
|
+
private readonly plugin;
|
|
11
|
+
constructor(plugin: AirshipPluginWrapper);
|
|
12
|
+
/**
|
|
13
|
+
* Identifies the contact with a named user Id.
|
|
14
|
+
* @param namedUser The named user Id.
|
|
15
|
+
* @returns A promise.
|
|
16
|
+
*/
|
|
17
|
+
identify(namedUser: string): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Resets the contact.
|
|
20
|
+
* @returns A promise.
|
|
21
|
+
*/
|
|
22
|
+
reset(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the named user Id.
|
|
25
|
+
* @returns A promise with the result.
|
|
26
|
+
*/
|
|
27
|
+
getNamedUserId(): Promise<string | null | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the contacts subscription lists.
|
|
30
|
+
* @returns A promise with the result.
|
|
31
|
+
*/
|
|
32
|
+
getSubscriptionLists(): Promise<Record<string, SubscriptionScope[]>>;
|
|
33
|
+
/**
|
|
34
|
+
* Edits tag groups.
|
|
35
|
+
* @returns A tag group editor.
|
|
36
|
+
*/
|
|
37
|
+
editTagGroups(): TagGroupEditor;
|
|
38
|
+
/**
|
|
39
|
+
* Edits attributes.
|
|
40
|
+
* @returns An attribute editor.
|
|
41
|
+
*/
|
|
42
|
+
editAttributes(): AttributeEditor;
|
|
43
|
+
/**
|
|
44
|
+
* Edits subscription lists.
|
|
45
|
+
* @returns A subscription list editor.
|
|
46
|
+
*/
|
|
47
|
+
editSubscriptionLists(): ScopedSubscriptionListEditor;
|
|
48
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { AttributeEditor } from './AttributeEditor';
|
|
2
|
+
import { ScopedSubscriptionListEditor } from './ScopedSubscriptionListEditor';
|
|
3
|
+
import { TagGroupEditor } from './TagGroupEditor';
|
|
4
|
+
/**
|
|
5
|
+
* Airship contact.
|
|
6
|
+
*/
|
|
7
|
+
export class AirshipContact {
|
|
8
|
+
constructor(plugin) {
|
|
9
|
+
this.plugin = plugin;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Identifies the contact with a named user Id.
|
|
13
|
+
* @param namedUser The named user Id.
|
|
14
|
+
* @returns A promise.
|
|
15
|
+
*/
|
|
16
|
+
identify(namedUser) {
|
|
17
|
+
return this.plugin.perform('contact#identify', namedUser);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resets the contact.
|
|
21
|
+
* @returns A promise.
|
|
22
|
+
*/
|
|
23
|
+
reset() {
|
|
24
|
+
return this.plugin.perform('contact#reset');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Gets the named user Id.
|
|
28
|
+
* @returns A promise with the result.
|
|
29
|
+
*/
|
|
30
|
+
getNamedUserId() {
|
|
31
|
+
return this.plugin.perform('contact#getNamedUserId');
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Gets the contacts subscription lists.
|
|
35
|
+
* @returns A promise with the result.
|
|
36
|
+
*/
|
|
37
|
+
getSubscriptionLists() {
|
|
38
|
+
return this.plugin.perform('contact#getSubscriptionLists');
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Edits tag groups.
|
|
42
|
+
* @returns A tag group editor.
|
|
43
|
+
*/
|
|
44
|
+
editTagGroups() {
|
|
45
|
+
return new TagGroupEditor((operations) => {
|
|
46
|
+
return this.plugin.perform('contact#editTagGroups', operations);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Edits attributes.
|
|
51
|
+
* @returns An attribute editor.
|
|
52
|
+
*/
|
|
53
|
+
editAttributes() {
|
|
54
|
+
return new AttributeEditor((operations) => {
|
|
55
|
+
return this.plugin.perform('contact#editAttributes', operations);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Edits subscription lists.
|
|
60
|
+
* @returns A subscription list editor.
|
|
61
|
+
*/
|
|
62
|
+
editSubscriptionLists() {
|
|
63
|
+
return new ScopedSubscriptionListEditor((operations) => {
|
|
64
|
+
return this.plugin.perform('contact#editSubscriptionLists', operations);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=AirshipContact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirshipContact.js","sourceRoot":"","sources":["../../src/AirshipContact.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EACL,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB,YAA6B,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAE7D;;;;OAIG;IACI,QAAQ,CAAC,SAAiB;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvD,CAAC;IAED;;;OAGG;IACI,oBAAoB;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACI,aAAa;QAClB,OAAO,IAAI,cAAc,CAAC,CAAC,UAA+B,EAAE,EAAE;YAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACI,cAAc;QACnB,OAAO,IAAI,eAAe,CAAC,CAAC,UAAgC,EAAE,EAAE;YAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACI,qBAAqB;QAC1B,OAAO,IAAI,4BAA4B,CACrC,CAAC,UAA6C,EAAE,EAAE;YAChD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,+BAA+B,EAAE,UAAU,CAAC,CAAC;QAC1E,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { AttributeOperation } from './AttributeEditor';\nimport { AttributeEditor } from './AttributeEditor';\nimport type {\n ScopedSubscriptionListOperation} from './ScopedSubscriptionListEditor';\nimport {\n ScopedSubscriptionListEditor\n} from './ScopedSubscriptionListEditor';\nimport type { TagGroupOperation } from './TagGroupEditor';\nimport { TagGroupEditor } from './TagGroupEditor';\nimport type { AirshipPluginWrapper } from './AirshipPlugin';\nimport type { SubscriptionScope } from './types';\n\n/**\n * Airship contact.\n */\nexport class AirshipContact {\n constructor(private readonly plugin: AirshipPluginWrapper) {}\n\n /**\n * Identifies the contact with a named user Id.\n * @param namedUser The named user Id.\n * @returns A promise.\n */\n public identify(namedUser: string): Promise<void> {\n return this.plugin.perform('contact#identify', namedUser);\n }\n\n /**\n * Resets the contact.\n * @returns A promise.\n */\n public reset(): Promise<void> {\n return this.plugin.perform('contact#reset');\n }\n\n /**\n * Gets the named user Id.\n * @returns A promise with the result.\n */\n public getNamedUserId(): Promise<string | null | undefined> {\n return this.plugin.perform('contact#getNamedUserId');\n }\n\n /**\n * Gets the contacts subscription lists.\n * @returns A promise with the result.\n */\n public getSubscriptionLists(): Promise<Record<string, SubscriptionScope[]>> {\n return this.plugin.perform('contact#getSubscriptionLists');\n }\n\n /**\n * Edits tag groups.\n * @returns A tag group editor.\n */\n public editTagGroups(): TagGroupEditor {\n return new TagGroupEditor((operations: TagGroupOperation[]) => {\n return this.plugin.perform('contact#editTagGroups', operations);\n });\n }\n\n /**\n * Edits attributes.\n * @returns An attribute editor.\n */\n public editAttributes(): AttributeEditor {\n return new AttributeEditor((operations: AttributeOperation[]) => {\n return this.plugin.perform('contact#editAttributes', operations);\n });\n }\n\n /**\n * Edits subscription lists.\n * @returns A subscription list editor.\n */\n public editSubscriptionLists(): ScopedSubscriptionListEditor {\n return new ScopedSubscriptionListEditor(\n (operations: ScopedSubscriptionListOperation[]) => {\n return this.plugin.perform('contact#editSubscriptionLists', operations);\n },\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AirshipPluginWrapper } from './AirshipPlugin';
|
|
2
|
+
import type { FeatureFlag } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Airship feature flag manager.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AirshipFeatureFlagManager {
|
|
7
|
+
private readonly plugin;
|
|
8
|
+
constructor(plugin: AirshipPluginWrapper);
|
|
9
|
+
/**
|
|
10
|
+
* Retrieve a given flag's status and associated data by its name.
|
|
11
|
+
* @param {string} flagName The flag name
|
|
12
|
+
* @return {Promise<FeatureFlag>} A promise resolving to the feature flag
|
|
13
|
+
* requested.
|
|
14
|
+
* @throws {Error} when failed to fetch
|
|
15
|
+
*/
|
|
16
|
+
flag(flagName: string): Promise<FeatureFlag>;
|
|
17
|
+
/**
|
|
18
|
+
* Tracks a feature flag interaction event.
|
|
19
|
+
* @param {FeatureFlag} flag The flag
|
|
20
|
+
* @return {Promise<Void>} A promise with an empty result.
|
|
21
|
+
* @throws {Error} when failed to fetch
|
|
22
|
+
*/
|
|
23
|
+
trackInteraction(flag: FeatureFlag): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Airship feature flag manager.
|
|
3
|
+
*/
|
|
4
|
+
export class AirshipFeatureFlagManager {
|
|
5
|
+
constructor(plugin) {
|
|
6
|
+
this.plugin = plugin;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve a given flag's status and associated data by its name.
|
|
10
|
+
* @param {string} flagName The flag name
|
|
11
|
+
* @return {Promise<FeatureFlag>} A promise resolving to the feature flag
|
|
12
|
+
* requested.
|
|
13
|
+
* @throws {Error} when failed to fetch
|
|
14
|
+
*/
|
|
15
|
+
flag(flagName) {
|
|
16
|
+
return this.plugin.perform('featureFlagManager#flag', flagName);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Tracks a feature flag interaction event.
|
|
20
|
+
* @param {FeatureFlag} flag The flag
|
|
21
|
+
* @return {Promise<Void>} A promise with an empty result.
|
|
22
|
+
* @throws {Error} when failed to fetch
|
|
23
|
+
*/
|
|
24
|
+
trackInteraction(flag) {
|
|
25
|
+
return this.plugin.perform('featureFlagManager#trackInteraction', flag);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=AirshipFeatureFlagManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirshipFeatureFlagManager.js","sourceRoot":"","sources":["../../src/AirshipFeatureFlagManager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,yBAAyB;IACpC,YAA6B,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAE9D;;;;;;QAMI;IACI,IAAI,CACT,QAAgB;QAEhB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;IAClE,CAAC;IAEF;;;;;QAKI;IACI,gBAAgB,CAAC,IAAiB;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,qCAAqC,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;CACF","sourcesContent":["import type { AirshipPluginWrapper } from './AirshipPlugin';\nimport type { FeatureFlag } from './types';\n\n/**\n * Airship feature flag manager.\n */\nexport class AirshipFeatureFlagManager {\n constructor(private readonly plugin: AirshipPluginWrapper) {}\n\n /**\n * Retrieve a given flag's status and associated data by its name.\n * @param {string} flagName The flag name\n * @return {Promise<FeatureFlag>} A promise resolving to the feature flag\n * requested.\n * @throws {Error} when failed to fetch\n */\n public flag(\n flagName: string\n ): Promise<FeatureFlag> {\n return this.plugin.perform('featureFlagManager#flag', flagName);\n }\n\n /**\n * Tracks a feature flag interaction event.\n * @param {FeatureFlag} flag The flag\n * @return {Promise<Void>} A promise with an empty result.\n * @throws {Error} when failed to fetch\n */\n public trackInteraction(flag: FeatureFlag): Promise<void> {\n return this.plugin.perform('featureFlagManager#trackInteraction', flag);\n }\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AirshipPluginWrapper } from './AirshipPlugin';
|
|
2
|
+
/**
|
|
3
|
+
* Airship InApp Experiences.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AirshipInApp {
|
|
6
|
+
private readonly plugin;
|
|
7
|
+
constructor(plugin: AirshipPluginWrapper);
|
|
8
|
+
/**
|
|
9
|
+
* Pauses messages.
|
|
10
|
+
* @param paused `true` to pause, `false` to resume.
|
|
11
|
+
* @returns A promise.
|
|
12
|
+
*/
|
|
13
|
+
setPaused(paused: boolean): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Checks if messages are paused.
|
|
16
|
+
* @returns A promise with the result.
|
|
17
|
+
*/
|
|
18
|
+
isPaused(): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Sets the display interval for messages.
|
|
21
|
+
* @param milliseconds Display interval
|
|
22
|
+
* @returns A promise.
|
|
23
|
+
*/
|
|
24
|
+
setDisplayInterval(milliseconds: number): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Gets the display interval.
|
|
27
|
+
* @returns A promise with the result.
|
|
28
|
+
*/
|
|
29
|
+
getDisplayInterval(): Promise<number>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Airship InApp Experiences.
|
|
3
|
+
*/
|
|
4
|
+
export class AirshipInApp {
|
|
5
|
+
constructor(plugin) {
|
|
6
|
+
this.plugin = plugin;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Pauses messages.
|
|
10
|
+
* @param paused `true` to pause, `false` to resume.
|
|
11
|
+
* @returns A promise.
|
|
12
|
+
*/
|
|
13
|
+
setPaused(paused) {
|
|
14
|
+
return this.plugin.perform('inApp#setPaused', paused);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Checks if messages are paused.
|
|
18
|
+
* @returns A promise with the result.
|
|
19
|
+
*/
|
|
20
|
+
isPaused() {
|
|
21
|
+
return this.plugin.perform('inApp#isPaused');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sets the display interval for messages.
|
|
25
|
+
* @param milliseconds Display interval
|
|
26
|
+
* @returns A promise.
|
|
27
|
+
*/
|
|
28
|
+
setDisplayInterval(milliseconds) {
|
|
29
|
+
return this.plugin.perform('inApp#setDisplayInterval', milliseconds);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Gets the display interval.
|
|
33
|
+
* @returns A promise with the result.
|
|
34
|
+
*/
|
|
35
|
+
getDisplayInterval() {
|
|
36
|
+
return this.plugin.perform('inApp#getDisplayInterval');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=AirshipInApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirshipInApp.js","sourceRoot":"","sources":["../../src/AirshipInApp.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB,YAA6B,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAE7D;;;;OAIG;IACI,SAAS,CAAC,MAAe;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,YAAoB;QAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAC;IACvE,CAAC;IAED;;;OAGG;IACI,kBAAkB;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACzD,CAAC;CACF","sourcesContent":["import type { AirshipPluginWrapper } from './AirshipPlugin';\n\n/**\n * Airship InApp Experiences.\n */\nexport class AirshipInApp {\n constructor(private readonly plugin: AirshipPluginWrapper) {}\n\n /**\n * Pauses messages.\n * @param paused `true` to pause, `false` to resume.\n * @returns A promise.\n */\n public setPaused(paused: boolean): Promise<void> {\n return this.plugin.perform('inApp#setPaused', paused);\n }\n\n /**\n * Checks if messages are paused.\n * @returns A promise with the result.\n */\n public isPaused(): Promise<boolean> {\n return this.plugin.perform('inApp#isPaused');\n }\n\n /**\n * Sets the display interval for messages.\n * @param milliseconds Display interval\n * @returns A promise.\n */\n public setDisplayInterval(milliseconds: number): Promise<void> {\n return this.plugin.perform('inApp#setDisplayInterval', milliseconds);\n }\n\n /**\n * Gets the display interval.\n * @returns A promise with the result.\n */\n public getDisplayInterval(): Promise<number> {\n return this.plugin.perform('inApp#getDisplayInterval');\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AirshipPluginWrapper } from './AirshipPlugin';
|
|
2
|
+
/**
|
|
3
|
+
* Manages locale used by Airship messaging.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AirshipLocale {
|
|
6
|
+
private readonly plugin;
|
|
7
|
+
constructor(plugin: AirshipPluginWrapper);
|
|
8
|
+
/**
|
|
9
|
+
* Sets the locale override.
|
|
10
|
+
* @param localeIdentifier The locale identifier.
|
|
11
|
+
* @returns A promise.
|
|
12
|
+
*/
|
|
13
|
+
setLocaleOverride(localeIdentifier: string): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Clears the locale override.
|
|
16
|
+
* @returns A promise.
|
|
17
|
+
*/
|
|
18
|
+
clearLocaleOverride(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the current locale.
|
|
21
|
+
* @returns A promise with the result.
|
|
22
|
+
*/
|
|
23
|
+
getLocale(): Promise<string>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manages locale used by Airship messaging.
|
|
3
|
+
*/
|
|
4
|
+
export class AirshipLocale {
|
|
5
|
+
constructor(plugin) {
|
|
6
|
+
this.plugin = plugin;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Sets the locale override.
|
|
10
|
+
* @param localeIdentifier The locale identifier.
|
|
11
|
+
* @returns A promise.
|
|
12
|
+
*/
|
|
13
|
+
setLocaleOverride(localeIdentifier) {
|
|
14
|
+
return this.plugin.perform('locale#setLocaleOverride', localeIdentifier);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Clears the locale override.
|
|
18
|
+
* @returns A promise.
|
|
19
|
+
*/
|
|
20
|
+
clearLocaleOverride() {
|
|
21
|
+
return this.plugin.perform('locale#clearLocaleOverride');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Gets the current locale.
|
|
25
|
+
* @returns A promise with the result.
|
|
26
|
+
*/
|
|
27
|
+
getLocale() {
|
|
28
|
+
return this.plugin.perform('locale#getLocale');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=AirshipLocale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirshipLocale.js","sourceRoot":"","sources":["../../src/AirshipLocale.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB,YAA6B,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAE7D;;;;OAIG;IACI,iBAAiB,CAAC,gBAAwB;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACI,mBAAmB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["import type { AirshipPluginWrapper } from './AirshipPlugin';\n\n/**\n * Manages locale used by Airship messaging.\n */\nexport class AirshipLocale {\n constructor(private readonly plugin: AirshipPluginWrapper) {}\n\n /**\n * Sets the locale override.\n * @param localeIdentifier The locale identifier.\n * @returns A promise.\n */\n public setLocaleOverride(localeIdentifier: string): Promise<void> {\n return this.plugin.perform('locale#setLocaleOverride', localeIdentifier);\n }\n\n /**\n * Clears the locale override.\n * @returns A promise.\n */\n public clearLocaleOverride(): Promise<void> {\n return this.plugin.perform('locale#clearLocaleOverride');\n }\n\n /**\n * Gets the current locale.\n * @returns A promise with the result.\n */\n public getLocale(): Promise<string> {\n return this.plugin.perform('locale#getLocale');\n }\n}\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
import type { AirshipPluginWrapper } from './AirshipPlugin';
|
|
3
|
+
import type { InboxMessage, DisplayMessageCenterEvent, MessageCenterUpdatedEvent } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Airship Message Center
|
|
6
|
+
*/
|
|
7
|
+
export declare class AirshipMessageCenter {
|
|
8
|
+
private readonly plugin;
|
|
9
|
+
constructor(plugin: AirshipPluginWrapper);
|
|
10
|
+
/**
|
|
11
|
+
* Gets the unread count.
|
|
12
|
+
* @returns A promise with the result.
|
|
13
|
+
*/
|
|
14
|
+
getUnreadCount(): Promise<number>;
|
|
15
|
+
/**
|
|
16
|
+
* Gets the inbox messages.
|
|
17
|
+
* @returns A promise with the result.
|
|
18
|
+
*/
|
|
19
|
+
getMessages(): Promise<InboxMessage[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Marks a message as read.
|
|
22
|
+
* @param messageId The message Id.
|
|
23
|
+
* @returns A promise. Will reject if the message is not
|
|
24
|
+
* found or if takeOff is not called.
|
|
25
|
+
*/
|
|
26
|
+
markMessageRead(messageId: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Deletes a message.
|
|
29
|
+
* @param messageId The message Id.
|
|
30
|
+
* @returns A promise. Will reject if the message is not
|
|
31
|
+
* found or if takeOff is not called.
|
|
32
|
+
*/
|
|
33
|
+
deleteMessage(messageId: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Dismisses the OOTB message center if displayed.
|
|
36
|
+
* @returns A promise.
|
|
37
|
+
*/
|
|
38
|
+
dismiss(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Requests to display the Message Center.
|
|
41
|
+
*
|
|
42
|
+
* Will either emit an event to display the
|
|
43
|
+
* Message Center if auto launch message center
|
|
44
|
+
* is disabled, or display the OOTB message center.
|
|
45
|
+
* @param messageId Optional message Id.
|
|
46
|
+
* @returns A promise.
|
|
47
|
+
*/
|
|
48
|
+
display(messageId?: string): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Overlays the message view. Should be used to display the actual
|
|
51
|
+
* message body in a custom Message Center.
|
|
52
|
+
*
|
|
53
|
+
* @param messageId The message Id.
|
|
54
|
+
* @returns A promise.
|
|
55
|
+
*/
|
|
56
|
+
showMessageView(messageId: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Refreshes the messages.
|
|
59
|
+
* @returns A promise. Will reject if the list fails to refresh or if
|
|
60
|
+
* takeOff is not called yet.
|
|
61
|
+
*/
|
|
62
|
+
refreshMessages(): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Enables or disables showing the OOTB UI when requested to display by either
|
|
65
|
+
* `display` or by a notification with a Message Center action.
|
|
66
|
+
* @param autoLaunch true to show OOTB UI, false to emit events.
|
|
67
|
+
*/
|
|
68
|
+
setAutoLaunchDefaultMessageCenter(autoLaunch: boolean): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Adds a display message center listener.
|
|
71
|
+
*/
|
|
72
|
+
onDisplay(listener: (event: DisplayMessageCenterEvent) => void): Promise<PluginListenerHandle>;
|
|
73
|
+
/**
|
|
74
|
+
* Adds a message center list updated listener.
|
|
75
|
+
*/
|
|
76
|
+
onUpdated(listener: (event: MessageCenterUpdatedEvent) => void): Promise<PluginListenerHandle>;
|
|
77
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { EventType } from './EventType';
|
|
2
|
+
/**
|
|
3
|
+
* Airship Message Center
|
|
4
|
+
*/
|
|
5
|
+
export class AirshipMessageCenter {
|
|
6
|
+
constructor(plugin) {
|
|
7
|
+
this.plugin = plugin;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Gets the unread count.
|
|
11
|
+
* @returns A promise with the result.
|
|
12
|
+
*/
|
|
13
|
+
getUnreadCount() {
|
|
14
|
+
return this.plugin.perform('messageCenter#getUnreadCount');
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Gets the inbox messages.
|
|
18
|
+
* @returns A promise with the result.
|
|
19
|
+
*/
|
|
20
|
+
getMessages() {
|
|
21
|
+
return this.plugin.perform('messageCenter#getMessages');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Marks a message as read.
|
|
25
|
+
* @param messageId The message Id.
|
|
26
|
+
* @returns A promise. Will reject if the message is not
|
|
27
|
+
* found or if takeOff is not called.
|
|
28
|
+
*/
|
|
29
|
+
markMessageRead(messageId) {
|
|
30
|
+
return this.plugin.perform('messageCenter#markMessageRead', messageId);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Deletes a message.
|
|
34
|
+
* @param messageId The message Id.
|
|
35
|
+
* @returns A promise. Will reject if the message is not
|
|
36
|
+
* found or if takeOff is not called.
|
|
37
|
+
*/
|
|
38
|
+
deleteMessage(messageId) {
|
|
39
|
+
return this.plugin.perform('messageCenter#deleteMessage', messageId);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Dismisses the OOTB message center if displayed.
|
|
43
|
+
* @returns A promise.
|
|
44
|
+
*/
|
|
45
|
+
dismiss() {
|
|
46
|
+
return this.plugin.perform('messageCenter#dismiss');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Requests to display the Message Center.
|
|
50
|
+
*
|
|
51
|
+
* Will either emit an event to display the
|
|
52
|
+
* Message Center if auto launch message center
|
|
53
|
+
* is disabled, or display the OOTB message center.
|
|
54
|
+
* @param messageId Optional message Id.
|
|
55
|
+
* @returns A promise.
|
|
56
|
+
*/
|
|
57
|
+
display(messageId) {
|
|
58
|
+
return this.plugin.perform('messageCenter#display', messageId);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Overlays the message view. Should be used to display the actual
|
|
62
|
+
* message body in a custom Message Center.
|
|
63
|
+
*
|
|
64
|
+
* @param messageId The message Id.
|
|
65
|
+
* @returns A promise.
|
|
66
|
+
*/
|
|
67
|
+
showMessageView(messageId) {
|
|
68
|
+
return this.plugin.perform('messageCenter#showMessageView', messageId);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Refreshes the messages.
|
|
72
|
+
* @returns A promise. Will reject if the list fails to refresh or if
|
|
73
|
+
* takeOff is not called yet.
|
|
74
|
+
*/
|
|
75
|
+
refreshMessages() {
|
|
76
|
+
return this.plugin.perform('messageCenter#refreshMessages');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Enables or disables showing the OOTB UI when requested to display by either
|
|
80
|
+
* `display` or by a notification with a Message Center action.
|
|
81
|
+
* @param autoLaunch true to show OOTB UI, false to emit events.
|
|
82
|
+
*/
|
|
83
|
+
setAutoLaunchDefaultMessageCenter(autoLaunch) {
|
|
84
|
+
return this.plugin.perform('messageCenter#setAutoLaunchDefaultMessageCenter', autoLaunch);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Adds a display message center listener.
|
|
88
|
+
*/
|
|
89
|
+
onDisplay(listener) {
|
|
90
|
+
return this.plugin.addListener(EventType.DisplayMessageCenter, listener);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Adds a message center list updated listener.
|
|
94
|
+
*/
|
|
95
|
+
onUpdated(listener) {
|
|
96
|
+
return this.plugin.addListener(EventType.MessageCenterUpdated, listener);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=AirshipMessageCenter.js.map
|