forked from Benjamin-Dobell/react-native-notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notification.android.js
62 lines (47 loc) · 1.02 KB
/
notification.android.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/** A wrapper to align Android with iOS in terms on notification structure and provide convenience methods. */
export default class NotificationAndroid {
constructor(properties) {
this.properties = properties;
}
isDataOnly() {
return this.getData() && Object.keys(this.properties).length === 1;
}
// Convenience accessors
getData() {
return this.properties.data;
}
getTitle() {
return this.properties.title;
}
getBody() {
return this.properties.body;
}
// Alias for getBody()
getMessage() {
return this.getBody();
}
getIcon() {
return this.properties.icon;
}
getSound() {
return this.properties.sound;
}
getTag() {
return this.properties.tag;
}
getColor() {
return this.properties.color;
}
getLargeIcon() {
return this.properties.largeIcon;
}
getLightsColor() {
return this.properties.lightsColor;
}
getLightsOnMs() {
return this.properties.lightsOnMs;
}
getLightsOffMs() {
return this.properties.lightsOffMs;
}
}