Hi everyone, Very special thanks to Nick. I am following his videos for two weeks and gained experience like studying for 2 months! I am trying to update the "repeatNumber" value that I created in a struct. struct ItemModel: Identifiable, Codable { let id: String let title: String let detail: String let isCompleted: Bool let repeatNumber: Int //
Nick lemme tell you something. Your SwiftfulThinking RUclips channel should be the most recommended channel for the Swift UI on the whole RUclips.❤️❤️❤️
Hi, thanks for the video. Now how do you execute some code when a user clicks on a notification? All the tutorials I can find are old and use AppDelegate functions that I don't know where to put in the SwiftUI structure. Would be happy if you could give even some advice.
Hello! Thanks for the tutorial, however I’ve got a question. How would I execute code at a specific time every day. For example, I want to reset an isCompleted variable daily, how would I go around and implementing this. Thank you for your time.
Hello, thank you for the tutorial it was really helpful.But I was just trying to figure out how to schedule a notification at three different times a day. Or if I could schedule it for 9 am and make it repeat every 5 hours?
Hi, Nick! Your videos are awesome! But i got some problem with badge remove. onAppear block loads only once (at first launch time). If you get notification, get 1 new badge and open your application - onAppear will not work, because it did at 1st launch time.
Hey Nick!! How to perfrom an action along with notification like when ever the notification triggers i need to perform some action at the same time.Can you please help me how to do it?
Hi, Thanks for this tutorial, it works Wally great. I was wondering if you could help ...How do I list all the notifications received in a View with swiftUI? Thanks heaps.
within the completion handler we must used [weak self] if we are using a reference to the class notificationManager? for example class NotificationManager { static let shared = NotificationManager() var isNotification: Bool = false func requestAuthorization() { let options = UNAuthorizationOptions([.alert, .badge, .sound]) UNUserNotificationCenter.current().requestAuthorization(options: options) { [weak self] success, error in if success { self?.isNotification = success // reference } else { print("error: \(String(describing: error?.localizedDescription))") } } } }
Hello Nick, thanks for super tutorial. If I can ask You, would You be so kind and explain, how to increase number on app icon for example when You will receive more than 1 notification?
Hi Charlie / Romesh.. great question! I should have touched on this in the video. It's actually a bit tricky. The problem is that we need to declare the badge number at the time that we schedule all of these local notifications. So the simple answer is that you could manually change the badge from 1 to 2 to 3 for each of the notifications. Alternatively, if your schedule a single notification and you want it to have a badge of 1 higher than the current badge, you could use NSNumber(value: UIApplication.shared.applicationIconBadgeNumber + 1). Again this is only +1 from the current value.
So the more complex answer is that you could give the notifications custom IDs (which we did not do in the video) and if a user opens a notification, then track down that ID and reschedule all of the future notifications with updated badges.... I might do a video on this in the future, but in most cases, these local notifications are generic (not specific to the user) and are usually all sent with no badge or a badge of 1.
Notifications that usually increment the badge are the real push notifications, like a new comment or like on a post. When scheduling these there's a whole different process that we use (usually an external service too) that will take care of the incrementing for us. That of course is not covered in this video and is pretty advanced. I'll be doing that in upcoming courses!
@@SwiftfulThinking Hi Nick, thank You for very complex answer. To be honest, I do not know, how increase number of badges on icon when notification come on device. The app is in background at this moment. Maybe you can extend Your ToDo project with notifications in the future. I am new in SwiftUI and I have to see exact example to understand.
Hello, thank you very much for sharing your knowledge, I have a question, in no part of the code I see that authorization is requested for geolocation, please help with that in how to include that authorization with the code you taught
Hi Nick, Good evening, hope you are doing well, and keeping safe from covid, can you please make a video on server/remote push notification in swiftUI framework, Regards Ankit
Thanks for the video! Super helpful, just a question or two -- how do you view the simulator device's home page on canvas (what to click on the keyboard for it to show up when running?) Also, is there some way to let the user select the date/time of notifications instead of hard-coding it in the way we did in this video?
Hey Demetri, you can use CMD + K to open the Keyboard on a simulator. And yea, you can build a UI for users to input their date/time and then run these same functions. Obviously you will need to make the date/time parameters.
Certainly the best video on SwiftUI notifs I’ve seen so far, definitely going to help out on this project I’m starting
Hi everyone,
Very special thanks to Nick. I am following his videos for two weeks and gained experience like studying for 2 months!
I am trying to update the "repeatNumber" value that I created in a struct.
struct ItemModel: Identifiable, Codable {
let id: String
let title: String
let detail: String
let isCompleted: Bool
let repeatNumber: Int //
Thanks for this and the explanation about incrementing the badge number. Very helpful ... as are all of your videos.
Thanks for watching Richard!
Nick lemme tell you something. Your SwiftfulThinking RUclips channel should be the most recommended channel for the Swift UI on the whole RUclips.❤️❤️❤️
Thanks for the hard work put on these videos. I hope that you keep it up 😉
Great video about local notification, indeed worth of time to watch it.
Hi, thanks for the video. Now how do you execute some code when a user clicks on a notification?
All the tutorials I can find are old and use AppDelegate functions that I don't know where to put in the SwiftUI structure. Would be happy if you could give even some advice.
This video is so helpful! I love Swiftful Thinking!
Thanks Amy!!
Brilliant.. so helpful ! thank you.. keep them coming..
Hello! Thanks for the tutorial, however I’ve got a question. How would I execute code at a specific time every day. For example, I want to reset an isCompleted variable daily, how would I go around and implementing this. Thank you for your time.
You're probably better off resetting the variable when a user opens the app. Check the current time against the specific time and then reset!
Hello, thank you for the tutorial it was really helpful.But I was just trying to figure out how to schedule a notification at three different times a day. Or if I could schedule it for 9 am and make it repeat every 5 hours?
Thanks for this and the explanation ,your videos are Very helpful . My doubt was can we localized notification in app side
Your content is great. 💯
Hi, Nick! Your videos are awesome! But i got some problem with badge remove.
onAppear block loads only once (at first launch time). If you get notification, get 1 new badge and open your application - onAppear will not work, because it did at 1st launch time.
You can use an environment value called "scenePhase" and .onChange() closure.
It worked for me
@Environment(\.scenePhase) var scenePhase
.onChange(of: scenePhase) {
UNUserNotificationCenter.current().setBadgeCount(0)
}
Perfect explanation! Thaks a million
Excellent session!!!!
Hey Nick!! How to perfrom an action along with notification like when ever the notification triggers i need to perform some action at the same time.Can you please help me how to do it?
amazing, love it!
Hi, Thanks for this tutorial, it works Wally great. I was wondering if you could help ...How do I list all the notifications received in a View with swiftUI? Thanks heaps.
within the completion handler we must used [weak self] if we are using a reference to the class notificationManager? for example
class NotificationManager {
static let shared = NotificationManager()
var isNotification: Bool = false
func requestAuthorization() {
let options = UNAuthorizationOptions([.alert, .badge, .sound])
UNUserNotificationCenter.current().requestAuthorization(options: options) { [weak self] success, error in
if success {
self?.isNotification = success // reference
} else {
print("error: \(String(describing: error?.localizedDescription))")
}
}
}
}
IOS 17 deprecated : UIApplication.shared.applicationIconBadgeNumber
UNUserNotificationCenter.current().setBadgeCount(0)
Hello Nick, thanks for super tutorial. If I can ask You, would You be so kind and explain, how to increase number on app icon for example when You will receive more than 1 notification?
I follow question too...
Hi Charlie / Romesh.. great question! I should have touched on this in the video. It's actually a bit tricky. The problem is that we need to declare the badge number at the time that we schedule all of these local notifications. So the simple answer is that you could manually change the badge from 1 to 2 to 3 for each of the notifications. Alternatively, if your schedule a single notification and you want it to have a badge of 1 higher than the current badge, you could use NSNumber(value: UIApplication.shared.applicationIconBadgeNumber + 1). Again this is only +1 from the current value.
So the more complex answer is that you could give the notifications custom IDs (which we did not do in the video) and if a user opens a notification, then track down that ID and reschedule all of the future notifications with updated badges.... I might do a video on this in the future, but in most cases, these local notifications are generic (not specific to the user) and are usually all sent with no badge or a badge of 1.
Notifications that usually increment the badge are the real push notifications, like a new comment or like on a post. When scheduling these there's a whole different process that we use (usually an external service too) that will take care of the incrementing for us. That of course is not covered in this video and is pretty advanced. I'll be doing that in upcoming courses!
@@SwiftfulThinking Hi Nick, thank You for very complex answer. To be honest, I do not know, how increase number of badges on icon when notification come on device. The app is in background at this moment. Maybe you can extend Your ToDo project with notifications in the future. I am new in SwiftUI and I have to see exact example to understand.
Hello, thank you very much for sharing your knowledge, I have a question, in no part of the code I see that authorization is requested for geolocation, please help with that in how to include that authorization with the code you taught
Hi Daniel, I have not covered MapKit and managing user's location yet. I will be covering it in an upcoming series. Sorry for the wait!
@@SwiftfulThinking I was trying to do this with my phone today..... 😂😂😂 Looking forward to this! 😎✌
Great video, youre a life saver mate
Good lesson.... thank you
Thanks Andrej!
Very helpful.. Thanks nick...
Hi Nick,
Good evening, hope you are doing well, and keeping safe from covid,
can you please make a video on server/remote push notification in swiftUI framework,
Regards
Ankit
I'll be doing this with CloudKit soon!
Thank you so much!
Could you please make a video about remote push notification
Is it okay use it deppend it weather ?
You should try teaching rocket engineering. Space X will be able to get a ton of engineers and we can go to Mars much earlier!
top video! love it
Thanks for the video! Super helpful, just a question or two -- how do you view the simulator device's home page on canvas (what to click on the keyboard for it to show up when running?) Also, is there some way to let the user select the date/time of notifications instead of hard-coding it in the way we did in this video?
Hey Demetri, you can use CMD + K to open the Keyboard on a simulator. And yea, you can build a UI for users to input their date/time and then run these same functions. Obviously you will need to make the date/time parameters.
I'm back, thought I put this in a real app
Push Notifications are one of the best ways to increase retention / DAU!
18:45
Hey its seems like its work How can I offer you a coffee?