Swift: Push Notifications Tutorial (2024) - iOS Development
Vložit
- čas přidán 29. 08. 2021
- In today's video we will learn to set up Push Notifications for your iOS app. Push Notifications are great ways to deliver timely information to your app users. Commonly used, we'll learn to set them up and test them end to end on a physical device.
💻 Source Code: / iosacademy
🎥 Subscribe for more: czcams.com/users/iOSAcademy?su...
😎 Like my teaching style? Check out some of my most popular courses! courses.iosacademy.io
** Popular Series
Building Instagram: courses.iosacademy.io/p/build...
Building TikTok: / @iosacademy
SwiftUI for Beginners: ios-academy.teachable.com/p/s...
** Get Skillshare free for 2 Months and learn iOS
www.skillshare.com/r/user/afraz
** Manage all your investments from app earnings on Betterment!
bit.ly/3eBwlI9
** Grow your own CZcams tech channel with TubeBuddy:
www.tubebuddy.com/iosacademy
#swift #PushNotifications #iOS
I would love to see a video on Push Notifications when a user invites another one to be a friend or sends someone a text. All in all push notifications when certain events happened. Thanks a lot! Keep up the great work
This was an awesome tutorial! Saved my life honestly.
My only question is how do I store this data to keep my app from crashing? And how do I develop a screen to follow up with the notifications, so users have somewhere to view notifications in app?
Thanks in advance!!
Worked perfectly the first time. I'm using SwiftUI and loading from Package Manager. Thanks for putting together excellent video!
Great content! I was looking for an end-to-end PN video like this, ever since I was an iOS Developer. Thanks a lot!!
Youre welcome
do we need to pay 99$ and developer account to test this feature as ios developer?,,,,
Please teach us how to automate notifications Sensei ;-;
Coming soon!
Please do!
@@iOSAcademy Yeah please show us how to set up automatic notifications based on updating the info of a Firebase DB
Great video! What recording software are you using on your phone? I've never seen the "QuickTime"-looking bar on my iPhone screen before.
Definitely want to see another video around this. More use cases and edge cases, please.
Coming soon
Finally some dynamic videos. You really respect our time. This is amazing. Thanks a lot!
Youre welcome
Very informative. My question would be, who does the notifications go to?. All users? If so how does one target groups or individuuals?
Amazing tutorial and explanations, thanks for the tutorial 🙏👍
You’re welcome
Hello ! I have a question, can we update the content of delivered notifications ? Depending of the number of received message in a chat app for example
Yes, it's very interesting how to save the tokens in a database to use them to send push notifications? Do you need a server and cloud messaging for that?
It's very helpful thank you mate
You are the best, this content is blessed
Thank you!
Thanks bro for your help!! You are the best🙂🙂
You’re welcome!
incredibly well explained and simplified. We need you!
Thanks!
@@iOSAcademy support for apple watch?.. Thanks
This topic always makes me go around several times. Luckily its under control. It would be awesome to know whats the expected behavior for an actionable notification, I cant believe the only way to display the buttons is to pull down the notification or long press it. is there another way?
Hey, thanks for the video! Still waiting for lesson with automatic notifications
On my list
Please do explain the user to user specific notifications
Added to my list!
Your video really helps me a lot. However, I met a problem when following your instruction; that is: Value of type '(Messaging, String?) -> ()' has no member 'token', as xcode cannot read the word 'token'. Can you help show me how to work this out ?
Can't believe that this content is free. Thanks 🙏
Youre welcome!
This is awesome and great content, thank you so much
Glad you enjoyed it!
Thanks for the video.
You’re welcome
could you please show us how to set up deep links
Thanks a lot, but I would like to ask about if does this works in Release mode?, because when I have my device connected into my mac this show me the push notification, but when I install it on my device this doesn't receive those push notification
Thanks a lot! Very helpful!
Glad it helped!
Thank you!
Youre welcome
Good one.
Thank you sir, I have implemented it, just awesome.
Nice
Thanks it helped.
Youre welcome
What is app delegate? For swiftUI? I don’t use storyboard anymore cause everyone says it’s much worse than UI
how do you actually send a notification from your app? for example i am personA and I message personB, personB should then receive a push notification on their phone. There doesn't seem to be a lot of documentation on how to do this, or maybe this should be a local notification?
How do you group these notifications you received from FCM?
Do you have a video that explains how the user can view the content they are being notified within the app?
Is there any way to have 'something' trigger on receiving a push notification? My situation is that our power grid drops fairly often and I get a push notification from the inverter to advise me. But, it comes direct to my phone and I'd like to automate if possible, such as activate a light when a push notfication is received
Great video and explanation! Thank you!
Glad it was helpful!
Thank you very much. Thanks to this video, I was able to set up push notifications in my application. But in the report message there is an open count parameter. How to enable it and count the number of open notifications from users?. Currently in my application it is 0
Great content as always. One small question, how can we auto update the badge numbers just like WhatsApp and Gmail?
Thankyou for the content Afraz
Thanks & automate with cloud functions
@@iOSAcademy Pls show how and also how to manage badges counting
Great video thanks. Is there any way to target individual users, as I think this is a broadcast?
yes - with the token
Thanks!
Youre welcome
Thanks man!
Youre welcome!
Thank you very much and please show how it can be automatic)
Youre welcome
Cocoapods dont work on my mac for some reason... m1 air with monterey...
5:15 what do I do here if I'm using SwiftUI as opposed to UIKit? The SwiftUI equivalent here is init() in your App class but what do I do to use these delegates in SwiftUI?
You can use UIApplicationAdapter
Ye but how do u update the red badge? :)
Nice job, however this is using Firebase. How do you do it without using Firebase? Also how does the badge work when the app is not running?
how can i navigate to a specific view controller??
Hello, Great video. Thanks. Do you have videos of Push notification with Azure Notification Hub without using Firebase!
Not yet
Great Content. Everything Works but i have a question. How can i open a certain view controller when the notification is tapped? Right now it opens the app main screen and i want it to open another view controller when the notification is tapped.
Same question, here.
Good one bro 👏
Thank you
love this video
it works when i test the app with Xcode. but when i try to archive the app, i get the error that Firebase.analytics was not found. Sorry about my English
Revenuecat subscriptions SwiftUI tutorial? 🤩
Hopefully coming soon!
Do we need a Developer paid account for this?
3:05 after I select it, it adds "Push Notifications (Debug)". Why do I get Debug? Is it because I am using Xcode 13 beta 5? Edit: Nevermind. I closed Xcode and reopened it and (Debug) went away.
good!
Thanks
Hello. What if we want to send an APN to a specific user/device? What if user has deleted the app and re-install it? How to send to that specific user? Let say user has logged in to Firebase and I want to send a an APN to that user only.
Thanks
Can i implement same thing with SPM, i tried to add firebase spm, but couldn't find FirebaseCore from firebase package list
I have android app and I am using cloud services I am receiving notifications but when my app in background or foreground when app kill or force kill I don’t get notifications I want notifications even in app kill mode ? Is there any solution please highly appreciate
Can you have Firebase send a push notification automatically when there is an update to the app? or does that have to be done manually?
yes
Very awesome! how do you mirror your phone in a window like that?
Thanks. With quicktime
how can i add a button similar to whatsapp push notification so that i can reply via pushnotification
can anyone explain with a video how to get the custom sound to play with notifications. pushing the different sound names in the app but the app/phone won't pick up the same sound file to play. no video online to show the correct way to do this, just all say put the files in the app and its supposed to work but noone ever shows this working lol
Please do with image and text in push notifications
Coming soon
Great Video! But how can i implement the Push Notifications in my @main App. If I try it, I can just run the App, or the PushNotifications with a black screen, but not both? I tried several things, but i can't get both together.
Use UIApplicationAdapter
Ways to automate please!!!
Coming soon
when you handle with UNUserNotificationDelegate's didRecieve method therefore which application status is also inactive, how to push operation with userInfo wait while your LaunchController and tabbar setup and after that operation is ongoing?
because after parsing userInfo i want to select my tab for my responsible controller and make operation but my tabbar isnt still setup already and couldnt select it...
Hello, great video. Does this work on Web based PWA?
Yes it does
always get the error APNS device token not set before retrieving FCM Token
Please upload automation process of push notifications
Coming soon
Whenever I create a campaign, I get the notifications on my phone but the open count is always 0 even though I open it. How can i fix this?
please do a video on how can we know if notification is received or not by ios Device.
Coming soon
Hello friend, this video is for both internal push (inside the app) and external (outside the app)?
External
Can you do a video on automating push notifications?
Sure thing
Yes we want to see how to implement automated notifications working app...
Coming soon
@@iOSAcademy thanks 👍
I have followed all the steps but the push notifications still do not arrive on my device, could you help me? Thank you
can we do push notification without the apple developer account?
Sadly no
How APNs detect a specific user application to send a push notification? And also if the user uninstalled the app then how does this scenario works?
The token identies a user & app
@@iOSAcademy Thanks and after uninstalling the app?
GOAT
Thanks
remote notifications are not supported in the simulator
can you do this without the paid version of apple developer program?
Its not possible
I keep getting zsh: permission denied when I try to do pod init in my terminal. What should I do?
Google chmod for permissions
Do you have any idea ? the badge wont removed after I opened the app
You need to remove it with UNUserNotification methods
Can I have an active countdown timer in my notification alert
Nope
How can I execute an action in the example application modify coredata once the localnotification is displayed without having to touch it
With background actions
@@iOSAcademy Do you have any information or example?
automatic notification ~
Coming soon
I am new to IOS Dev.... do i need to have a developer account (and that too paid)? :(
Only for notifications. Otherwise no
How can I remove the Badges? After opening the app the badges doesn't reset
Use the UNUserNotification center
i did not get any type of notification with all of this.😟
I am not getting notifications. Help!!!!
i cannot for the life of me get this to work. I can see where my token is displayed in the debugger and where i get "Success in APNS registry".... yet no notifcation on simulator or physical iPad. Ugh.
Do we need paid developed account to have APNs?
Yes
Can you please help? I followed your tutorial, but I am getting this error. "APNS device token not set before retrieving FCM Token for Sender ID '********'. Notifications to this FCM Token will not be delivered over APNS.Be sure to re-retrieve the FCM token once the APNS device token is set."
Same. I don't know why?! My device cannot receive any notifications
This is not working. I can't recieve notifications on my device
Sure but you should note that it may not scale and is potentially subject to attacks.
you need a apple dev membership right?
Yes
@@iOSAcademy thank you, I'll just buy it
Tried following your steps and it doesnt idk why. I followed you step by step
I didn't find Push Notification
in Capability.
note: I don't have developer paid account
You need one to set up push
Im not getting the token... followed your video step by step and the code is the same.
Check your config
Going off the latest dev files this is no longer the correct way to set things up with SwiftUI default projects.... being the video is 2 years old that makes sense, but why was it relabeled "2023"?
i did all in the tutorial but i got a list of errors('coudn't build reference FireBase/os/...'). This method probably does not work anymore