-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathNativeRTNAirship.ts
138 lines (120 loc) · 5.79 KB
/
NativeRTNAirship.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
// Airship
takeOff(config: Object): Promise<boolean>;
isFlying(): Promise<boolean>;
airshipListenerAdded(eventName: string): void;
takePendingEvents(
eventName: string,
isHeadlessJS: boolean
): Promise<Object[]>;
addListener: (eventType: string) => void;
removeListeners: (count: number) => void;
// Channel
channelEnableChannelCreation(): Promise<void>;
channelAddTag(tag: string): Promise<void>;
channelRemoveTag(tag: string): Promise<void>;
channelEditTags(operations: Object[]): Promise<void>;
channelGetTags(): Promise<string[]>;
channelGetChannelId(): Promise<string | null | undefined>;
channelGetSubscriptionLists(): Promise<string[]>;
channelEditTagGroups(operations: Object[]): Promise<void>;
channelEditAttributes(operations: Object[]): Promise<void>;
channelEditSubscriptionLists(operations: Object[]): Promise<void>;
// Push
pushSetUserNotificationsEnabled(enabled: boolean): Promise<void>;
pushIsUserNotificationsEnabled(): Promise<boolean>;
pushEnableUserNotifications(options?: Object): Promise<boolean>;
pushGetNotificationStatus(): Promise<Object>;
pushGetRegistrationToken(): Promise<string | null | undefined>;
pushGetActiveNotifications(): Promise<Object[]>;
pushClearNotifications(): void;
pushClearNotification(identifier: string): void;
// // Push.ios
pushIosSetForegroundPresentationOptions(options: string[]): Promise<void>;
pushIosSetNotificationOptions(options: string[]): Promise<void>;
pushIosSetAutobadgeEnabled(enabled: boolean): Promise<void>;
pushIosIsAutobadgeEnabled(): Promise<boolean>;
pushIosSetBadgeNumber(badgeNumber: number): Promise<void>;
pushIosGetBadgeNumber(): Promise<number>;
pushIosIsOverridePresentationOptionsEnabled(enabled: boolean): void;
pushIosOverridePresentationOptions(requestId: string, options?: string[]): void;
pushIosGetAuthorizedNotificationSettings(): Promise<string[]>;
pushIosGetAuthorizedNotificationStatus(): Promise<string>;
// Push.android
pushAndroidIsNotificationChannelEnabled(channel: string): Promise<boolean>;
pushAndroidSetNotificationConfig(config: Object): void;
pushAndroidIsOverrideForegroundDisplayEnabled(enabled: boolean): void;
pushAndroidOverrideForegroundDisplay(requestId: string, shouldDisplay: boolean): void;
// Contact
contactIdentify(namedUser: string): Promise<void>;
contactReset(): Promise<void>;
contactNotifyRemoteLogin(): Promise<void>;
contactGetNamedUserId(): Promise<string | null | undefined>;
contactGetSubscriptionLists(): Promise<Object>;
contactEditTagGroups(operations: Object[]): Promise<void>;
contactEditAttributes(operations: Object[]): Promise<void>;
contactEditSubscriptionLists(operations: Object[]): Promise<void>;
// Analytics
analyticsTrackScreen(screen?: string): Promise<void>;
analyticsAssociateIdentifier(key: string, identifier?: string): Promise<void>;
addCustomEvent(event: Object): Promise<void>;
analyticsGetSessionId(): Promise<string>;
// Action
actionRun(action: Object): Promise<Object | Error>;
// Privacy Manager
privacyManagerSetEnabledFeatures(features: string[]): Promise<void>;
privacyManagerGetEnabledFeatures(): Promise<string[]>;
privacyManagerEnableFeature(features: string[]): Promise<void>;
privacyManagerDisableFeature(features: string[]): Promise<void>;
privacyManagerIsFeatureEnabled(features: string[]): Promise<void>;
// InApp
inAppSetDisplayInterval(milliseconds: number): Promise<void>;
inAppGetDisplayInterval(): Promise<number>;
inAppSetPaused(paused: boolean): Promise<void>;
inAppIsPaused(): Promise<boolean>;
inAppResendPendingEmbeddedEvent(): void;
// Message Center
messageCenterGetUnreadCount(): Promise<number>;
messageCenterDismiss(): Promise<void>;
messageCenterDisplay(messageId?: string): Promise<void>;
messageCenterGetMessages(): Promise<Object[]>;
messageCenterDeleteMessage(messageId: string): Promise<void>;
messageCenterMarkMessageRead(messageId: string): Promise<void>;
messageCenterRefresh(): Promise<void>;
messageCenterSetAutoLaunchDefaultMessageCenter(enabled: boolean): void;
messageCenterShowMessageCenter(messageId?: string): Promise<void>;
messageCenterShowMessageView(messageId: string): Promise<void>;
// Preference Center
preferenceCenterDisplay(preferenceCenterId: string): Promise<void>;
preferenceCenterGetConfig(preferenceCenterId: string): Promise<Object>;
preferenceCenterAutoLaunchDefaultPreferenceCenter(
preferenceCenterId: string,
autoLaunch: boolean
): void;
// Locale
localeSetLocaleOverride(localeIdentifier: string): Promise<void>;
localeGetLocale(): Promise<string>;
localeClearLocaleOverride(): Promise<void>;
// Feature Flag Manager
featureFlagManagerFlag(flagName: string, userResultCache: boolean):Promise<Object>;
featureFlagManagerTrackInteraction(flag: Object): Promise<void>;
featureFlagManagerResultCacheGetFlag(flagName: string): Promise<Object>;
featureFlagManagerResultCacheSetFlag(flag: Object, ttl: number): Promise<void>;
featureFlagManagerResultCacheRemoveFlag(flagName: string): Promise<void>;
// Live Activity
liveActivityListAll(): Promise<Object>;
liveActivityList(request: Object): Promise<Object>;
liveActivityStart(request: Object): Promise<Object>;
liveActivityUpdate(request: Object): Promise<void>;
liveActivityEnd(request: Object): Promise<void>;
// Live Update
liveUpdateListAll(): Promise<Object>;
liveUpdateList(request: Object): Promise<Object>;
liveUpdateStart(request: Object): Promise<void>;
liveUpdateUpdate(request: Object): Promise<void>;
liveUpdateEnd(request: Object): Promise<void>;
liveUpdateClearAll(): Promise<void>;
}
export default TurboModuleRegistry.getEnforcing<Spec>('RTNAirship');