d7laungani / dllocalnotifications Goto Github PK
View Code? Open in Web Editor NEW:speech_balloon: Easily create Local Notifications in swift - Wrapper of UserNotifications Framework
License: MIT License
:speech_balloon: Easily create Local Notifications in swift - Wrapper of UserNotifications Framework
License: MIT License
There's a crash when I call method:
scheduler.cancelNotification(notification:"Identifier")
Is there any demo or sample app for reference?
Hello!
Could you please add support of setting app icon badge?
Hi,
It's a fantastic library, but I want to schedule a notificacion every day at same hour. Is it possible?
Regards,
I have a question about the notification scheduling capabilities of this library. I'm trying to build out a calendar-type application that needs to schedule many notifications with custom repetition. I have a couple questions about this library.
1: Does this library still queue notifications after the app has been killed? e.g. do they persist if I queue the notification then kill the app and restart it?
2: Is there an easy way to do custom repeats? For example, if i want something to trigger on monday, tuesday, wednesday each week, is there an easy way to do that?
Thank you!
I have an issue installing this from the master branch.
When i run 'pod install' on the app with the line
pod 'DLLocalNotifications', '~>0.06'
in my podfile, I get the following line of code
content.sound = (notification.soundName == nil) ? UNNotificationSound.default() : UNNotificationSound.init(named: notification.soundName!)
However, I noticed that this is replaced by
content.sound = notification.soundName == "" ? UNNotificationSound.default : UNNotificationSound.init(named: UNNotificationSoundName(rawValue: notification.soundName))
in the actual code. Why would the pod install of mine have the wrong line of code in it?
I have 3 local notifications need to be repeated daily from (9am to 6pm with frequency of 3 hrs), I used repeatsFromToDate() but it didn't work.
Note:- There are 3 LocalNotification with the different startTime& endTime & user can stop/start any of these at anytime.
I need to repeat it 3-4 times a day till the user turns off the notification (ie., 10AM, 1PM, 4PM, 7PM today, tomorrow... ) - this is for notification1, similarly the app has 2 similar notifications (Notification2 might trigger at 9AM, 12PM, 3PM, 6PM today, tomorrow... Notification3- 4PM, 10PM today, tomorrow...). How to repeat them daily between these time intervals? Again user can't change the frequency, he could change the start & end time for each notifications or turn off.
Hello
i've got 2 warning when try to compile with XCode 15.0.1
'archiveRootObject(_:toFile:)' was deprecated in iOS 12.0: Use +archivedDataWithRootObject:requiringSecureCoding:error: and -writeToURL:options:error: instead
and
'unarchiveObject(withFile:)' was deprecated in iOS 12.0: Use +unarchivedObjectOfClass:fromData:error: instead
Do you plan to fix it ?
Thanks in advance
Im trying to show action buttons with the notification
` func dailyNotification(){
let firstNotification = DLNotification(identifier: "firstNotification", alertTitle: "Notificaiton Alert", alertBody: "You have successfully created a notification", date: Date(), repeats: .Minute)
// You can now change the repeat interval here
firstNotification.repeatInterval = .Minute
// You can add a launch image name
firstNotification.launchImageName = "logo_ad.jpg"
let scheduler = DLNotificationScheduler()
let standingCategory = DLCategory(categoryIdentifier: "standingReminder")
standingCategory.addActionButton(identifier: "willStand", title: "Ok, got it")
standingCategory.addActionButton(identifier: "willNotStand", title: "Cannot")
scheduler.scheduleCategories(categories: [standingCategory])
scheduler.scheduleNotification(notification: firstNotification)
firstNotification.category = "standingReminder"
}`
any reason why this isnt working
thank you
podspec deployment target 10.0,
It is possible to fix?
I want to repeat every day except weekend.
Regards,
when i schedule notifications with from date and to date with repeat interval minute, it is not start firing notification at from date instead it start immediately.
Crash at:
by following code
let notification = DLNotification(identifier: "", alertTitle: "", alertBody: "", date: nil, repeats: .none, soundName: "")
let scheduler = DLNotificationScheduler()
scheduler.scheduleNotification(notification: notification)
scheduler.scheduleAllNotifications()
where to call "scheduleAllNotifications()" ?
looks like you have update code but not the readme section please update it
I noticed that the identifier
field in DLNotification was made private in the latest merge from master. Is it possible to make it public again? Some of my functionality depends on having the identifier.
Can you please fix the issue of delayed notifications firing immediately.. are you aware of that?
i want to fire notification between specific time but interval is 2/3 seconds not 10/15 seconds so i do following changes but it will not work , not fire notification on perfect start time time.
let scheduler = DLNotificationScheduler()
scheduler.repeatsFromToDate(identifier: "First Notification", alertTitle: "Multiple Notifications", alertBody: "Progress", fromDate: Date(), toDate: Date().addingTimeInterval(300) , interval: 10, repeats: .none )
scheduler.scheduleAllNotifications()
Could be added support for handling ios9 and ios10 in different way with the same API?
let scheduler = DLNotificationScheduler() let standingCategory = DLCategory(categoryIdentifier: "standingReminder") standingCategory.addActionButton(identifier: "willStand", title: "Ok, got it") standingCategory.addActionButton(identifier: "willNotStand", title: "Cannot") scheduler.scheduleCategories(categories: [standingCategory])
getting the following error
fatal error: unexpectedly found nil while unwrapping an Optional value
2017-03-12 14:24:09.727084 fatal error: unexpectedly found nil while unwrapping an Optional value
any suggestions please
I don't see support for scheduling such kind of notification i.e. that repeats only when a specific time passes. The problem is that the schedule fires immediately without waiting for the exact time although repeats correctly.
e.g. here is the code for scheduling a repeating notification after 10 minutes. This doesn't wait for the 10 minutes - fires immediately in the next minute from now.
let triggerDate = Date().addingTimeInterval(600)
let firstNotification = DLNotification(identifier: "firstNotification", alertTitle: "Notification Alert", alertBody: "You have successfully created a notification", date: triggerDate, repeats: .Minute)
let scheduler = DLNotificationScheduler()
scheduler.scheduleNotification(notification: firstNotification)
here is another block of code for a repeating notification that will fire daily after 3 days.
let triggerDate = Date().addingTimeInterval(3*24*60*60)
let firstNotification = DLNotification(identifier: "firstNotification", alertTitle: "Notification Alert", alertBody: "You have successfully created a notification", date: triggerDate, repeats: .Daily)
let scheduler = DLNotificationScheduler()
scheduler.scheduleNotification(notification: firstNotification)`
This also doesn't wait for the 3 days but fires immediately on the next day.
The main problem in both is that it ignores the time till which it should wait to start firing the notification. If anybody has understood the problem, will you take some time to figure out what's wrong. I will be really thankful.
Hi,
I would like to add an image on the localnotification but i've got this error:
'launchImageName' is inaccessible due to 'internal' protection level
Can you help me to fix it please ?
Thanks in advance
I use .hourly schedule and when I getPendingNotificationRequests, says dd-mm-yyyy 00:00:00.
Seems that It's scheduled for midnight.
Why?
Hi,
Can you add SPM support?
Thanks
Is it possible to detect push-notification arrival?
I want to set a repeat Local notification from date. For Example:
StartDate: 26-July-2022
Todays Date: 23-July-2022
I am stuck here. I want to set a repeat Local notification from date.
Please have a look to my Notification function:
func scheduleLocalNotification(date: Date) {
var calendar = Calendar.current
calendar.timeZone = TimeZone.current
let content = UNMutableNotificationContent()
// Configure Notification Content
content.title = "REMINDER For Yoga"
content.body = "Hi! Take ready for Daily Yoga Class."
// Set Category Identifier
content.categoryIdentifier = "Yoga_872"
var components = calendar.dateComponents([.hour, .minute], from: date)
let trigger = UNCalendarNotificationTrigger(dateMatching: components, repeats: true)
// Create Notification Request
let identifier = "Yoga_Class(222)"
let notificationRequest = UNNotificationRequest(identifier: identifier, content: content, trigger: trigger)
// Add Request to User Notification Center
UNUserNotificationCenter.current().add(notificationRequest) { (error) in
if let error = error {
print("Add Notification Request Error: (\(error), \(error.localizedDescription))")
}
}
}
This function fire notification from Today. I want to this from 26th July 2022.
Unable to add userInfo data into the notification.
After scheduling multiple notifications using the method scheduler.repeatsFromToDate (repeats between start & end time) , i cant stop a particular notification.
Requirement:-1. Start multiple notifications(one at a time) with the changeable start time, end time & range.
2. stop a particular notification.
Could you help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.