Is there a way to have push notifications for different groups - ios

I want to be able to send push notifications in my app. But i would like to be able to send them to certain categories like country
any way to do this if there is 25-30 different categories
also a way for somebody to pick a category and then get push notifications for that category

I handle sending push notifications myself, the backend receives push keys from the mobile apps after login, this way I can decide which user I want to send push notifications... This way you can decide how to implement subscription and push mechanism yourself, and check if a user has a topic enabled and is in the specified country.
Anyway: more info will get you better responses: ios? android? external push notification service? used frameworks?

Have you considered using Firebase Topics?
Based on the publish/subscribe model, FCM topic messaging allows you to send a message to multiple devices that have opted in to a particular topic. You compose topic messages as needed, and FCM handles routing and delivering the message reliably to the right devices.
For example, users of a local tide forecasting app could opt in to a
"tidal currents alerts" topic and receive notifications of optimal
saltwater fishing conditions in specified areas. Users of a sports app
could subscribe to automatic updates in live game scores for their
favorite teams.
You could simply subscribe/unsubscribe users from the relevant country topic.

Related

Topic subscription Using APNs

I am have an app with push notification implemented in APNs, ie, Firebase has not been used. I need to implement a topic subscription like feature(one present in firebase). Is there a way to implement a topic subscription(One in FCM) or similar option with APNs service? Any heads up is appreciated
I think you will need to manage topic related things on your backend, i-e mobile devices will subscribe to certain topics which are already made at backend, your backend needs to handle all the related things like creating a new topic, assigning respective device token to those topics etc.
I am also looking to work on this

Firebase in-app message center/inbox design

I want to build an in-app inbox (a.k.a. message center) as a central place to store messages to my app's users. Think one-way email notifications rather than user-user chat. This is the sort of thing I have in mind (taken from the Victoria Secret app):
Urban Airship have a product which does what I'm after and Intercom.io comes close (although it's focussed more on chat rather than asyncronous email style messages). However, I'm using Firebase elsewhere in my app so I thought it makes sense to use the same SDK for the in-app inbox too rather than introduce another 3rd party.
My question is: does anyone know whether the following logic makes sense (I'm developing on iOS with Swift first)?
Create a tableView as the "inbox"
Use Firebase Cloud Messaging (FCM) to send a payload to the app including message title, body etc
Add a method to the app to receive the payload and update the tableView's data source
Ideally, I'd like to trigger a notification (+ badge update) if the app's in the background when the message is received and an in-app notification when the app's in the foreground. I'm assuming I can do this with FCM/Notifications.
Has anyone created this sort of thing in the past or have any suggested pitfalls I should be aware of?

offline message hook for group chats

I've got an iOS app backed with ejabberd, with a small extension based on offline_message_hook that uses APNS (Apple Push Notification Service) to deliver push notifications of messages that are sent to offline users. This doesn't work out so well for group chats though, so I'm looking for a strategy that would do the same for offline users that are part of a group chat. Do MUCs even keep track of users that are part of the room but offline? Would I need to extend them in some way to keep track of this? Could I subtract the set of invited users from the set of online users to get the offline users? What hook should I be using to do this?
Any suggestions on this or advice on a better strategy are much appreciated!
The XMPP specification for Multi User Chat define MUC rooms as presence based. Per definition, a user is only in a chat room when it is connected. When he gets offline, users gets out of the chatroom. It means he does not receive message at all. This explains why they are not stored offline.
This is for now a feature of XEP-0045. Some future XMPP specifications (aka MUC 2) may address this issue in the future. Currently, MUC + offline storage of message is not possible in XMPP.

Is it possible to send IOS push notification through pubnub on multiple applications?

I have two IOS applications and I want to send new message push notification on both applications through pubnub ? Is it possible ? As apple has different APNS certificate for different application and pubnub can use only one certificate at a time, is there any hack possible through which I can send push notification on multiple application ?
This is becoming a more common use case especially with the popularity of car/taxi dispatch applications where you have a driver app that communicates with a separate rider app. There are other use cases but this is the most common one.
Currently, the PubNub Account Dashboard only supports one push cert per key set which means you have a couple of workarounds until we do support multiple push certs per key set.
Two Apps
Use 1 set of keys as the primary keys where you do all pub/sub operations, presences, etc.
You would also include the mobile push payload (apns/gcm) in every publish you send.
One application will register for push notifications using this set of keys.
You will also publish the push payload only on the second set of keys that the other app will register for push notifications on.
That other app will also pub/sub, etc. on the first set of keys.
And each set of keys will have a separate push cert as you already understand.
One App
The alternative is to just have one app (so one push cert with one set of PubNub keys) and you provide a means for the end user to register as a user of one module or the other (modules == apps now). Then just only show the functionality/UI that applies to that type of user. I understand this provides for a larger app footprint and more restrictive release cycles with both modules (apps) in a single app.
Neither of the above solutions are optimal but it is what many customers are implementing for now. We do have the multi-push cert feature on the roadmap but it requires some other features to be in place before we roll this out. Please follow #pubnub Twitter account and the PubNub blog for announcements of this feature and other great improvements that are coming soon.
Questions (from the comments)
Lets say I have two apps, one is driver and another is rider, do I have to create two apps on pubnub and get two set of keys?
As far as I understood from your explanation, after creating two apps on pubnub, we will have to use one keys for chat and another for push notification, am I correct?
In case of using another keys only for push notification, how will it identify to which rider app or driver app it has to send push notification?
Answers
I am answering all three questions in one shot here. I hope this makes it clear.
Apps in the PubNub Account Dashboard are basically just organizational folders so they don't really have to have a direct relationship to an actual application, so it really doesn't matter if you create 1 or 2 Apps in this scenario. But I would create 1 App and two sets of keys: Primary keys and Secondary keys. Both of your iOS apps (Driver and Rider) will use the Primary keys for all pub/sub of messages.
But for push notifications, Driver app will register for push notifications only on the Primary key's push cert and the Rider app will only register for push notifications on the Secondary key's push cert. Whenever you publish a message to the Primary key, you include the push notification payload for APNS (pn_apns : { aps : { alert :...) and you also publish just the push notification payload on the Secondary key.

Apple Push Notification Service Statistics(apns)

Is it possible to find information about Apple Push Notification Service usage?
How many people are using, and how many people are declining them?
Or maybe, somebody already has this sort of information?
Apple does not provide a lot of information about how many users actually accept/decline push notifications but you can get a good idea of what's going on by comparing the number of total installs and the number of valid push notification tokens you have ( I'm assuming that since you are interested in analytics you already have a Push server set up ) Push notification tokens are only generated if a user accepts.
If you need more information about the actual push notifications, you'll need to get your hands dirty and actually add tracking code in the application. If you're looking for something free try Google Analytics for iOS with Custom Event Tracking: https://developers.google.com/analytics/devguides/collection/ios/v2/events
Urban Airship also provides a pretty good analytics service, but you have to be using their push notification server: http://urbanairship.com/products/push-messaging#analyze

Resources