mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-22 19:57:51 +08:00
[notifications] Add enableLights and enableVibration to AndroidChannel
This commit is contained in:
@@ -12,10 +12,12 @@ type NativeAndroidChannel = {|
|
||||
group?: string,
|
||||
importance: ImportanceType,
|
||||
lightColor?: string,
|
||||
lightsEnabled?: boolean,
|
||||
lockScreenVisibility?: VisibilityType,
|
||||
name: string,
|
||||
showBadge?: boolean,
|
||||
sound?: string,
|
||||
vibrationEnabled?: boolean,
|
||||
vibrationPattern?: number[],
|
||||
|};
|
||||
|
||||
@@ -26,10 +28,12 @@ export default class AndroidChannel {
|
||||
_group: string | void;
|
||||
_importance: ImportanceType;
|
||||
_lightColor: string | void;
|
||||
_lightsEnabled: boolean | void;
|
||||
_lockScreenVisibility: VisibilityType;
|
||||
_name: string;
|
||||
_showBadge: boolean | void;
|
||||
_sound: string | void;
|
||||
_vibrationEnabled: boolean | void;
|
||||
_vibrationPattern: number[] | void;
|
||||
|
||||
constructor(channelId: string, name: string, importance: ImportanceType) {
|
||||
@@ -65,6 +69,10 @@ export default class AndroidChannel {
|
||||
return this._lightColor;
|
||||
}
|
||||
|
||||
get lightsEnabled(): ?boolean {
|
||||
return this._lightsEnabled;
|
||||
}
|
||||
|
||||
get lockScreenVisibility(): ?VisibilityType {
|
||||
return this._lockScreenVisibility;
|
||||
}
|
||||
@@ -81,10 +89,34 @@ export default class AndroidChannel {
|
||||
return this._sound;
|
||||
}
|
||||
|
||||
get vibrationEnabled(): ?boolean {
|
||||
return this._vibrationEnabled;
|
||||
}
|
||||
|
||||
get vibrationPattern(): ?(number[]) {
|
||||
return this._vibrationPattern;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param lightsEnabled
|
||||
* @returns {AndroidChannel}
|
||||
*/
|
||||
enableLights(lightsEnabled: boolean): AndroidChannel {
|
||||
this._lightsEnabled = lightsEnabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param vibrationEnabled
|
||||
* @returns {AndroidChannel}
|
||||
*/
|
||||
enableVibration(vibrationEnabled: boolean): AndroidChannel {
|
||||
this._vibrationEnabled = vibrationEnabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param bypassDnd
|
||||
@@ -188,10 +220,12 @@ export default class AndroidChannel {
|
||||
group: this._group,
|
||||
importance: this._importance,
|
||||
lightColor: this._lightColor,
|
||||
lightsEnabled: this._lightsEnabled,
|
||||
lockScreenVisibility: this._lockScreenVisibility,
|
||||
name: this._name,
|
||||
showBadge: this._showBadge,
|
||||
sound: this._sound,
|
||||
vibrationEnabled: this._vibrationEnabled,
|
||||
vibrationPattern: this._vibrationPattern,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user