Skip to content

Commit 815d1bb

Browse files
authored
feat(urbanairship): add new methods: onDeepLink, onRegistration, onInboxUpdated, onShowInbox, onPushReceived, onNotificationOpened, onNotificationOptInStatus; fix return type for reattach method (#3705)
1 parent 0c505f9 commit 815d1bb

File tree

1 file changed

+136
-2
lines changed
  • src/@ionic-native/plugins/urbanairship

1 file changed

+136
-2
lines changed

src/@ionic-native/plugins/urbanairship/index.ts

Lines changed: 136 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Injectable } from '@angular/core';
22
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
3+
import { Observable } from 'rxjs';
34

45
export interface TagGroupEditor {
56
addTags(): void;
@@ -62,11 +63,144 @@ export enum PresentationOptions {
6263
})
6364
@Injectable()
6465
export class UrbanAirShip extends IonicNativePlugin {
66+
/**
67+
* Event fired when a new deep link is received.
68+
*
69+
* @event deep_link
70+
* @type {object}
71+
* @param {string} [deepLink] The deep link.
72+
*/
73+
@Cordova({
74+
eventObservable: true,
75+
event: 'urbanairship.deep_link',
76+
element: 'document',
77+
})
78+
onDeepLink(): Observable<any> {
79+
return;
80+
}
81+
82+
/**
83+
* Event fired when a channel registration occurs.
84+
*
85+
* @event registration
86+
* @type {object}
87+
* @param {string} [channelID] The channel ID.
88+
* @param {string} [registrationToken] The deviceToken on iOS, and the FCM/ADM token on Android.
89+
* @param {string} [error] Error message if an error occurred.
90+
*/
91+
@Cordova({
92+
eventObservable: true,
93+
event: 'urbanairship.registration',
94+
element: 'document',
95+
})
96+
onRegistration(): Observable<any> {
97+
return;
98+
}
99+
100+
/**
101+
* Event fired when the inbox is updated.
102+
*
103+
* @event inbox_updated
104+
*/
105+
@Cordova({
106+
eventObservable: true,
107+
event: 'urbanairship.inbox_updated',
108+
element: 'document',
109+
})
110+
onInboxUpdated(): Observable<any> {
111+
return;
112+
}
113+
114+
/**
115+
* Event fired when the inbox needs to be displayed. This event is only emitted if auto
116+
* launch message center is disabled.
117+
*
118+
* @event show_inbox
119+
* @type {object}
120+
* @param {string} [messageId] The optional message ID.
121+
*/
122+
@Cordova({
123+
eventObservable: true,
124+
event: 'urbanairship.show_inbox',
125+
element: 'document',
126+
})
127+
onShowInbox(): Observable<any> {
128+
return;
129+
}
130+
131+
/**
132+
* Event fired when a push is received.
133+
*
134+
* @event push
135+
* @type {object}
136+
* @param {string} message The push alert message.
137+
* @param {string} title The push title.
138+
* @param {string} subtitle The push subtitle.
139+
* @param {object} extras Any push extras.
140+
* @param {object} aps The raw aps dictionary (iOS only)
141+
* @param {number} [notification_id] The Android notification ID. Deprecated in favor of notificationId.
142+
* @param {string} [notificationId] The notification ID.
143+
*/
144+
@Cordova({
145+
eventObservable: true,
146+
event: 'urbanairship.push',
147+
element: 'document',
148+
})
149+
onPushReceived(): Observable<any> {
150+
return;
151+
}
152+
153+
/**
154+
* Event fired when notification opened.
155+
*
156+
* @event notification_opened
157+
* @type {object}
158+
* @param {string} message The push alert message.
159+
* @param {object} extras Any push extras.
160+
* @param {number} [notification_id] The Android notification ID. Deprecated in favor of notificationId.
161+
* @param {string} [notificationId] The notification ID.
162+
* @param {string} [actionID] The ID of the notification action button if available.
163+
* @param {boolean} isForeground Will always be true if the user taps the main notification. Otherwise its defined by the notification action button.
164+
*/
165+
@Cordova({
166+
eventObservable: true,
167+
event: 'urbanairship.notification_opened',
168+
element: 'document',
169+
})
170+
onNotificationOpened(): Observable<any> {
171+
return;
172+
}
173+
174+
/**
175+
* Event fired when the user notification opt-in status changes.
176+
*
177+
* @event notification_opt_in_status
178+
* @type {object}
179+
* @param {boolean} optIn If the user is opted in or not to user notifications.
180+
* @param {object} [authorizedNotificationSettings] iOS only. A map of authorized settings.
181+
* @param {boolean} authorizedNotificationSettings.alert If alerts are authorized.
182+
* @param {boolean} authorizedNotificationSettings.sound If sounds are authorized.
183+
* @param {boolean} authorizedNotificationSettings.badge If badges are authorized.
184+
* @param {boolean} authorizedNotificationSettings.carPlay If car play is authorized.
185+
* @param {boolean} authorizedNotificationSettings.lockScreen If the lock screen is authorized.
186+
* @param {boolean} authorizedNotificationSettings.notificationCenter If the notification center is authorized.
187+
*/
188+
@Cordova({
189+
eventObservable: true,
190+
event: 'urbanairship.notification_opt_in_status',
191+
element: 'document',
192+
})
193+
onNotificationOptInStatus(): Observable<any> {
194+
return;
195+
}
196+
65197
/**
66198
* Re-attaches document event listeners in this webview
67199
*/
68-
@Cordova()
69-
reattach(): Promise<any> {
200+
@Cordova({
201+
sync: true,
202+
})
203+
reattach(): void {
70204
return;
71205
}
72206

0 commit comments

Comments
 (0)