Giter VIP home page Giter VIP logo

Comments (8)

upvalue avatar upvalue commented on August 25, 2024

Not intended, no. I have been using this to deliver notifications only, so it didn't occur to me to do that. I will see about adding an option to do that, possibly this week if I have time.

Thanks for letting me know.

from react-native-alarms.

juanamd avatar juanamd commented on August 25, 2024

Oh, ok. I'm just getting started with React Native so was pulling my hair trying to understand why it failed haha.

Just to also let you know: If I set the alarm and close the app, then a couple of seconds after it should fire, an android message error appears instead. Something like "Unfortunately app name has stopped".

Thanks for the quick reply.

from react-native-alarms.

upvalue avatar upvalue commented on August 25, 2024

Alright, will look into that as well. Thanks.

Have you considered using react-native-push-notifications? Sending a notification when the alarm triggers will probably be more in line with what Android users expect, and if they click on any notification from your app, it'll open it.

I am not super familiar with Android or RN myself (was just writing this because I needed it), but my understanding is that WAKEUP refers to an alarm firing after the device has gone idle.

from react-native-alarms.

juanamd avatar juanamd commented on August 25, 2024

Im building an alarm clock app and would like to offer a custom snooze screen, that's why the push notification approach is not ideal imo.
And yes, I also wondered about the meaning of waking up the device (does it mean just start the app in the background or actually bringing it to the foreground?) but i found a stackoverflow topic about native android development where someone wanted to use RTC_WAKEUP without opening the app, so I deduce that opening the app is the default behaviour.

from react-native-alarms.

upvalue avatar upvalue commented on August 25, 2024

Juan, I've changed things around a bit and tried to make the interface less hairy (see the README). The only breaking change (I think!) is that BootLauncher will no longer launch the app, rather it'll fire a @ boot event which can be used to restore alarms across device boots without launching the app.

I've added a launchMainActivity() method which should provide the functionality you want. You should call it when your alarm event fires.

I think I've fixed the crash issue.

Let me know if this works for you.

from react-native-alarms.

juanamd avatar juanamd commented on August 25, 2024

Ok, i'll test this version and report back.
Thanks so much for the quick support and replies!

from react-native-alarms.

juanamd avatar juanamd commented on August 25, 2024

So I tested it, and it works beautifully, except if I close the app. Then the event callback is never fired. Is there something to be done about this use case?

from react-native-alarms.

upvalue avatar upvalue commented on August 25, 2024

I think we're at the limit of what can be done with alarms here. Sorry about the misleading note -- it does seem like they keep firing within a couple seconds of closing, which is why it was crashing, but I don't think they will actually persist for long.

from react-native-alarms.

Related Issues (5)

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.