I use Push Notifications from Pushwoosh.com. In their tutorials, they have many guides, but nothing that I could find for a view that allows you to view past notifications the device has received. As many people can tend to dismiss or clear notifications quickly, it is usually a good idea for them to go back and view them within the app itself. Does anyone know if this is possible using Pushwoosh?
I think you will have to do some of your own work here. It's not that difficult either.
When a push notification is received, you could save its information to NSUserDefaults or to your own database and then retrieve this when you need it.
Related
I am currently working on developing an app in swift 5, Xcode 11, and I am getting towards the end of the initial development. Right now, I am attempting to integrate Remote Push Notifications into the app. I have followed a lot of tutorials online and it works in the sense that I can send the remote notifications through the "Pusher" app, but this is only for testing purposes. I can't seem to find anything about how to actually trigger the notifications through the code, so that, for example, if a user were to receive a message in the app, they would get a push notification. I am not sure if I am just completely missing something, but if anyone can explain to me what exactly I am skimming over in simple terms, I would greatly appreciate it. Thank you.
When we talk about "remote notifications", it means that we have a server that sends us these notifications. As I understand, you want to just show in-app banner that looks like notification. You have 2 options:
Follow these instructions and schedule notifications locally
Use some sort of third party library (e.g. SwiftEntryKit) to create customized in-app notifications.
Since push notifications may not be delivered sometimes (you can lose a few of them), you can not run code after the iPhone is turned on to check if there is new information available from the server, and you can not run code if your iOS App is closed... What can you do if you want to be as more accurate as possible in for example a Chat App in iOS?
I mean, inform the user as faster as possible that he has new info available. Comparisons: WhatsApp is updated without any delay.
You can do background fetch if your App is in background. But if the App is closed and you miss a push, it's not going to be up to date until the next push arrives or user opens the App. The same with silent notifications. If the app is terminated by the user, you are not going to receive it. Is there any way to solve it? It must be because other Apps do it... If there is any "private and secret" API that they are using (I read about this answer when no one know how to do that)... Is there any way to apply to use it?
UPDATE:
I'm using push notifications. The goal is to fix when a push doesn't arrive. Example: User A send chat message to user B. User B doesn't have the App open. The system lose the push. User B is not going to receive the message until he open the App.
Push notifications seems to be your only way even if you do loose a few of them, which I don't know how you would since they are pushed to apples secure server... but what do I know. As long as the user turns on the push notifications you should be fine. They may be delayed due to apples way of handling them. Honestly push seems to be the future, having your app constantly every minute or two check for new messages is a huge battery water in conjunction with normal texting apps. Your app should provide the best live data but since apple restricts to push notifications when the app is off or not running just stick to push notifications and only push major events to the user. I believe you can set up a job scheduler using quartz or schedulator to setup your server to push notifications to your app.
Using Parse.com for one of my iOS apps, aready on the appStore, I recently experienced a large number of remote notifications sent to users, in a rather short time.
The number of notifications sent in such a short time cannot be due to the normal functionning of the app.
What could make such a thing happen?
I made an Export Data on the same day. Could that be the cause?
I also modified one record, on one of the tables, but that only explains one push notification.
I was also working on the app, preparing for a future version, but do not think I did anything to fire a great number of notifications, or any notification at all.
Thanks for any suggestion.
Export Data has nothing to do with push notifications - that is not the cause.
Look through all of your push notifications that you sent. You can see your push records by going to the 'Push' tab on the Parse.com dashboard. It will allow you to see who was send each of the pushes and when they were sent, along with the JSON payload.
I would recommend taking a hard look at your push notification code to ensure you do not have an accidental loop, as that sounds like the most likely culprit.
Is it possible to just get an information when a new notification arrives in the notification center which is not pushed for my app but a notification for the user? I don't want to know what is inside the notification but only get an info if one arrives. Any ideas?
I'm looking for a solution without using APNS/& Bluetooth Devices.
Thanks for your help! :)
EDIT: i'm looking quite a long time now for a solution, did read much about distributed notifications, APNS, iOS system log files and so forth but didn't find that peace of code which is the magical solution.
EDIT 2: seems to only work with additional bluetooth environment. Doesn't help me in finding a solution so if anyone still has an idea, feel free to join this topic :)
I'd like to see what iCloud is doing behind the scenes to help understand it and program it better. Looking at the documentation, I can only find these two notifications:
NSUbiquitousKeyValueStoreDidChangeExternallyNotification
NSPersistentStoreDidImportUbiquitousContentChangesNotification
Are there other notifications available? It seems like a very short list. Can someone give me a more complete list of iCloud notifications to observe?
If there aren't any more in the documentation then there aren't any more. And even if there where you shouldn't use them, using undocumented stuff is a bad idea.
If you still insist you could register an observer for a notification using nil as the notification name. That way you'll get all notifications no matter what they are called.