I am using Parse to deliver push notifications to my iPhone app. However, when I send notifications, they are getting cut off because they are too long. How can I make a notifications table so that when a user taps the notification, they are taken to a notifications table in the app that displays all notifications in their entirety?
Realistically, if the notification is too long to be displayed properly, it probably shouldn't be a notification in the first place. Hypothetically, you can pass the entire text of the notification you would like to display as a key-value pair in the notification payload and then use that to create a object in your app. You would have to create, add and cache the desired text in the payload and add it to your TableViewController's data source. You can use deep-linking from there to route to your custom notification table. In practice this is pretty round-about and not particularly reliable since notifications come in on a "best-try-but-no-promises" basis. If you're already using parse, you should probably consider creating objects there you can fetch with your desired info. Cloud code can handle object creation pretty easily for example.
Related
I am creating a framework that can receive custom (a certain data model) messages from firebase. The framework is going to be implemented to receive notifications that are not related with the app but with other stuff.
So the framework is going to handle all the display issue by translating the data received and create a notification as it is indicated (I have some flags in data receive that indicated if I should use an image or attach an icon .. etc).
So I did some research on how to receive messages from FCM.
In first instance, I found direct channel that allows to bypass APNS, the problem is that, this only works with the app in foreground.
I indeed create a test project in firebase, a single view app, register my app in firebase project, set info.plist, configure , and send a notification to my app and It worked (just when the app was open).
Then I looked for another choice, and I found APNS. Skiping all the process for validation between firebase and APNS. I found that when you have all set up (and you put all initialization in didAplicationFinishLaunching) your app is able to receive notifications from firebase (Through APNS) when applicaton is in background.
But, notification received (the one that gets displayed) is just for you to tap over it and then it will fire up the app again an only then you will receive the whole data in aplication:didReceiveRemoteMessage method.
My question is, is there a way I can get this custom messages even in background and when received I can display a notification with the content of the whole message?
Yes,
Fortunately you can do that but for that you need to send Silent Notification which will let you process the notification in background and schedule local notification to trigger it with you desired data.
When I say notifications, I mean custom app notifications, so not iOS notifications. Notifications like Facebook's notification tab. Basically I want to check if a user has new friend requests, or if someone has commented on their posts, then load this data into a TableView which is displayed in my Notifications tab.
I wondering how I go about continually checking for these notifications from my server. Obviously I shouldn't check on a single tab bar's view controller, such as the NotificationsViewController. So I'm thinking should this type of functionality be performed in the AppDelegate?
And how do I seamlessly perform a request in the background, then have my Notifications tab catch the response, and parse it, so I can display a notifications badge. A snippet of Swift code, and where I should be placing it would be really helpful!
Thank you.
You can use silent push notification, it will inform your app that something new happened without showing the alert to user (send it from your server), perform repeated request in background is very energy consuming and does not advised, also it wont work if your app is not openning. To store it then can just use NSUserDefault or CoreData
first of all pls sorry for my question, it may appear silly, but i'm in a very early stage of IOS and parse programming.
I manage to create my app in order to receive remote push notification from parse.
I would like to save in one array all push notifications sent from parse to the app.
If i well understood, i can achieve it only if the user tap on the notification, in that way user tap on iphone , "wake" it and so i can execute the code to save the push notification.
But in case user do not tap on it, the data is lost. Same if the push notification has an expiry time, and in that timeframe i have no internet connection.
Is there a way to retrieve, from app, all the sent notifications for the app ? like i was querying any table in dashboard/data browser ?
Many thanks in advance for your help
If my request is not clear, pls tell me
B. regards
Fabrizio
You can create a new Class on your Parse Database and when you create and send you push object, you also save it in background in the new table.
So, when you need to retrieve any push notification atributes you should have them all stored in your database.
I'm developing new iOS app using Parse.com, which uses to chat between two users. What is my problem is, when User A sends message to User B, it will store in Parse.com custom class object. But I want to know, how the Parse.com let to know the User B about he received message from User A. We can fetch from User B app with some frequent time. But this is not feasible way.
So, Is there any option that parse.com will send message to specific user who received message recently? I don't want to user Push notification for this, because push notification is different concept and also not reliable.
Thanks,
Vijay.
What you are asking for is exactly what Push Notifications are for. Your only other option is polling for changes.
If you find Push Notifications unreliable you would need to implement a combination of push + polling.
There are some other technologies out there, but they're not options with Parse without a lot of middle-ware.
I'm implementing an iOS chat app using Parse. Currently, most chat data is stored on the user's device.
When you send a push from one user to another, and the receiving user is on the app, the device will save the message along with its data (who it's from, when sent, etc). From there, if the receiving user is chatting with the sending user, their chat dialog will update. If they are still using the app, but not chatting with that user at the moment, a popup will display with the message.
This works great for when they are in the app.
But when they are outside of the app, a push will come through with the data (message, who sent it, when sent, etc), and a push notification will popup on the user's screen. But when they open up the app, I am not sure how to transfer that data from the push to the app's storage.
I guess I do understand how to do it (if there was only ONE push notification AND the user opened the app by tapping the push notification: there is a delegate method that seems to have a dictionary of the push notification's data).
However, in the case of there being multiple messages being sent before the user opens the app, and/or the user opens the app using the app icon (and not by opening the app from the notification), I am not sure how to access this data. It would seem like there would be some sort of way to get an array of dictionary objects, but I'm not sure.
I know I could implement a way to store the data on Parse, and then delete it when it has been downloaded, but if I don't have to do it that way, I wouldn't want to.
Any help would be much appreciated :)
You'll need to store the data in Parse and allow them to query all messages since they last checked.
I would suggest using a counter every time a message is saved, that way in the receiver you can check if that counter has only gone up by one compared to a local copy of the counter, which means you can just use the message in the push notification. If it has gone up by more than one then you know you have to ask Parse for the rest of the messages.
You can have Cloud Code that each participant in the chat calls to say what number they're up to... then you can delete anything with a value less than the lowest of all the participants. You could even integrate this logic into the getMessagesSince(counterValue) call.
Note that in this case you would also want a gotMessageFromPush(counterValue) to let the server know that you got a message via Push.