Giter Club home page Giter Club logo

Comments (9)

wmcmahan avatar wmcmahan commented on June 27, 2024

Hi @blackPeanut, could you give an example of your code and the error if there is one? Thanks

from react-native-calendar-reminders.

blackPeanut avatar blackPeanut commented on June 27, 2024

Yep, sure. Here you go.
P.S. By the way, 'saveReminder event' didn't even dispatch if i uncomment recurrence;

import React, { Component, } from 'react';
import {
  View,
  TouchableHighlight,
  Text,
  NativeAppEventEmitter,
  StyleSheet,
} from 'react-native';

import RNCalendarReminders from 'react-native-calendar-reminders';

export default class Rem extends Component {
  constructor(props) {
    super(props);
  };//constructor

  handleAddReminder() {
    RNCalendarReminders.saveReminder('title', {
      location: 'location',
      notes: 'notes',
      startDate: '2017-10-01T09:45:00.000UTC',
      alarms: [{
        date: -1 // or absolute date
      }],
      //recurrence: 'daily'
    });
  }

  componentWillMount() {
    this.eventEmitter = NativeAppEventEmitter.addListener('remindersChanged', reminders => {
      console.log('REMINDERS OBJECT HAS BEEN CHANGED', reminders);
    });

    RNCalendarReminders.authorizeEventStore(({status}) => {
        console.log(status);
        status === 'denied' ? alert('Enable notifications') : null;
      });
  }//cwm

  componentWillUnmount () {
  this.eventEmitter.remove();
  }

  render() {
    return (
      <View style={styles.container}>
        <TouchableHighlight style={styles.btn} onPress={this.handleAddReminder}>
          <Text>Reminder</Text>
        </TouchableHighlight>
      </View>
    );//return
  };//render
};//class

const styles = StyleSheet.create({
  container: {
    paddingTop: 20,
    paddingBottom: 40,
  },
  btn: {
    width: 60,
    height: 20,
    backgroundColor: 'tomato',
  }
});

screen shot 2016-08-16 at 8 13 17 pm

from react-native-calendar-reminders.

wmcmahan avatar wmcmahan commented on June 27, 2024

Thanks. When setting a 'dueDate' and 'recurrence' it should put it in the "scheduled" reminders. Although, setting the alarm date to a relative time versus absolute time have different results. Neither seem to be throwing triggering the notification and i'm not exactly sure why.

from react-native-calendar-reminders.

blackPeanut avatar blackPeanut commented on June 27, 2024

@wmcmahan I've tried to set alarm time as absolute and relative. Have you succeed to run my example and put reminders in scheduled with any possible options?

P.S. Are you planning to fix this in nearest future? Or better to look through for other solution for now?

Thanks

from react-native-calendar-reminders.

wmcmahan avatar wmcmahan commented on June 27, 2024

Reminders should be marked as scheduled if they have a dueDate. ex:

RNCalendarReminders.saveReminder('title', {
  location: 'location',
  notes: 'notes',
  startDate: new Date('2017-10-01T09:45:00.000UTC'),
  dueDate: new Date('2017-10-01T09:46:00.000UTC'),
  alarms: [{
    date: new Date('2017-10-01T09:44:00.000UTC'),
  }],
  recurrence: 'daily'
});

I'm looking into the the notifications and why they might not get triggered when programmaticaly creating and alarm. Not sure if it is an ios issue or not. I will try to find a fix soon if its related to this code.

from react-native-calendar-reminders.

blackPeanut avatar blackPeanut commented on June 27, 2024

Yep, now I can add a notification to scheduled (seems it should be due date) but as you have mentioned (also recurrence stared to work) it doesn't trigger actually the alarm.

Thanks, no other solutions, except yours 😢

from react-native-calendar-reminders.

trustme217 avatar trustme217 commented on June 27, 2024

when I use that package for creating alarm, it works for creating new events on the calendar on the device, but Alarm does not work.
for exam

  1. Set Alarm at 1:50 PM
  2. Waited for this time AR no notifications or signals

here is my codebase

1111

screen shot 2017-12-08 at 08 49 08

from react-native-calendar-reminders.

MohdLucky avatar MohdLucky commented on June 27, 2024

hey,
please help me in reminder app in react native ios ,

from react-native-calendar-reminders.

trustme217 avatar trustme217 commented on June 27, 2024

from react-native-calendar-reminders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.