я могу использовать реактивное уведомление о тревоге
любой другой параметр?
реактивное уведомление о тревоге, как правильно установить приложение в собственном приложении реакции
этот тип ошибки в response-native-alarm
1) TypeError: undefined не является объектом (оценивает 'RNAlarmNotification.scheduleAlarm')
code:
импортировать React из'act ';
импортировать ReactNativeAN из'act-native-alarm-messages';
const fireDate = ReactNativeAN.parseDate (new Date (Date.now () + 2000));
import {StyleSheet, KeyboardAvoidingView, Button, Text, View, Image,
TextInput, ActivityIndicator} из'act-native ';
const alarmNotifData = {id: "12345",
title: "My Notification Title",
message: "My Notification Message",
channel: "my_channel_id",
ticker: "My Notification Ticker", auto_cancel: true,
вибрация: правда, вибрация: 100,
small_icon: "ic_launcher",
large_icon: "ic_launcher ", play_sound: true, имя_звука: null,
цвет:" красный ", schedule_once: true,
тег: 'some_tag', fire_date: fireDate,
data: {foo:" bar "},};
export default class calendar extends React.Component {
constructor(props){
super(props);
const alarmNotifData = {
id: "12345", // Required
title: "My Notification Title", // Required
message: "My Notification Message", // Required
channel: "my_channel_id", // Required. Same id as specified in MainApplication's onCreate method
ticker: "My Notification Ticker",
auto_cancel: true, // default: true
vibrate: true,
vibration: 100, // default: 100, no vibration if vibrate: false
small_icon: "ic_launcher", // Required
large_icon: "ic_launcher",
play_sound: true,
sound_name: null, // Plays custom notification ringtone if sound_name: null
color: "red",
schedule_once: true, // Works with ReactNativeAN.scheduleAlarm so alarm fires once
tag: 'some_tag',
fire_date: fireDate, // Date for firing alarm, Required for ReactNativeAN.scheduleAlarm.
// You can add any additional data that is important for the notification
// It will be added to the PendingIntent along with the rest of the bundle.
// e.g.
data: { foo: "bar" },
};
this.state = {
data: alarmNotifData
}
}
componentDidMount() {
this.method();
}
method(){
ReactNativeAN.scheduleAlarm(this.state.data);
ReactNativeAN.deleteAlarm("12345");
ReactNativeAN.stopAlarm();
ReactNativeAN.sendNotification(this.state.data);
ReactNativeAN.getScheduledAlarms().then(this.state.data);
ReactNativeAN.removeAllFiredNotifications()
ReactNativeAN.removeFiredNotification("12345")
ReactNativeAN.cancelAllNotifications()
ReactNativeAN.cancelNotification("12345")
}