While similar to push notifications, local notifications make it easy to keep users engaged in your app or reminded of some activity in your app that you want users to come back to. If you are a new developer wanting to find a good complete beginners course, make sure to check out my iOS beginners course at: skl.sh/2pCG5L5
@pradeepkumar53593 жыл бұрын
How to trigger multiple notifications in the same day with different dates?
@НиколайБорисов-й2э3 жыл бұрын
Great! Thanks a lot!
@sankalpvk184 жыл бұрын
Awesome tutorial. I felt really comfortable following along. You have earned my subscription sir.
@WildBillTV4 жыл бұрын
Great video! First one that I have found that is this in depth and helpful. I do have one question. I am creating a reminders app that will send notifications. So for example if I went to remind myself to go running tomorrow at 9am. I want the notification to show tomorrow at 9 am. How would I do that? I assume its with the delayInterval since that went from nil to 10 in the tutorial and that changed how quickly the notification was sent. @Code Pro
@nurlanakylbekov72664 жыл бұрын
Just started to watch, what's the background music?
@linhmai62663 жыл бұрын
Hi, may I ask, if the tap on Notification works even when the app is closed (not even in the background but is killed). For my case, i want to open a specific viewcontroller once user click notification. However it only works when the app is still alive. When it is closed completely, the tap on notification will only open the app without any action? can you suggest a solution to this? I have done some research on stack over flow but i am not sure yet. Thank you in advance!
@Ipadstands6 жыл бұрын
Thanks , this was a good introduction. I wished you mentioned just a little about "rich notifications" and attachments. I Like your Xcode background colors also,
@CodePro6 жыл бұрын
Thanks glad it helped and the background is the new Xcode 10 running in macOS Mojave but I'm on the beta for both. So far I really like the new Xcode and normally that's not something I would say because it's such a buggy mess normally but dark mode is awesome. You can definitely do a lot with notifications, attachments, locations, etc. I just try to keep the tutorials under 25 minutes if possible otherwise I feel like I'll need to break them up into multi part videos but we'll see. Notifications are a huge part so it may make sense to deep dive into everything for notifications both remote, local, and all the configuration options in the future.
@stevengao83456 жыл бұрын
thanks for this great tutorial, watched many same topic on youtube, so far this one is the most completed version for local notification. if I want to use this technique and apply it to my social media app, once my followers post a message, how can I be notified and getting a badge show +1 on the screen. is this possiblely done by local notification ? or I must use cloud remote notification to achieve this. thanks
@CodePro6 жыл бұрын
Thanks and glad you found this helpful. The +1 badge count will show up on either remote push notifications or local notifications provided that you pass in a badge value for the notification content. For that scenario you described a remote push notification would probably be necessary especially if you start getting into apps that are social media based and are reactive based on what one user does and how that's relayed out to followers/friends etc.
@stevengao83456 жыл бұрын
thanks again for this great tutorial, as I followed this tutorial and build my own local notification which is great, then I realize maybe you can add a feature, because most ppl tap on that notification, and notification brings user back to the app, my question is once an user tap the notification, can it go back to a more specific place ? not just back to initial page of app. can we go to the comment page if that is where we got our new comments or likes. hope you understand wut I mean. thanks
@CodePro6 жыл бұрын
This is a good question and it can be done. The place to do this would originate from the UNUserNotificationCenterDelegate. From there you can intercept the tap events on the notifications. Based on what has been selected you could callback to wherever you are listening for those events and load view controllers, storyboards, navigation controllers, and segue anywhere that you want.
@CodePro6 жыл бұрын
This will depend more on how the code is architected. If you have a root level view controller / object that implements the UNUserNotificationCenterDelegate then that root level object and route to wherever in your app you want the user to go to.
@stevengao83456 жыл бұрын
Code Pro thanks i will go try that
@samirdesigner33246 жыл бұрын
Very good and very thanks Welcome back my bro If make app have multiple languages in app change language app without change lang device If use 3 language in app I'm waiting
@CodePro6 жыл бұрын
You would need to localize your app for the languages you want to support and with the proper localized strings for each language.
@samirdesigner33246 жыл бұрын
yes i want make page settings for select language when select any language show app by this language with donot close app and open again i want you make for me to i learn thanks
@zachthac3 жыл бұрын
IMPORTANT NOTE: When implementing this myself I needed to set the request identifier to UUID().uuidString at 11:36 instead of "testLocalNotification". My app couldn't send multiple notifications without that.
@stevengao83456 жыл бұрын
thanks for this tutorial, at the beginning you set a function inside appdelegate file, to register local notification authorization, what if I already have one for remote push notification, do I still need to set up one for local notification ? or these two can share one ? because my local notification I only need badge, but for my push notification I need all three: badge , sound and alert. so if I create two func inside appdelegate will confuse my Notification Center and don't know which one to sent ? thanks
@CodePro6 жыл бұрын
They are shared through the same registration method per apple documentation, "Requests authorization to interact with the user when local and remote notifications are delivered to the user's device." You should be able to register for all three (badge, sound, alert) but you can control what gets configured on the UNMutableNotificationContent. So if you didn't want a sound you can set nil for it on the local notification before you schedule it.
@stevengao83456 жыл бұрын
Code Pro thanks, tested it and it works great, but for local notification i wanted it happen when app is on back ground, then i did some research used " application.beginbackgroundtaskwithname " which works great, but then i realized my remote push notification also become work in background which i want it work both at background and when app is using, is there anyway to seperate them ? Thanks
@CodePro6 жыл бұрын
What's the use case for your local notifications? You mentioned you want those to trigger only when the app is in the background?
@stevengao83456 жыл бұрын
it is for my twiteer like app, every time the user received an incoming post, the app icon will show the badge +1, i use firebase as backend, maybe i had push notification setup before i applied your local notification method, it had some conflict or something, i am not sure what cause it. the badge for local notification will not show up when the app is in the background. until i added the line " application.beginbackgroundtaskwithname( ) " , after adding this line, now it works. even it works i don't know why it didn't work and why it work now. haha. thanks for replying
@CodePro6 жыл бұрын
Yeah it's tough to say without seeing more of the code simply because even with delayed local notifications you can still see the badge popup if the app is backgrounded. It could be as you said but you could also try commenting things out 1 at a time until you can get the local notifications to show the badge when the app is backgrounded and then figure out what caused the problem.
@RajeshKumar-cr2jg6 жыл бұрын
Hey greate video yar... but i have small doubt , how can i pass string to UNNotificationRequest and how to get that strind after recievind notification Already I have tried I'm getting this error request.setValue("111111", forUndefinedKey: "raj") Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key raj.' please make a reply to me if you can
@stevengao83456 жыл бұрын
Wuts wrong with this guy? " i am waiting" and demanding attitude.