Skip to content

Commit d9e9a6d

Browse files
chvonrohrChristian von Rohr
andauthored
feat(urbanairship): Add attributes editing and fix tag editing (#4058)
Co-authored-by: Christian von Rohr <[email protected]>
1 parent 110b370 commit d9e9a6d

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

docs/plugins/urbanairship.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ $ npm install @awesome-cordova-plugins/urbanairship
77

88
## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/urbanairship/)
99

10-
Plugin Repo: [https://www.npmjs.com/package/urbanairship-cordova](https://www.npmjs.com/package/urbanairship-cordova)
10+
Plugin Repo: [https://github.com/urbanairship/urbanairship-cordova](https://github.com/urbanairship/urbanairship-cordova)
11+
12+
Npm: [https://www.npmjs.com/package/urbanairship-cordova](https://www.npmjs.com/package/urbanairship-cordova)
1113

12-
This plugin does something
1314

1415
## Supported platforms
1516

1617
* Android
17-
* iOS
18+
* iOS
1819

src/@awesome-cordova-plugins/plugins/urbanairship/index.ts

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,22 @@ import { Injectable } from '@angular/core';
22
import { Plugin, Cordova, AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';
33
import { Observable } from 'rxjs';
44

5+
/**
6+
* Interface for UAirship Tag Editor
7+
*/
58
export interface TagGroupEditor {
6-
addTags(): void;
7-
removeTags(): void;
8-
apply(): void;
9+
addTags(tagGroup: string, tags: string[]): TagGroupEditor;
10+
removeTags(tagGroup: string, tags: string[]): TagGroupEditor;
11+
apply(success: () => void, failure: (message: string) => void): TagGroupEditor;
12+
}
13+
14+
/**
15+
* Interface for UAirship Attributes Editor
16+
*/
17+
export interface AttributesEditor {
18+
setAttribute(name: string, value: string | number | boolean | Date): AttributesEditor;
19+
removeAttribute(name: string): AttributesEditor;
20+
apply(success: () => void, failure: (message: string) => void): AttributesEditor;
921
}
1022

1123
/**
@@ -214,6 +226,7 @@ export class UrbanAirShip extends AwesomeCordovaNativePlugin {
214226
* new config will not be used until the next app start.
215227
*
216228
* @param {object} config The Urban Airship config.
229+
* @param {string} config.site Sets the cloud site, must be either EU or US.
217230
* @param {object} config.development The Urban Airship development config.
218231
* @param {string} config.development.appKey The development appKey.
219232
* @param {string} config.development.appSecret The development appSecret.
@@ -538,24 +551,36 @@ export class UrbanAirShip extends AwesomeCordovaNativePlugin {
538551

539552
/**
540553
* Creates an editor to modify the named user tag groups.
541-
*
542-
* @returns {TagGroupEditor} A tag group editor instance.
543554
*/
544-
@Cordova()
555+
@Cordova({ sync: true })
545556
editNamedUserTagGroups(): TagGroupEditor {
546557
return;
547558
}
548559

549560
/**
550561
* Creates an editor to modify the channel tag groups.
551-
*
552-
* @returns {TagGroupEditor} A tag group editor instance.
553562
*/
554-
@Cordova()
563+
@Cordova({ sync: true })
555564
editChannelTagGroups(): TagGroupEditor {
556565
return;
557566
}
558567

568+
/**
569+
* Creates an editor to modify the channel attributes.
570+
*/
571+
@Cordova({ sync: true })
572+
editChannelAttributes(): AttributesEditor {
573+
return;
574+
}
575+
576+
/**
577+
* Creates an editor to modify the named user attributes.
578+
*/
579+
@Cordova({ sync: true })
580+
editNamedUserAttributes(): AttributesEditor {
581+
return;
582+
}
583+
559584
/**
560585
* Sets an associated identifier for the Connect data stream.
561586
*

0 commit comments

Comments
 (0)