Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immediate notification works but Scheduling doesn't work #200

Open
prakhar-thecoder opened this issue Oct 18, 2023 · 1 comment
Open

Immediate notification works but Scheduling doesn't work #200

prakhar-thecoder opened this issue Oct 18, 2023 · 1 comment
Labels
bug fix later check issue later

Comments

@prakhar-thecoder
Copy link

prakhar-thecoder commented Oct 18, 2023

Hello,

when i use the send notification now method(), it works perfectly, but when using the scheduleAlarm method the alarm doesn't ring.
The app is in foreground completely

My code

`

import React, {useEffect, useState} from 'react';
import {FlatList, Text, TouchableOpacity, View} from 'react-native';

import ReactNativeAN from 'react-native-alarm-notification';

function App() {
  useEffect(() => {
    (async () => {
      const alarmNotifData = {
        title: 'My Notification Title',
        message: 'My Notification Message',
        channel: 'my_channel_id',
        small_icon: 'ic_launcher',

        // 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'},
      };

      try {
        const alarm = await ReactNativeAN.scheduleAlarm({
          ...alarmNotifData,
          fire_date: '18-10-2023 20:03:50',
        });
        console.log(alarm); // { id: 1 }
      } catch (e) {
        console.log(e);
      }
    })();
  }, []);
  return <Text>Hello!</Text>;
}

export default App;

`

@emekalites
Copy link
Owner

Hi, i believe the library needs a make-over. I have not had the time to work on this but I'm hoping to update/upgrade this library in the upcoming month. Hopefully this issue should be resolved by then.
Thanks.

@emekalites emekalites added bug fix later check issue later labels Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix later check issue later
Projects
None yet
Development

No branches or pull requests

2 participants