I am looking to display incoming push notifications in a table view within my app. I am using the parse framework for push notifications which are triggered via scripts within an existing CRM product. I have setup separate channels for each user for advanced targeting purposes.
What i am looking to do is display all push notifications for the specific user based on their channel in a table view. I would also like to have a way for the user to delete the notification from their phone but not from the parse backend. I'm pretty sure this could be done with a query and a custom field in parse to show a message as deleted by user. The query would look at the channel and then the custom field to only display messages not marked as deleted.
My question is how to structure the query and where/how to add this custom field?
I have found a solution that works.
Trying to capture from an incoming push notification seems like it would only work once the application is opened and would cause delays in displaying in the table view. Trying to capture and store the data received from the push notification requires a call to parse in order to save it as an object in my custom class. I found it easier to make a call to the Rest API to create a row in a custom class in parse.
So basically when a push is triggered to an individual user the following happens.
Creates an API call to post data to parse in my custom class with all the info contained in the Push Notification plus other details like the user receiving it and info for reporting purposes.
Then the push notification is triggered after the object is created in my custom class.
Finally I have the table view querying the custom class to find the push items that are specific to the user and displays them in the table view.
So far this has worked wonderful and seems to be the easiest way to accomplish what I was looking to do.
Since push are tied to Installations (not users) I might suggest that you add column to the Installation table (as a collection) to a custom object you create to represent each push.
You could capture the push notifications locally and store them on the device, but I think that might only work for pushes received while the app is in foreground. The app would not have access to pushes received while in background mode unless the user performs an action on the notification.
It a shame, since I know this data is already being capture somewhere in Parse, but it does not seem to be exposed through their current API. I hate having to store this data again, but I see no other alternative.
Related
I am developing a SPA webapp through which I add events to my users google calendar They have given permission for. However this is my first time using Google calendar API, and was unclear about how to retrieve my users existing events , or if they add new events or delete them. IS there an option to set a webhook within google calendar thus when the user makes any changes to the calendar I can receive the change. My current approach was to make multiple get requests but that seems very inefficient. How can I keep my app calendar in sync with all user created events.
You can set up a push notification to be alerted any time anything changes on one of your calendars. I looked into it before a little, if memory serves it doesn't alert you to a lot of particularly useful information (I don't believe it tells you exactly what changed and how). Check out the docs here: https://developers.google.com/google-apps/calendar/v3/push
What I ended up doing was setting up a cronjob and getting all of my calendars' events using the synctoken, which returns only the events that have changed since the last time I polled the API for events. https://developers.google.com/google-apps/calendar/v3/sync
If you are using the SyncToken in your request for data, all you get back is the events that have changed. There is an eventID in the Google records that you can use to connect the change to your event data.
I want my app to have 3 different kinds of notifications which the user has the option to opt into each but I need to support all of them on the backend I think. I wanted to see if others had an approach which worked well for them. The three notification types are different:
Individual Notifications - A specific user related notification. When a specific event happens in their account they (and their team members) get notified of it.
Item Notifications - An item specific notification. Any user of the system can get notified when a specific item available to all reaches a certain stage of the process.
Topic Notifications - General system event, to be sent to anybody who has opted into receiving notifications for a system event.
If I am going to support badges for each, I need to track them by user I suppose, in order to send down the badge number with the notification. The icon would be the aggregation of each. I am thinking I need three Toggle settings, one for each. When the user sets each one, I would send a registration for that type of notification to a webapi which would store the user id in a registration table along with the registration type.
When sending the registration to the user, the registration table gets queried, a record goes into the notification_view table for that user and notification type, and the badge count is taken from that and sent to apns.
When the user views a notification, I will send a message to the api and update (or remove) the notification_view record associated with he viewed notification.
I know there are ways to have filter a notification, and I expect this will be incorporated. I'm using Azure NotificationHubs and this would be included under tags. So if a device had a tag (sports_news or something like that) the server side could send a notification with a sports_news tag and it would go to everybody who subscribed to it. That might work for category #3 above, provided we do not care about badge counts.
Is anybody else doing something like this? Do you use the same type of backend tables to support the process? Does my process mirror what you are doing?
I made a laravel app which uses an index method that delivers a collection of the client's available appointments (think hairdresser) to the page (as an api), which I then display using vue/vuetify.
The client is saying they would like the appointments on the page to be dynamic/live eg if someone books an appointment, then all other logged in users will see that appointment disappear from the list on their screen.
I have no idea how I would do this, although I have had one idea - I somehow incorporate node/non-blocking on the server, like a chat room, but only for this part of the app.
Or is there a way to do this with laravel/nginx?
Thanks in advance - I don't know what to search for!
I believe you are looking for Broadcasting (Documentation Link). You would need to:
Configure your broadcasting driver (you could give pusher a try for quick setup and tinkering)
Configure your Laravel backend to dispatch a new event whenever a new appointment is made, (e.g. event(new AppointmentCreated($appointment)) where AppointmentCreated implements the ShouldBroadcast interface. You can combine this with Model Events
Update your frontend to receive your broadcast (Check Laravel Echo). Once you receive a broadcast, update the UI to mark this appointment as unavailable i.e, make it disappear
I am developing a SPA webapp through which I add events to my users google calendar They have given permission for. However this is my first time using Google calendar API, and was unclear about how to retrieve my users existing events , or if they add new events or delete them. IS there an option to set a webhook within google calendar thus when the user makes any changes to the calendar I can receive the change. My current approach was to make multiple get requests but that seems very inefficient. How can I keep my app calendar in sync with all user created events.
You can set up a push notification to be alerted any time anything changes on one of your calendars. I looked into it before a little, if memory serves it doesn't alert you to a lot of particularly useful information (I don't believe it tells you exactly what changed and how). Check out the docs here: https://developers.google.com/google-apps/calendar/v3/push
What I ended up doing was setting up a cronjob and getting all of my calendars' events using the synctoken, which returns only the events that have changed since the last time I polled the API for events. https://developers.google.com/google-apps/calendar/v3/sync
If you are using the SyncToken in your request for data, all you get back is the events that have changed. There is an eventID in the Google records that you can use to connect the change to your event data.
I have an app in backbone.js. The user can add items to the app which are added at the backend server and the collection is refreshed and the user sees the added data. How can I sync the app with any changes in the backend. Suppose if multiple users add the data at the same time each one should see the changes.
There are options like ajax polling where I can refresh the model after a certain time period but I hate to use it.
Can you suggest any event driven method where any change in the backend is reflected immediately in the frontend of my app.
You can add a kind of refresh event on your app, which will refresh every few minutes. Something like evernote desktop application does. In that event you would add collection sync event.
You can also use something like
collection.sync(method, collection, [options])
http://backbonejs.org/#Sync
This doesn't answer your question though, and I'm not sure how you would push changes from server to client.