|
@@ -68,6 +68,14 @@ interface State {
|
68
|
68
|
notifications: NotificationsResponse;
|
69
|
69
|
}
|
70
|
70
|
|
|
71
|
+function getSettingString(setting: boolean | undefined) {
|
|
72
|
+ return setting
|
|
73
|
+ ? RESULTS.GRANTED
|
|
74
|
+ : setting === false
|
|
75
|
+ ? RESULTS.DENIED
|
|
76
|
+ : RESULTS.UNAVAILABLE;
|
|
77
|
+}
|
|
78
|
+
|
71
|
79
|
export default class App extends React.Component<{}, State> {
|
72
|
80
|
state: State = {
|
73
|
81
|
statuses: [],
|
|
@@ -91,15 +99,9 @@ export default class App extends React.Component<{}, State> {
|
91
|
99
|
|
92
|
100
|
render() {
|
93
|
101
|
const {notifications} = this.state;
|
|
102
|
+ const {settings} = notifications;
|
94
|
103
|
|
95
|
|
- const {
|
96
|
|
- alert,
|
97
|
|
- badge,
|
98
|
|
- sound,
|
99
|
|
- lockScreen,
|
100
|
|
- carPlay,
|
101
|
|
- critical,
|
102
|
|
- } = notifications.settings;
|
|
104
|
+ console.warn(settings);
|
103
|
105
|
|
104
|
106
|
return (
|
105
|
107
|
<View style={{flex: 1, backgroundColor: theme.colors.background}}>
|
|
@@ -167,53 +169,15 @@ export default class App extends React.Component<{}, State> {
|
167
|
169
|
</TouchableRipple>
|
168
|
170
|
|
169
|
171
|
<Text style={{margin: 15, marginTop: 0, color: '#777'}}>
|
170
|
|
- {`alert: ${
|
171
|
|
- alert
|
172
|
|
- ? RESULTS.GRANTED
|
173
|
|
- : alert === false
|
174
|
|
- ? RESULTS.DENIED
|
175
|
|
- : RESULTS.UNAVAILABLE
|
176
|
|
- }\n`}
|
177
|
|
-
|
178
|
|
- {`badge: ${
|
179
|
|
- badge
|
180
|
|
- ? RESULTS.GRANTED
|
181
|
|
- : badge === false
|
182
|
|
- ? RESULTS.DENIED
|
183
|
|
- : RESULTS.UNAVAILABLE
|
184
|
|
- }\n`}
|
185
|
|
-
|
186
|
|
- {`sound: ${
|
187
|
|
- sound
|
188
|
|
- ? RESULTS.GRANTED
|
189
|
|
- : sound === false
|
190
|
|
- ? RESULTS.DENIED
|
191
|
|
- : RESULTS.UNAVAILABLE
|
192
|
|
- }\n`}
|
193
|
|
-
|
194
|
|
- {`lockScreen: ${
|
195
|
|
- lockScreen
|
196
|
|
- ? RESULTS.GRANTED
|
197
|
|
- : lockScreen === false
|
198
|
|
- ? RESULTS.DENIED
|
199
|
|
- : RESULTS.UNAVAILABLE
|
200
|
|
- }\n`}
|
201
|
|
-
|
202
|
|
- {`carPlay: ${
|
203
|
|
- carPlay
|
204
|
|
- ? RESULTS.GRANTED
|
205
|
|
- : carPlay === false
|
206
|
|
- ? RESULTS.DENIED
|
207
|
|
- : RESULTS.UNAVAILABLE
|
208
|
|
- }\n`}
|
209
|
|
-
|
210
|
|
- {`critical: ${
|
211
|
|
- critical
|
212
|
|
- ? RESULTS.GRANTED
|
213
|
|
- : critical === false
|
214
|
|
- ? RESULTS.DENIED
|
215
|
|
- : RESULTS.UNAVAILABLE
|
216
|
|
- }\n`}
|
|
172
|
+ {`alert: ${getSettingString(settings.alert)}\n`}
|
|
173
|
+ {`badge: ${getSettingString(settings.badge)}\n`}
|
|
174
|
+ {`sound: ${getSettingString(settings.sound)}\n`}
|
|
175
|
+ {`lockScreen: ${getSettingString(settings.lockScreen)}\n`}
|
|
176
|
+ {`notificationCenter: ${getSettingString(
|
|
177
|
+ settings.notificationCenter,
|
|
178
|
+ )}\n`}
|
|
179
|
+ {`carPlay: ${getSettingString(settings.carPlay)}\n`}
|
|
180
|
+ {`criticalAlert: ${getSettingString(settings.criticalAlert)}\n`}
|
217
|
181
|
</Text>
|
218
|
182
|
</View>
|
219
|
183
|
);
|