@ua/capacitor-airship 1.1.0 → 1.2.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/UaCapacitorAirship.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/airship/capacitor/AirshipCapacitorVersion.kt +1 -1
- package/android/src/main/java/com/airship/capacitor/AirshipPlugin.kt +3 -3
- package/dist/esm/types.d.ts +7 -0
- package/dist/esm/types.js.map +1 -1
- package/ios/Plugin/AirshipCapacitorVersion.swift +1 -1
- package/ios/Plugin/AirshipPlugin.swift +1 -14
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -34,8 +34,8 @@ class AirshipPlugin : Plugin() {
|
|
|
34
34
|
|
|
35
35
|
companion object {
|
|
36
36
|
private val EVENT_NAME_MAP = mapOf(
|
|
37
|
-
EventType.BACKGROUND_NOTIFICATION_RESPONSE_RECEIVED to "
|
|
38
|
-
EventType.FOREGROUND_NOTIFICATION_RESPONSE_RECEIVED to "
|
|
37
|
+
EventType.BACKGROUND_NOTIFICATION_RESPONSE_RECEIVED to "notification_response_received",
|
|
38
|
+
EventType.FOREGROUND_NOTIFICATION_RESPONSE_RECEIVED to "notification_response_received",
|
|
39
39
|
EventType.CHANNEL_CREATED to "channel_created",
|
|
40
40
|
EventType.DEEP_LINK_RECEIVED to "deep_link_received",
|
|
41
41
|
EventType.DISPLAY_MESSAGE_CENTER to "display_message_center",
|
|
@@ -43,7 +43,7 @@ class AirshipPlugin : Plugin() {
|
|
|
43
43
|
EventType.MESSAGE_CENTER_UPDATED to "message_center_updated",
|
|
44
44
|
EventType.PUSH_TOKEN_RECEIVED to "push_token_received",
|
|
45
45
|
EventType.FOREGROUND_PUSH_RECEIVED to "push_received",
|
|
46
|
-
EventType.BACKGROUND_PUSH_RECEIVED to "
|
|
46
|
+
EventType.BACKGROUND_PUSH_RECEIVED to "push_received",
|
|
47
47
|
EventType.NOTIFICATION_STATUS_CHANGED to "notification_status_changed"
|
|
48
48
|
)
|
|
49
49
|
}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -19,7 +19,14 @@ export interface PushTokenReceivedEvent {
|
|
|
19
19
|
* Event fired when a push is received.
|
|
20
20
|
*/
|
|
21
21
|
export interface PushReceivedEvent {
|
|
22
|
+
/**
|
|
23
|
+
* The push payload.
|
|
24
|
+
*/
|
|
22
25
|
pushPayload: PushPayload;
|
|
26
|
+
/**
|
|
27
|
+
* Indicates whether the push was received when the application was in the background or foreground.
|
|
28
|
+
*/
|
|
29
|
+
isForeground: boolean;
|
|
23
30
|
}
|
|
24
31
|
/**
|
|
25
32
|
* The push payload.
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AA2MA;;GAEG;AACH,MAAM,KAAW,GAAG,CAwKnB;AAxKD,WAAiB,GAAG;IA0BlB;;OAEG;IACH,IAAY,kBA6BX;IA7BD,WAAY,kBAAkB;QAC5B;;WAEG;QACH,qCAAe,CAAA;QACf;;WAEG;QACH,qCAAe,CAAA;QACf;;WAEG;QACH,qCAAe,CAAA;QACf;;WAEG;QACH,0CAAoB,CAAA;QACpB;;WAEG;QACH,sDAAgC,CAAA;QAChC;;WAEG;QACH,4FAAsE,CAAA;QACtE;;WAEG;QACH,iDAA2B,CAAA;IAC7B,CAAC,EA7BW,kBAAkB,GAAlB,sBAAkB,KAAlB,sBAAkB,QA6B7B;IAED;;OAEG;IACH,IAAY,4BAqBX;IArBD,WAAY,4BAA4B;QACtC;;WAEG;QACH,+CAAe,CAAA;QACf;;WAEG;QACH,+CAAe,CAAA;QAEf;;;WAGG;QACH,6CAAa,CAAA;QAEb;;;WAGG;QACH,iDAAiB,CAAA;IACnB,CAAC,EArBW,4BAA4B,GAA5B,gCAA4B,KAA5B,gCAA4B,QAqBvC;IAED;;OAEG;IACH,IAAY,6BAyCX;IAzCD,WAAY,6BAA6B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CAAe,CAAA;AACjB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B","sourcesContent":["export type JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonObject\n | JsonArray;\n\nexport type JsonObject = {\n [key: string]: JsonValue;\n};\n\nexport type JsonArray = JsonValue[];\n\nexport interface ChannelCreatedEvent {\n /**\n * The channel ID.\n */\n channelId: string;\n}\n\nexport interface PushTokenReceivedEvent {\n /**\n * The push token.\n */\n pushToken: string;\n}\n\n/**\n * Event fired when a push is received.\n */\nexport interface PushReceivedEvent {\n pushPayload: PushPayload;\n}\n\n/**\n * The push payload.\n */\nexport interface PushPayload {\n /**\n * The alert.\n */\n alert?: string;\n /**\n * The title.\n */\n title?: string;\n /**\n * The subtitle.\n */\n subtitle?: string;\n /**\n * The notification ID.\n */\n notificationId?: string;\n /**\n * The notification extras.\n */\n extras: JsonObject;\n}\n\n/**\n * Event fired when the user initiates a notification response.\n */\nexport interface NotificationResponseEvent {\n /**\n * The push notification.\n */\n pushPayload: PushPayload;\n\n /**\n * The action button ID, if available.\n */\n actionId?: string;\n\n /**\n * Indicates whether the response was a foreground action.\n * This value is always if the user taps the main notification,\n * otherwise it is defined by the notification action button.\n */\n isForeground: boolean;\n}\n\n/**\n * Push notification status.\n */\nexport interface PushNotificationStatus {\n /**\n * If user notifications are enabled on [Airship.push].\n */\n isUserNotificationsEnabled: boolean;\n\n /**\n * If notifications are allowed at the system level for the application.\n */\n areNotificationsAllowed: boolean;\n\n /**\n * If the push feature is enabled on [Airship.privacyManager].\n */\n isPushPrivacyFeatureEnabled: boolean;\n\n /*\n * If push registration was able to generate a token.\n */\n isPushTokenRegistered: boolean;\n\n /*\n * If Airship is able to send and display a push notification.\n */\n isOptedIn: boolean;\n\n /*\n * Checks for isUserNotificationsEnabled, areNotificationsAllowed, and isPushPrivacyFeatureEnabled. If this flag\n * is true but `isOptedIn` is false, that means push token was not able to be registered.\n */\n isUserOptedIn: boolean;\n}\n\n/**\n * Event fired when the notification status changes.\n */\nexport interface PushNotificationStatusChangedEvent {\n /**\n * The push notification status.\n */\n status: PushNotificationStatus;\n}\n\n/**\n * Event fired when the Message Center is updated.\n */\nexport interface MessageCenterUpdatedEvent {\n /**\n * The unread message count.\n */\n messageUnreadCount: number;\n /**\n * The total message count.\n */\n messageCount: number;\n}\n\n/**\n * Event fired when the Message Center is requested to be displayed.\n */\nexport interface DisplayMessageCenterEvent {\n /**\n * The message ID, if available.\n */\n messageId?: string;\n}\n\n/**\n * Event fired when a deep link is opened.\n */\nexport interface DeepLinkEvent {\n /**\n * The deep link string.\n */\n deepLink: string;\n}\n\n/**\n * Event fired when a preference center is requested to be displayed.\n */\nexport interface DisplayPreferenceCenterEvent {\n /**\n * The preference center Id.\n */\n preferenceCenterId: string;\n}\n\n/**\n * Custom event\n */\nexport interface CustomEvent {\n /**\n * Event name\n */\n eventName: string;\n /**\n * Event value\n */\n eventValue?: number;\n /**\n * Event properties\n */\n properties: JsonObject;\n /**\n * Transaction ID\n */\n transactionId?: string;\n /**\n * Interaction ID\n */\n interactionId?: string;\n /**\n * Interaction type\n */\n interactionType?: string;\n}\n\n/**\n * iOS options\n */\nexport namespace iOS {\n /**\n * Quiet time\n */\n export interface QuietTime {\n /**\n * Start hour. Must be 0-23.\n */\n startHour: number;\n\n /**\n * Start minute. Must be 0-59.\n */\n startMinute: number;\n\n /**\n * End hour. Must be 0-23.\n */\n endHour: number;\n\n /**\n * End minute. Must be 0-59.\n */\n endMinute: number;\n }\n\n /**\n * Enum of notification options. iOS only.\n */\n export enum NotificationOption {\n /**\n * Alerts.\n */\n Alert = 'alert',\n /**\n * Sounds.\n */\n Sound = 'sound',\n /**\n * Badges.\n */\n Badge = 'badge',\n /**\n * Car play.\n */\n CarPlay = 'car_play',\n /**\n * Critical Alert.\n */\n CriticalAlert = 'critical_alert',\n /**\n * Provides app notification settings.\n */\n ProvidesAppNotificationSettings = 'provides_app_notification_settings',\n /**\n * Provisional.\n */\n Provisional = 'provisional',\n }\n\n /**\n * Enum of foreground notification options.\n */\n export enum ForegroundPresentationOption {\n /**\n * Play the sound associated with the notification.\n */\n Sound = 'sound',\n /**\n * Apply the notification's badge value to the app’s icon.\n */\n Badge = 'badge',\n\n /**\n * Show the notification in Notification Center. On iOS 13 an older,\n * this will also show the notification as a banner.\n */\n List = 'list',\n\n /**\n * Present the notification as a banner. On iOS 13 an older,\n * this will also show the notification in the Notification Center.\n */\n Banner = 'banner',\n }\n\n /**\n * Enum of authorized notification options.\n */\n export enum AuthorizedNotificationSetting {\n /**\n * Alerts.\n */\n Alert = 'alert',\n /**\n * Sounds.\n */\n Sound = 'sound',\n /**\n * Badges.\n */\n Badge = 'badge',\n /**\n * CarPlay.\n */\n CarPlay = 'car_play',\n /**\n * Lock screen.\n */\n LockScreen = 'lock_screen',\n /**\n * Notification center.\n */\n NotificationCenter = 'notification_center',\n /**\n * Critical alert.\n */\n CriticalAlert = 'critical_alert',\n /**\n * Announcement.\n */\n Announcement = 'announcement',\n /**\n * Scheduled delivery.\n */\n ScheduledDelivery = 'scheduled_delivery',\n /**\n * Time sensitive.\n */\n TimeSensitive = 'time_sensitive',\n }\n\n /**\n * Enum of authorized status.\n */\n export enum AuthorizedNotificationStatus {\n /**\n * Not determined.\n */\n NotDetermined = 'not_determined',\n\n /**\n * Denied.\n */\n Denied = 'denied',\n\n /**\n * Authorized.\n */\n Authorized = 'authorized',\n\n /**\n * Provisional.\n */\n Provisional = 'provisional',\n\n /**\n * Ephemeral.\n */\n Ephemeral = 'ephemeral',\n }\n\n export interface AuthorizedNotificationSettingsChangedEvent {\n /**\n * Authorized settings.\n */\n authorizedSettings: AuthorizedNotificationSetting[];\n }\n}\n\n\nexport namespace Android {\n /**\n * Android notification config.\n */\n export interface NotificationConfig {\n /**\n * The icon resource name.\n */\n icon?: string;\n /**\n * The large icon resource name.\n */\n largeIcon?: string;\n /**\n * The default android notification channel ID.\n */\n defaultChannelId?: string;\n /**\n * The accent color. Must be a hex value #AARRGGBB.\n */\n accentColor?: string;\n }\n}\n\n\n/**\n * Airship config environment\n */\nexport interface ConfigEnvironment {\n /**\n * App key.\n */\n appKey: string;\n\n /**\n * App secret.\n */\n appSecret: string;\n\n /**\n * Optional log level.\n */\n logLevel?: LogLevel;\n}\n\n/**\n * Possible sites.\n */\nexport type Site = 'us' | 'eu';\n\n/**\n * Log levels.\n */\nexport type LogLevel =\n | 'verbose'\n | 'debug'\n | 'info'\n | 'warning'\n | 'error'\n | 'none';\n\n/**\n * Airship config\n */\nexport interface AirshipConfig {\n /**\n * Default environment.\n */\n default?: ConfigEnvironment;\n\n /**\n * Development environment. Overrides default environment if inProduction is false.\n */\n development?: ConfigEnvironment;\n\n /**\n * Production environment. Overrides default environment if inProduction is true.\n */\n production?: ConfigEnvironment;\n\n /**\n * Cloud site.\n */\n site?: Site;\n\n /**\n * Switches the environment from development or production. If the value is not\n * set, Airship will determine the value at runtime.\n */\n inProduction?: boolean;\n\n /**\n * URL allow list.\n */\n urlAllowList?: string[];\n\n /**\n * URL allow list for open URL scope.\n */\n urlAllowListScopeOpenUrl?: string[];\n\n /**\n * URL allow list for JS bridge injection.\n */\n urlAllowListScopeJavaScriptInterface?: string[];\n\n /**\n * Enables delayed channel creation.\n * Deprecated. Use the Private Manager to disable all features instead.\n */\n isChannelCreationDelayEnabled?: boolean;\n\n /**\n * Initial config URL for custom Airship domains. The URL\n * should also be added to the urlAllowList.\n */\n initialConfigUrl?: string;\n\n /**\n * Enabled features. Defaults to all.\n */\n enabledFeatures?: Feature[];\n\n /**\n * Enables channel capture feature.\n * This config is enabled by default.\n */\n isChannelCaptureEnabled?: boolean;\n\n /**\n * Whether to suppress console error messages about missing allow list entries during takeOff.\n * This config is disabled by default.\n */\n suppressAllowListError?: boolean;\n\n /**\n * Pauses In-App Automation on launch.\n */\n autoPauseInAppAutomationOnLaunch?: boolean;\n\n /**\n * iOS config.\n */\n ios?: {\n /**\n * itunesId for rate app and app store deep links.\n */\n itunesId?: string;\n };\n\n /**\n * Android config.\n */\n android?: {\n /**\n * App store URI\n */\n appStoreUri?: string;\n\n /**\n * Fcm app name if using multiple FCM projects.\n */\n fcmFirebaseAppName?: string;\n\n /**\n * Notification config.\n */\n notificationConfig?: Android.NotificationConfig;\n };\n}\n\n/**\n * Enum of authorized Features.\n */\nexport enum Feature {\n InAppAutomation = 'in_app_automation',\n MessageCenter = 'message_center',\n Push = 'push',\n // No longer used\n Chat = 'chat',\n Analytics = 'analytics',\n TagsAndAttributes = 'tags_and_attributes',\n Contacts = 'contacts',\n // No longer used\n Location = 'location',\n}\n\n/**\n * All available features.\n */\nexport const FEATURES_ALL = Object.values(Feature);\n\n/**\n * Subscription Scope types.\n */\nexport enum SubscriptionScope {\n App = 'app',\n Web = 'web',\n Sms = 'sms',\n Email = 'email',\n}\n\nexport interface InboxMessage {\n /**\n * The message ID. Needed to display, mark as read, or delete the message.\n */\n id: string;\n /**\n * The message title.\n */\n title: string;\n /**\n * The message sent date in milliseconds.\n */\n sentDate: number;\n /**\n * Optional - The icon url for the message.\n */\n listIconUrl: string;\n /**\n * The unread / read status of the message.\n */\n isRead: boolean;\n /**\n * String to String map of any message extras.\n */\n extras: Record<string, string>;\n}\n\n// ---\n// See: https://github.com/urbanairship/web-push-sdk/blob/master/src/remote-data/preference-center.ts\n// ---\n\n/**\n * A preference center definition.\n *\n * @typedef {object} PreferenceCenter\n * @property {string} id the ID of the preference center\n * @property {Array<PreferenceCenter.CommonSection>} sections a list of sections\n * @property {?CommonDisplay} display display information\n */\nexport type PreferenceCenter = {\n id: string;\n sections: Section[];\n display?: CommonDisplay;\n};\n\n/**\n * Preference center display information.\n * @typedef {object} CommonDisplay\n * @property {string} name\n * @property {?string} description\n */\nexport type CommonDisplay = {\n name: string;\n description?: string;\n};\n\nexport type Icon = {\n icon: string;\n};\n\nexport type IconDisplay = CommonDisplay & Partial<Icon>;\n\nexport interface ItemBase {\n type: unknown;\n id: string;\n display: CommonDisplay;\n conditions?: Condition[];\n}\n\n/**\n * A channel subscription item.\n * @typedef {object} ChannelSubscriptionItem\n * @memberof PreferenceCenter\n * @property {\"channel_subscription\"} type\n * @property {string} id the item identifier\n * @property {?CommonDisplay} display display information\n * @property {string} subscription_id the subscription list id\n */\nexport interface ChannelSubscriptionItem extends ItemBase {\n type: 'channel_subscription';\n subscription_id: string;\n}\n\nexport interface ContactSubscriptionGroupItem extends ItemBase {\n type: 'contact_subscription_group';\n id: string;\n subscription_id: string;\n components: ContactSubscriptionGroupItemComponent[];\n}\n\nexport interface ContactSubscriptionGroupItemComponent {\n scopes: SubscriptionScope[];\n display: Omit<CommonDisplay, 'description'>;\n}\n\nexport interface ContactSubscriptionItem extends ItemBase {\n type: 'contact_subscription';\n scopes: SubscriptionScope[];\n subscription_id: string;\n}\n\nexport interface AlertItem extends ItemBase {\n type: 'alert';\n display: IconDisplay;\n button?: Button;\n}\n\nexport interface ConditionBase {\n type: unknown;\n}\n\nexport interface NotificationOptInCondition extends ConditionBase {\n type: 'notification_opt_in';\n when_status: 'opt_in' | 'opt_out';\n}\n\nexport type Condition = NotificationOptInCondition;\n\n// Changed from `unknown` in spec\nexport type Actions = {\n [key: string]: JsonValue;\n};\n\nexport interface Button {\n text: string;\n content_description?: string;\n actions: Actions;\n}\n\nexport interface SectionBase {\n type: unknown;\n id: string;\n display?: CommonDisplay;\n items: Item[];\n}\n\n/**\n * @typedef {object} CommonSection\n * @memberof PreferenceCenter\n * @property {\"section\"} type\n * @property {string} id the section identifier\n * @property {?CommonDisplay} display display information\n * @property {Array<PreferenceCenter.ChannelSubscriptionItem>} items list of\n * section items\n */\nexport interface CommonSection extends SectionBase {\n type: 'section';\n}\n\nexport interface LabeledSectionBreak extends SectionBase {\n type: 'labeled_section_break';\n items: never;\n}\n\nexport type Item =\n | ChannelSubscriptionItem\n | ContactSubscriptionGroupItem\n | ContactSubscriptionItem\n | AlertItem;\n\nexport type Section = CommonSection | LabeledSectionBreak;\n\n/**\n * An interface representing the eligibility status of a flag, and optional\n * variables associated with the flag.\n */\nexport interface FeatureFlag {\n /**\n * A boolean representing flag eligibility; will be `true` if the current\n * contact is eligible for the flag.\n */\n readonly isEligible: boolean;\n /**\n * A variables associated with the flag, if any. Will be `null` if no data\n * is associated with the flag, or if the flag does not exist.\n */\n readonly variables: unknown | null;\n /**\n * A boolean representing if the flag exists or not. For ease of use and\n * deployment, asking for a flag by any name will return a `FeatureFlag`\n * interface, even if the flag was not found to exist. However this property\n * may be checked to determine if the flag was actually resolved to a known\n * flag name.\n */\n readonly exists: boolean;\n\n /**\n * Reporting Metadata, the shape of which is private and not to be relied\n * upon. When not provided, an interaction cannot be tracked on the flag.\n * @ignore\n */\n readonly _internal: unknown;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAmNA;;GAEG;AACH,MAAM,KAAW,GAAG,CAwKnB;AAxKD,WAAiB,GAAG;IA0BlB;;OAEG;IACH,IAAY,kBA6BX;IA7BD,WAAY,kBAAkB;QAC5B;;WAEG;QACH,qCAAe,CAAA;QACf;;WAEG;QACH,qCAAe,CAAA;QACf;;WAEG;QACH,qCAAe,CAAA;QACf;;WAEG;QACH,0CAAoB,CAAA;QACpB;;WAEG;QACH,sDAAgC,CAAA;QAChC;;WAEG;QACH,4FAAsE,CAAA;QACtE;;WAEG;QACH,iDAA2B,CAAA;IAC7B,CAAC,EA7BW,kBAAkB,GAAlB,sBAAkB,KAAlB,sBAAkB,QA6B7B;IAED;;OAEG;IACH,IAAY,4BAqBX;IArBD,WAAY,4BAA4B;QACtC;;WAEG;QACH,+CAAe,CAAA;QACf;;WAEG;QACH,+CAAe,CAAA;QAEf;;;WAGG;QACH,6CAAa,CAAA;QAEb;;;WAGG;QACH,iDAAiB,CAAA;IACnB,CAAC,EArBW,4BAA4B,GAA5B,gCAA4B,KAA5B,gCAA4B,QAqBvC;IAED;;OAEG;IACH,IAAY,6BAyCX;IAzCD,WAAY,6BAA6B;QACvC;;WAEG;QACH,gDAAe,CAAA;QACf;;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AAjB,iBAAiB,QAK5B","sourcesContent":["export type JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonObject\n | JsonArray;\n\nexport type JsonObject = {\n [key: string]: JsonValue;\n};\n\nexport type JsonArray = JsonValue[];\n\nexport interface ChannelCreatedEvent {\n /**\n * The channel ID.\n */\n channelId: string;\n}\n\nexport interface PushTokenReceivedEvent {\n /**\n * The push token.\n */\n pushToken: string;\n}\n\n/**\n * Event fired when a push is received.\n */\nexport interface PushReceivedEvent {\n /**\n * The push payload.\n */\n pushPayload: PushPayload;\n\n /**\n * Indicates whether the push was received when the application was in the background or foreground.\n */\n isForeground: boolean;\n}\n\n/**\n * The push payload.\n */\nexport interface PushPayload {\n /**\n * The alert.\n */\n alert?: string;\n /**\n * The title.\n */\n title?: string;\n /**\n * The subtitle.\n */\n subtitle?: string;\n /**\n * The notification ID.\n */\n notificationId?: string;\n /**\n * The notification extras.\n */\n extras: JsonObject;\n}\n\n/**\n * Event fired when the user initiates a notification response.\n */\nexport interface NotificationResponseEvent {\n /**\n * The push notification.\n */\n pushPayload: PushPayload;\n\n /**\n * The action button ID, if available.\n */\n actionId?: string;\n\n /**\n * Indicates whether the response was a foreground action.\n * This value is always if the user taps the main notification,\n * otherwise it is defined by the notification action button.\n */\n isForeground: boolean;\n}\n\n/**\n * Push notification status.\n */\nexport interface PushNotificationStatus {\n /**\n * If user notifications are enabled on [Airship.push].\n */\n isUserNotificationsEnabled: boolean;\n\n /**\n * If notifications are allowed at the system level for the application.\n */\n areNotificationsAllowed: boolean;\n\n /**\n * If the push feature is enabled on [Airship.privacyManager].\n */\n isPushPrivacyFeatureEnabled: boolean;\n\n /*\n * If push registration was able to generate a token.\n */\n isPushTokenRegistered: boolean;\n\n /*\n * If Airship is able to send and display a push notification.\n */\n isOptedIn: boolean;\n\n /*\n * Checks for isUserNotificationsEnabled, areNotificationsAllowed, and isPushPrivacyFeatureEnabled. If this flag\n * is true but `isOptedIn` is false, that means push token was not able to be registered.\n */\n isUserOptedIn: boolean;\n}\n\n/**\n * Event fired when the notification status changes.\n */\nexport interface PushNotificationStatusChangedEvent {\n /**\n * The push notification status.\n */\n status: PushNotificationStatus;\n}\n\n/**\n * Event fired when the Message Center is updated.\n */\nexport interface MessageCenterUpdatedEvent {\n /**\n * The unread message count.\n */\n messageUnreadCount: number;\n /**\n * The total message count.\n */\n messageCount: number;\n}\n\n/**\n * Event fired when the Message Center is requested to be displayed.\n */\nexport interface DisplayMessageCenterEvent {\n /**\n * The message ID, if available.\n */\n messageId?: string;\n}\n\n/**\n * Event fired when a deep link is opened.\n */\nexport interface DeepLinkEvent {\n /**\n * The deep link string.\n */\n deepLink: string;\n}\n\n/**\n * Event fired when a preference center is requested to be displayed.\n */\nexport interface DisplayPreferenceCenterEvent {\n /**\n * The preference center Id.\n */\n preferenceCenterId: string;\n}\n\n/**\n * Custom event\n */\nexport interface CustomEvent {\n /**\n * Event name\n */\n eventName: string;\n /**\n * Event value\n */\n eventValue?: number;\n /**\n * Event properties\n */\n properties: JsonObject;\n /**\n * Transaction ID\n */\n transactionId?: string;\n /**\n * Interaction ID\n */\n interactionId?: string;\n /**\n * Interaction type\n */\n interactionType?: string;\n}\n\n/**\n * iOS options\n */\nexport namespace iOS {\n /**\n * Quiet time\n */\n export interface QuietTime {\n /**\n * Start hour. Must be 0-23.\n */\n startHour: number;\n\n /**\n * Start minute. Must be 0-59.\n */\n startMinute: number;\n\n /**\n * End hour. Must be 0-23.\n */\n endHour: number;\n\n /**\n * End minute. Must be 0-59.\n */\n endMinute: number;\n }\n\n /**\n * Enum of notification options. iOS only.\n */\n export enum NotificationOption {\n /**\n * Alerts.\n */\n Alert = 'alert',\n /**\n * Sounds.\n */\n Sound = 'sound',\n /**\n * Badges.\n */\n Badge = 'badge',\n /**\n * Car play.\n */\n CarPlay = 'car_play',\n /**\n * Critical Alert.\n */\n CriticalAlert = 'critical_alert',\n /**\n * Provides app notification settings.\n */\n ProvidesAppNotificationSettings = 'provides_app_notification_settings',\n /**\n * Provisional.\n */\n Provisional = 'provisional',\n }\n\n /**\n * Enum of foreground notification options.\n */\n export enum ForegroundPresentationOption {\n /**\n * Play the sound associated with the notification.\n */\n Sound = 'sound',\n /**\n * Apply the notification's badge value to the app’s icon.\n */\n Badge = 'badge',\n\n /**\n * Show the notification in Notification Center. On iOS 13 an older,\n * this will also show the notification as a banner.\n */\n List = 'list',\n\n /**\n * Present the notification as a banner. On iOS 13 an older,\n * this will also show the notification in the Notification Center.\n */\n Banner = 'banner',\n }\n\n /**\n * Enum of authorized notification options.\n */\n export enum AuthorizedNotificationSetting {\n /**\n * Alerts.\n */\n Alert = 'alert',\n /**\n * Sounds.\n */\n Sound = 'sound',\n /**\n * Badges.\n */\n Badge = 'badge',\n /**\n * CarPlay.\n */\n CarPlay = 'car_play',\n /**\n * Lock screen.\n */\n LockScreen = 'lock_screen',\n /**\n * Notification center.\n */\n NotificationCenter = 'notification_center',\n /**\n * Critical alert.\n */\n CriticalAlert = 'critical_alert',\n /**\n * Announcement.\n */\n Announcement = 'announcement',\n /**\n * Scheduled delivery.\n */\n ScheduledDelivery = 'scheduled_delivery',\n /**\n * Time sensitive.\n */\n TimeSensitive = 'time_sensitive',\n }\n\n /**\n * Enum of authorized status.\n */\n export enum AuthorizedNotificationStatus {\n /**\n * Not determined.\n */\n NotDetermined = 'not_determined',\n\n /**\n * Denied.\n */\n Denied = 'denied',\n\n /**\n * Authorized.\n */\n Authorized = 'authorized',\n\n /**\n * Provisional.\n */\n Provisional = 'provisional',\n\n /**\n * Ephemeral.\n */\n Ephemeral = 'ephemeral',\n }\n\n export interface AuthorizedNotificationSettingsChangedEvent {\n /**\n * Authorized settings.\n */\n authorizedSettings: AuthorizedNotificationSetting[];\n }\n}\n\n\nexport namespace Android {\n /**\n * Android notification config.\n */\n export interface NotificationConfig {\n /**\n * The icon resource name.\n */\n icon?: string;\n /**\n * The large icon resource name.\n */\n largeIcon?: string;\n /**\n * The default android notification channel ID.\n */\n defaultChannelId?: string;\n /**\n * The accent color. Must be a hex value #AARRGGBB.\n */\n accentColor?: string;\n }\n}\n\n\n/**\n * Airship config environment\n */\nexport interface ConfigEnvironment {\n /**\n * App key.\n */\n appKey: string;\n\n /**\n * App secret.\n */\n appSecret: string;\n\n /**\n * Optional log level.\n */\n logLevel?: LogLevel;\n}\n\n/**\n * Possible sites.\n */\nexport type Site = 'us' | 'eu';\n\n/**\n * Log levels.\n */\nexport type LogLevel =\n | 'verbose'\n | 'debug'\n | 'info'\n | 'warning'\n | 'error'\n | 'none';\n\n/**\n * Airship config\n */\nexport interface AirshipConfig {\n /**\n * Default environment.\n */\n default?: ConfigEnvironment;\n\n /**\n * Development environment. Overrides default environment if inProduction is false.\n */\n development?: ConfigEnvironment;\n\n /**\n * Production environment. Overrides default environment if inProduction is true.\n */\n production?: ConfigEnvironment;\n\n /**\n * Cloud site.\n */\n site?: Site;\n\n /**\n * Switches the environment from development or production. If the value is not\n * set, Airship will determine the value at runtime.\n */\n inProduction?: boolean;\n\n /**\n * URL allow list.\n */\n urlAllowList?: string[];\n\n /**\n * URL allow list for open URL scope.\n */\n urlAllowListScopeOpenUrl?: string[];\n\n /**\n * URL allow list for JS bridge injection.\n */\n urlAllowListScopeJavaScriptInterface?: string[];\n\n /**\n * Enables delayed channel creation.\n * Deprecated. Use the Private Manager to disable all features instead.\n */\n isChannelCreationDelayEnabled?: boolean;\n\n /**\n * Initial config URL for custom Airship domains. The URL\n * should also be added to the urlAllowList.\n */\n initialConfigUrl?: string;\n\n /**\n * Enabled features. Defaults to all.\n */\n enabledFeatures?: Feature[];\n\n /**\n * Enables channel capture feature.\n * This config is enabled by default.\n */\n isChannelCaptureEnabled?: boolean;\n\n /**\n * Whether to suppress console error messages about missing allow list entries during takeOff.\n * This config is disabled by default.\n */\n suppressAllowListError?: boolean;\n\n /**\n * Pauses In-App Automation on launch.\n */\n autoPauseInAppAutomationOnLaunch?: boolean;\n\n /**\n * iOS config.\n */\n ios?: {\n /**\n * itunesId for rate app and app store deep links.\n */\n itunesId?: string;\n };\n\n /**\n * Android config.\n */\n android?: {\n /**\n * App store URI\n */\n appStoreUri?: string;\n\n /**\n * Fcm app name if using multiple FCM projects.\n */\n fcmFirebaseAppName?: string;\n\n /**\n * Notification config.\n */\n notificationConfig?: Android.NotificationConfig;\n };\n}\n\n/**\n * Enum of authorized Features.\n */\nexport enum Feature {\n InAppAutomation = 'in_app_automation',\n MessageCenter = 'message_center',\n Push = 'push',\n // No longer used\n Chat = 'chat',\n Analytics = 'analytics',\n TagsAndAttributes = 'tags_and_attributes',\n Contacts = 'contacts',\n // No longer used\n Location = 'location',\n}\n\n/**\n * All available features.\n */\nexport const FEATURES_ALL = Object.values(Feature);\n\n/**\n * Subscription Scope types.\n */\nexport enum SubscriptionScope {\n App = 'app',\n Web = 'web',\n Sms = 'sms',\n Email = 'email',\n}\n\nexport interface InboxMessage {\n /**\n * The message ID. Needed to display, mark as read, or delete the message.\n */\n id: string;\n /**\n * The message title.\n */\n title: string;\n /**\n * The message sent date in milliseconds.\n */\n sentDate: number;\n /**\n * Optional - The icon url for the message.\n */\n listIconUrl: string;\n /**\n * The unread / read status of the message.\n */\n isRead: boolean;\n /**\n * String to String map of any message extras.\n */\n extras: Record<string, string>;\n}\n\n// ---\n// See: https://github.com/urbanairship/web-push-sdk/blob/master/src/remote-data/preference-center.ts\n// ---\n\n/**\n * A preference center definition.\n *\n * @typedef {object} PreferenceCenter\n * @property {string} id the ID of the preference center\n * @property {Array<PreferenceCenter.CommonSection>} sections a list of sections\n * @property {?CommonDisplay} display display information\n */\nexport type PreferenceCenter = {\n id: string;\n sections: Section[];\n display?: CommonDisplay;\n};\n\n/**\n * Preference center display information.\n * @typedef {object} CommonDisplay\n * @property {string} name\n * @property {?string} description\n */\nexport type CommonDisplay = {\n name: string;\n description?: string;\n};\n\nexport type Icon = {\n icon: string;\n};\n\nexport type IconDisplay = CommonDisplay & Partial<Icon>;\n\nexport interface ItemBase {\n type: unknown;\n id: string;\n display: CommonDisplay;\n conditions?: Condition[];\n}\n\n/**\n * A channel subscription item.\n * @typedef {object} ChannelSubscriptionItem\n * @memberof PreferenceCenter\n * @property {\"channel_subscription\"} type\n * @property {string} id the item identifier\n * @property {?CommonDisplay} display display information\n * @property {string} subscription_id the subscription list id\n */\nexport interface ChannelSubscriptionItem extends ItemBase {\n type: 'channel_subscription';\n subscription_id: string;\n}\n\nexport interface ContactSubscriptionGroupItem extends ItemBase {\n type: 'contact_subscription_group';\n id: string;\n subscription_id: string;\n components: ContactSubscriptionGroupItemComponent[];\n}\n\nexport interface ContactSubscriptionGroupItemComponent {\n scopes: SubscriptionScope[];\n display: Omit<CommonDisplay, 'description'>;\n}\n\nexport interface ContactSubscriptionItem extends ItemBase {\n type: 'contact_subscription';\n scopes: SubscriptionScope[];\n subscription_id: string;\n}\n\nexport interface AlertItem extends ItemBase {\n type: 'alert';\n display: IconDisplay;\n button?: Button;\n}\n\nexport interface ConditionBase {\n type: unknown;\n}\n\nexport interface NotificationOptInCondition extends ConditionBase {\n type: 'notification_opt_in';\n when_status: 'opt_in' | 'opt_out';\n}\n\nexport type Condition = NotificationOptInCondition;\n\n// Changed from `unknown` in spec\nexport type Actions = {\n [key: string]: JsonValue;\n};\n\nexport interface Button {\n text: string;\n content_description?: string;\n actions: Actions;\n}\n\nexport interface SectionBase {\n type: unknown;\n id: string;\n display?: CommonDisplay;\n items: Item[];\n}\n\n/**\n * @typedef {object} CommonSection\n * @memberof PreferenceCenter\n * @property {\"section\"} type\n * @property {string} id the section identifier\n * @property {?CommonDisplay} display display information\n * @property {Array<PreferenceCenter.ChannelSubscriptionItem>} items list of\n * section items\n */\nexport interface CommonSection extends SectionBase {\n type: 'section';\n}\n\nexport interface LabeledSectionBreak extends SectionBase {\n type: 'labeled_section_break';\n items: never;\n}\n\nexport type Item =\n | ChannelSubscriptionItem\n | ContactSubscriptionGroupItem\n | ContactSubscriptionItem\n | AlertItem;\n\nexport type Section = CommonSection | LabeledSectionBreak;\n\n/**\n * An interface representing the eligibility status of a flag, and optional\n * variables associated with the flag.\n */\nexport interface FeatureFlag {\n /**\n * A boolean representing flag eligibility; will be `true` if the current\n * contact is eligible for the flag.\n */\n readonly isEligible: boolean;\n /**\n * A variables associated with the flag, if any. Will be `null` if no data\n * is associated with the flag, or if the flag does not exist.\n */\n readonly variables: unknown | null;\n /**\n * A boolean representing if the flag exists or not. For ease of use and\n * deployment, asking for a flag by any name will return a `FeatureFlag`\n * interface, even if the flag was not found to exist. However this property\n * may be checked to determine if the flag was actually resolved to a known\n * flag name.\n */\n readonly exists: boolean;\n\n /**\n * Reporting Metadata, the shape of which is private and not to be relied\n * upon. When not provided, an interaction cannot be tracked on the flag.\n * @ignore\n */\n readonly _internal: unknown;\n}\n"]}
|
|
@@ -262,14 +262,8 @@ public class AirshipPlugin: CAPPlugin {
|
|
|
262
262
|
return try AirshipProxy.shared.push.isQuietTimeEnabled()
|
|
263
263
|
|
|
264
264
|
case "push#ios#setQuietTime":
|
|
265
|
-
let proxySettings: CodableQuietTimeSettings = try call.requireCodableArg()
|
|
266
265
|
try AirshipProxy.shared.push.setQuietTime(
|
|
267
|
-
|
|
268
|
-
startHour: proxySettings.startHour,
|
|
269
|
-
startMinute: proxySettings.startMinute,
|
|
270
|
-
endHour: proxySettings.endHour,
|
|
271
|
-
endMinute: proxySettings.endMinute
|
|
272
|
-
)
|
|
266
|
+
try call.requireCodableArg()
|
|
273
267
|
)
|
|
274
268
|
return nil
|
|
275
269
|
|
|
@@ -561,10 +555,3 @@ extension CAPPluginCall {
|
|
|
561
555
|
throw AirshipErrors.error("Argument must be a double")
|
|
562
556
|
}
|
|
563
557
|
}
|
|
564
|
-
|
|
565
|
-
public struct CodableQuietTimeSettings: Codable {
|
|
566
|
-
let startHour: UInt
|
|
567
|
-
let startMinute: UInt
|
|
568
|
-
let endHour: UInt
|
|
569
|
-
let endMinute: UInt
|
|
570
|
-
}
|