feat(urbanairship): Add attributes editing and fix tag editing (#4058)

Co-authored-by: Christian von Rohr <christian.vonrohr@well.ch>
This commit is contained in:
Christian von Rohr 2022-03-03 15:27:47 +01:00 committed by GitHub
parent 110b370003
commit d9e9a6d31a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 12 deletions

View File

@ -7,12 +7,13 @@ $ npm install @awesome-cordova-plugins/urbanairship
## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/urbanairship/) ## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/urbanairship/)
Plugin Repo: [https://www.npmjs.com/package/urbanairship-cordova](https://www.npmjs.com/package/urbanairship-cordova) Plugin Repo: [https://github.com/urbanairship/urbanairship-cordova](https://github.com/urbanairship/urbanairship-cordova)
Npm: [https://www.npmjs.com/package/urbanairship-cordova](https://www.npmjs.com/package/urbanairship-cordova)
This plugin does something
## Supported platforms ## Supported platforms
* Android * Android
* iOS * iOS

View File

@ -2,10 +2,22 @@ import { Injectable } from '@angular/core';
import { Plugin, Cordova, AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core'; import { Plugin, Cordova, AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
/**
* Interface for UAirship Tag Editor
*/
export interface TagGroupEditor { export interface TagGroupEditor {
addTags(): void; addTags(tagGroup: string, tags: string[]): TagGroupEditor;
removeTags(): void; removeTags(tagGroup: string, tags: string[]): TagGroupEditor;
apply(): void; apply(success: () => void, failure: (message: string) => void): TagGroupEditor;
}
/**
* Interface for UAirship Attributes Editor
*/
export interface AttributesEditor {
setAttribute(name: string, value: string | number | boolean | Date): AttributesEditor;
removeAttribute(name: string): AttributesEditor;
apply(success: () => void, failure: (message: string) => void): AttributesEditor;
} }
/** /**
@ -214,6 +226,7 @@ export class UrbanAirShip extends AwesomeCordovaNativePlugin {
* new config will not be used until the next app start. * new config will not be used until the next app start.
* *
* @param {object} config The Urban Airship config. * @param {object} config The Urban Airship config.
* @param {string} config.site Sets the cloud site, must be either EU or US.
* @param {object} config.development The Urban Airship development config. * @param {object} config.development The Urban Airship development config.
* @param {string} config.development.appKey The development appKey. * @param {string} config.development.appKey The development appKey.
* @param {string} config.development.appSecret The development appSecret. * @param {string} config.development.appSecret The development appSecret.
@ -538,24 +551,36 @@ export class UrbanAirShip extends AwesomeCordovaNativePlugin {
/** /**
* Creates an editor to modify the named user tag groups. * Creates an editor to modify the named user tag groups.
*
* @returns {TagGroupEditor} A tag group editor instance.
*/ */
@Cordova() @Cordova({ sync: true })
editNamedUserTagGroups(): TagGroupEditor { editNamedUserTagGroups(): TagGroupEditor {
return; return;
} }
/** /**
* Creates an editor to modify the channel tag groups. * Creates an editor to modify the channel tag groups.
*
* @returns {TagGroupEditor} A tag group editor instance.
*/ */
@Cordova() @Cordova({ sync: true })
editChannelTagGroups(): TagGroupEditor { editChannelTagGroups(): TagGroupEditor {
return; return;
} }
/**
* Creates an editor to modify the channel attributes.
*/
@Cordova({ sync: true })
editChannelAttributes(): AttributesEditor {
return;
}
/**
* Creates an editor to modify the named user attributes.
*/
@Cordova({ sync: true })
editNamedUserAttributes(): AttributesEditor {
return;
}
/** /**
* Sets an associated identifier for the Connect data stream. * Sets an associated identifier for the Connect data stream.
* *