Alarm Functionality In ReactNative For Android And iOS - react-native

I want to make app that play music every day at specific time (for example : 07:00) even if the app in background or turned off
I had done it in android with Java & Android SDK using Alarm Manager , i'm looking for something like that for ReactNative
I had searched for libraries but i did not found useful resources

check this out https://github.com/wmcmahan/react-native-calendar-events , The alarms associated with the calendar event, as an array of alarm objects.

Related

Detect New Day on watchOS While App Is Open

I'm currently working on my first watchOS app extension, which is based on Xcode's Multiplatform template. I'm looking for a solution that will allow me to detect a significant date change, such as the observation of midnight, when the watch app is open. However, I've been unable to find such a solution. I'd like to avoid using Timers, if possible.
I'm able to observe UIApplication.significantTimeChangeNotification (iOS) and Notification.Name.NSCalendarDayChanged (macOS), but I've not found a similar notification for watchOS. What I did find in the documentation for WKExtension are notifications that are similar to iOS app lifecycle notifications.
What I want is to update the UI of the watchOS app when it's open and a new day is observed, which UIApplication.significantTimeChangeNotification gets me on iOS. Is there a way for the watch app to observe a date change when the app is open on the watch?
You can use .NSCalendarDayChanged on watchOS as well:
NotificationCenter.default.addObserver(
self,
selector: #selector(dayChanged(_:)),
name: .NSCalendarDayChanged,
object: nil
)

React Native Bluetooth background scan

I'm trying to scan devices on IOS when the app is in background mode. I've learned that I have to tell explicitly what service ID I'm looking for. I was trying with 180F which is the battery service but it didn't find anything. Is it possible at all on IOS? It works well on Android.
I'm using the react-native-ble-manager package.
Can you tell me maybe a common service UUID what every phone advertises?
My aim is to track every contact with phones which are nearby me and it should work when the app is in background mode.

react native background geolocation

I have a requirement to save user's geolocation when react-native app is running in background. I know react-native-background-geolocation is available for this but I don't want to use any third party tool for this. Is there a way I can fetch users current location even if the app is running in the background?
With the last Expo SDK 32 you should be able to to it.
We’re excited to announce that this release includes initial support for background location, a highly requested feature from many Expo users. You can now define simple JavaScript tasks in your app and register them to receive location updates in the background. Additionally, you can set up geofencing tasks that are triggered when the device enters or leaves specific geographic regions

iOS 7 App Operations Running In Background; Saving a Video Recording In Background

I am currently trying to find the most efficient way to continue a method in the background of my app.
I am probably adding location/gps to my app soon, so I was considering using that flag to keep the app Active in the background. However, I do not want to add that flag yet because I want to post an App Update before I add the location functionality.
I know the exceptions;
Apps that play audible content to the user while in the background, such as a music player app
Apps that keep users informed of their location at all times, such as a navigation app
Apps that support Voice over Internet Protocol (VoIP)
Newsstand apps that need to download and process new content
Apps that receive regular updates from external accessories
Besides asking for a more generic idea then these ^, can someone explain the "external accessory" flag please? I am recording video from an outside device. However, I do not know what constitutes an "external accessory".
I also see that iOS7 has introduced new Multi-tasking functionality but I haven't seen any examples that I understand can someone also explain that? Maybe that is a viable solution?
Thanks in advance!

Is there any way to access an iTunes library to set an alarm tone?

Is there any way to access an iTunes library to set an alarm tone?
I am building an alarm app. I think we can can use local notifications when my app is in the background, but it can't play music library sounds. So when the app is in foreground, I want to play sounds from the music library and songs from my app bundle as well. How might I achieve this?
You can select the music libray of your device using the MPMusicPlayerController.
For this you need to include the MediaPlayer.framework framework and <MediaPlayer/MediaPlayer.h> header file.
You will get the picked music url using this delegate method (for this you need to add the MPMediaPickerControllerDelegate in #interface) :
- (void)mediaPicker: (MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection
{
}
Refer this tutorial for a detailed description.