iOS Local Notification Tutorial

  Рет қаралды 7,140

Code Pro

Code Pro

Күн бұрын

Пікірлер: 27
@CodePro
@CodePro 6 жыл бұрын
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
@pradeepkumar5359
@pradeepkumar5359 3 жыл бұрын
How to trigger multiple notifications in the same day with different dates?
@НиколайБорисов-й2э
@НиколайБорисов-й2э 3 жыл бұрын
Great! Thanks a lot!
@sankalpvk18
@sankalpvk18 4 жыл бұрын
Awesome tutorial. I felt really comfortable following along. You have earned my subscription sir.
@WildBillTV
@WildBillTV 4 жыл бұрын
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
@nurlanakylbekov7266
@nurlanakylbekov7266 4 жыл бұрын
Just started to watch, what's the background music?
@linhmai6266
@linhmai6266 3 жыл бұрын
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!
@Ipadstands
@Ipadstands 6 жыл бұрын
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,
@CodePro
@CodePro 6 жыл бұрын
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.
@stevengao8345
@stevengao8345 6 жыл бұрын
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
@CodePro
@CodePro 6 жыл бұрын
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.
@stevengao8345
@stevengao8345 6 жыл бұрын
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
@CodePro
@CodePro 6 жыл бұрын
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.
@CodePro
@CodePro 6 жыл бұрын
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.
@stevengao8345
@stevengao8345 6 жыл бұрын
Code Pro thanks i will go try that
@samirdesigner3324
@samirdesigner3324 6 жыл бұрын
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
@CodePro
@CodePro 6 жыл бұрын
You would need to localize your app for the languages you want to support and with the proper localized strings for each language.
@samirdesigner3324
@samirdesigner3324 6 жыл бұрын
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
@zachthac
@zachthac 3 жыл бұрын
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.
@stevengao8345
@stevengao8345 6 жыл бұрын
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
@CodePro
@CodePro 6 жыл бұрын
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.
@stevengao8345
@stevengao8345 6 жыл бұрын
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
@CodePro
@CodePro 6 жыл бұрын
What's the use case for your local notifications? You mentioned you want those to trigger only when the app is in the background?
@stevengao8345
@stevengao8345 6 жыл бұрын
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
@CodePro
@CodePro 6 жыл бұрын
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-cr2jg
@RajeshKumar-cr2jg 6 жыл бұрын
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
@stevengao8345
@stevengao8345 6 жыл бұрын
Wuts wrong with this guy? " i am waiting" and demanding attitude.
Refactoring The Massive View Controller
30:55
Code Pro
Рет қаралды 2,9 М.
iOS Unit Test Mocking Tutorial
24:50
Code Pro
Рет қаралды 27 М.
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 30 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 39 МЛН
PRANK😂 rate Mark’s kick 1-10 🤕
00:14
Diana Belitskay
Рет қаралды 11 МЛН
Push Notifications and Local Notifications (Xcode 9, iOS 11)
27:17
Thomas Hanning
Рет қаралды 67 М.
UI Testing iOS Tutorial
26:59
Code Pro
Рет қаралды 48 М.
UISearchController Tutorial
27:58
Code Pro
Рет қаралды 18 М.
Swift Local Notifications 3: Calendar Notifications
18:22
Stewart Lynch
Рет қаралды 3,1 М.
Custom View Controller Transitions
35:21
Code Pro
Рет қаралды 26 М.
iOS Alamofire Tutorial
19:46
Code Pro
Рет қаралды 48 М.
DRM explained - How Netflix prevents you from downloading videos?
18:17
Mehul - Codedamn
Рет қаралды 215 М.
Objective C Classes
32:29
Code Pro
Рет қаралды 10 М.
iOS Swift Tutorial: Rich and Interactive Notifications - iOS 10
22:46
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 30 МЛН