Closed ReZuBaa closed 9 months ago
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
There is a reminder in the application, when I set the reminder, notifications in Android 12 version send a reminder notification while the program is running in the background. However, if the program is closed, the notification does not come. I tested the application on Android 10 11 12 13 14. I only encounter this problem on Android 12. What could be the reason? Thank you in advance for your help.
react native 0.71.7 @notifee/react-native": "7.8.2"
available codes :
import React, { forwardRef, memo, useCallback,useState, useEffect } from 'react' import { Text, View,TextInput,Platform,Button ,TouchableOpacity} from 'react-native' import DateTimePicker from '@react-native-community/datetimepicker'; import notifee, { TimestampTrigger, TriggerType,AndroidImportance, AndroidNotificationSetting } from '@notifee/react-native'; import { AlarmSvg } from '@/Assets/Svg' import { Post,ShareType, Story} from '@/Models' import { AppFonts, Colors,screenHeight, XStyleSheet } from '@/Theme' import { isAndroid, isIOS } from '@/Utils' import { homeStore, diaLogStore} from '@/Stores' import { showMessage, hideMessage } from "react-native-flash-message"; import { useLocalObservable } from 'mobx-react-lite' import { useTranslation } from 'react-i18next' import { KeyboardSpacer} from '.' import AppBottomSheet from './AppBottomSheet' import Box from './Box' import { screenWidth } from '../Theme';
interface ShareBottomSheetProps { lengi:number data: Post & Story type: ShareType onClose: (leng:number) => void page:string }
const ReminderComponent = forwardRef( ({page="", lengi,data, onClose, type = ShareType.Post }: ShareBottomSheetProps, ref) => {
const getdata = () => { let tt = ""; let tt1 = "";
};
const state = useLocalObservable(() => ({
})) const _onClose = useCallback(() => {
}, [])
const cancelDelete =useCallback( async(notificationId:string) =>{ diaLogStore.showDiaLog({ title: t("createPost.delete_Create_Reminder"),
}, [])
const AlarmMessage=(type:string,deleteR:boolean=false) =>{ const message=type=="1"?t("createPost.alarm"):t("createPost.alarm") const description=type=="1"?t("createPost.alarm_ok"):t("createPost.alarmnot") showMessage({ message:message,// t("createPost.addtodetailTitle"), description:description,//t("createPost.addtodetail"), type:type=="1"?"success": "warning", icon:type=="1"? "success":"default", autoHide:true, onPress: () => { hideMessage()
// onLongPress:()=>{ } })} const onDateChange = (event, selectedDate) => { setShowDatePicker(Platform.OS === 'ios'); setShowDatePicker if (selectedDate) { setDate(selectedDate); setShowTimePicker(true); } }; const onTimeChange = (event, selectedTime) => { setShowTimePicker(Platform.OS === 'ios'); if (selectedTime) { setchange(true) setTime(selectedTime); } console.log("23232,burraa") getdata() }; const createNotification = async () => {
console.log(313) const channelId = await notifee.createChannel({ id: 'default', name: 'Default Channel', importance: AndroidImportance.HIGH,
};
const finalDateTimeR = new Date( date.getFullYear(), date.getMonth(), date.getDate(), time.getHours(), time.getMinutes() ); return ( <AppBottomSheet onClose={_onClose} index={0} snapPoints={[screenHeight - 150]} backgroundStyle={{ opacity: 0 }} handleIndicatorStyle={{ backgroundColor: Colors.white50 }} ref={ref}
<Text style={{fontWeight:"bold",color:change?"green":"black"}}>{change ? t("createPost.date_select")+
: ${date.toLocaleDateString()} ${time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit',hour12: false })}
:t("createPost.Date_Not_Selected") } {(finalDateTimeR.getTime()-new Date().getTime())<1*1000 && change && <Text style={{fontWeight:"500",color:"red"}}>{ t("createPost.alarmmesage") } } <View style={{alignContent:"center",flexDirection:"column",alignItems:"center"}}>); } )
export default memo( ReminderComponent)