Make voip push notification work again on iOS 13 - voip

As per documentation from Apple (at WWDC session "Advances in App Background Execution"), "Repeatedly failing to report calls may prevent your app from receiving any more incoming call notifications." so in this case ,
1) How can we find out wether my app stop receiving any more incoming call notifications? is this data will present anywhere in console?
2) How can we do that work again?
One of my application stop receiving the voip notification from last week. Now i have updated my code base as per the documentation but still i am not getting any Voip notification.

You can follow this , we also had the same problem. The solution is here https://developer.apple.com/documentation/pushkit/responding_to_voip_notifications_from_pushkit

Related

Correct way to build an in-app notification service?

Background
I have a monolith Node.js + PostgreSQL app that, besides other things, needs to provide real-time in-app notifications to end users.
It is currently implemented in the following way:
there's a db table notifications which has state (pending/sent), userid (id of the notification receiver), isRead (did a user read the notification), type and body - notification data.
once specific resources get created or specific events occur, a various number of users should receive in-app notifications. When a notification is created, it gets persisted to the db and gets sent to the user using WebSockets. Notifications can also get created by a cron job.
when a user receives N number of notifications of the same type, they get collapsed into one single notification. This is done via db trigger by deleting repeated notifications and inserting a new one.
usually it works fine. But when the number of receivers exceeds several thousands, the app lags or other requests get blocked or not all notifications get sent via WebSockets.
Examples of notifications
Article published
A user is awarded with points
A user logged in multiple times but didn't perform some action
One user sends a friend request to another
One user sent a message to another
if a user receives 3+ Article published notifications, they get collapsed into the N articles published notification (N gets updated if new same notifications get received).
What I currently have doesn't seem to work very well. For example, for the Article created event the api endpoint that handles the creation, also handles notifications send-outs (which is maybe not a good approach - it creates ~5-6k notifications and sends them to users via websockets).
Question
How to correctly design such functionality?
Should I stay with a node.js + db approach or add a queuing service? Redis Pub/Sub? RabbitMQ?
We deploy to the k8s cluster, so adding another service is not a problem. More important question - is it really needed in my case?
I would love some general advice or resources to read on this topic.
I've read several articles on messaging/queuing/notifications system design but still don't quite get if this fits my case.
Should the queue store the notifications or should they be in the db? What's the correct way to notify thousands of users in real-time (websockets? SSE?)?
Also, the more I read about queues and message brokers, the more it feels like I'm overcomplicating things and getting more confused.
Consider using the Temporal open source project. It would allow modeling each user lifecycle as a separate program. The Temporal makes the code fully fault tolerant and preserves its full state (including local variables and blocking await calls) across process restarts.

Receive push notification in Node.js

I'm creating a NodeJS application that should receive notifications from FCM. I've seen in the FCM documentation that you can send, but not receive notifications in the current version.
I've already searched alternatives for FCM, like pushy but seems that they have the same problem, only send notifications, not receive.
Currently I'm poling a REST api every 30 seconds to check for changes but obviously this is not the perfect scenario.
Is there any opensource or commercial solution that can receive notifications from a service, similar to firebase?
I find
https://github.com/MatthieuLemoine/push-receiver for node
and https://github.com/Francesco149/push_receiver for python

How to properly test an azure bot service

I'm able to successfully load test my bot server by getting the proper auth token from Microsofts auth URL (basically through this page)
I was wondering if this was a valid test on the service considering that we're not actually hitting the bot frameworks endpoint (which has rate limiting)
Is there another way to load test a bot service wherein i can replicate the bot frameworks throttling/rate limits?
I ended up with using load test with Visual Studio and Visual Studio Team Services.
The reason why I used this approach is that you can setup full path of load tests. Azure Bot Service can be either Web App or Function App with endpoint prepared for receiving messages - using HTTP POST so in the end is just web service.
You can setup load tests for different endpoints including number of hits to selected endpoint. In case of Bots you can for instance setup test with 100 fake messages sent to the bot to see the performance.
You can read more under these two links below:
Load test your app in the cloud using Visual Studio and VSTS
Quickstart: Create a load test project
Unfortunately as stated in the documentation you linked, the rates are not publicly available due to how often they are adjusted.
Regarding user-side throttling- this should not actually have an effect either way as long as you simulate reasonable traffic, but even if you go a bit overboard, an individual user hitting rate-limiting would be functionally equivalent to just having a bit more traffic. The single user sending more messages to the bot is the same as three users sending the same amount of messages slightly slower and there's no limit for your bot in terms of how many customers you might have. That said, a user getting a message, reading it, and typing up a response should not put themselves into a situation where they are rate-limited.
However, regarding bot side throttling it is useful to know if your bot is sending messages too fast for the system. If you are only ever replying directly to messages from users, this will not be an issue, as the system is built with replying to each user message in mind. The only area you might run into trouble is if you are sending additional (or unsolicited) messages, however even here as long as you are within reasonable limits you should be OK. (i.e. if you aren't sending several messages back to a user as fast as possible for each message they send you, you will probably not have problems.) You can set a threshold for bot replies within your channel at some reasonable-sounding limit to test this.
If you would like to see how your bot responds in cases where throttling is occurring (and not necessarily forcing it into tripping the throttling threshold), consider setting your custom channel to send 429 errors to your bot every so often so that it has to retry sending the message.

How to create web push notification from server to all notification granted users?

I am using Angular CLI latest version and NodeJS, want to archive web push notification, we got few documentations but gives error, May I know any Documentation for web push notification which supports angular and nodejs.
The requirements are send push notification to all users who notification granted while browser closed as well.
Sample docs :
https://ciphertrick.com/2017/03/14/browser-push-notifications-in-angular-applications/ (getting error pushNotificationModule not exported)
https://www.npmjs.com/package/angular2-notifications (Not clear for CLI)
The Angular2+ directive angular2-notifications is doing only the last part showing the message in UI/UX. And that is the least of your challenges.
You say:
The requirements are send push notification to all users who
notification granted while browser closed as well
The part 'while browser closed as well' is the tricky part.
This means you need a Service Worker. A Service Worker is a script that your browser runs in the background, to which the message is being pushed when the browser is closed. For a nice introduction to Service Workers, read this. Angular has a Service Workers implemented in production version since 5.0.0. Klik here to read more about it.
I don't think setting up a WebSocket connection (like socket.io) from Node to a Service Worker is possible. It's complicated, some people say it's possible, others say no. See this for more info. I would at least say that it is not stable enough, so you need a 'real' push notification.
You can use a push notification provider to do the job. Click here for a list of them. You pay for these services.
If you want to do it yourself (free of costs) you can use Google's cross-platform messaging solution Firebase Cloud Messaging (FCM) (the successor of Google Cloud Messaging (GCM)).
To connect your NodeJS server with the FCM you can use different libraries e.g. node-pushserver and many others.

Push notification to millions of device + Apns + node.js

My application stack is ios(front-end) and node.js(back-end). I have to send notification to devices. In my node.js part im using apns module to send notification, its working fine......
Now i have to send Mass notification like at a time consider i have 10,000 devices to notified, the logic what im following is
I'm looping through 10,000 devices and calling apns provider.
1.Why this for loop approach
I have to store each notification details in my mongodb collection, so i followed this approach.
The problem is the notification is received by some devices and that too very late(next day).
I read the link also
https://www.raywenderlich.com/156966/push-notifications-tutorial-getting-started
saying apns will reject.
Is the above approach is correct also any way to make all notification deliverer.
Please share your ideas. Thanks in advance.
If you need to process each individual notification before/after it is sent I would instead recommend a design change from a loop and have you look at job queue instead.
With this design pattern, instead of your only step being to loop over notifications and send via APN, you push these notification into a queue/messaging system and have workers which pull from the queue and process (send via APN and write to mongo) the notifications. The nice part of this design is that as your application grows you can add on more workers to handle the increased load without rewriting your application/architecture. Once you have it built it may look something like this:
I personally use RabbitMQ for my job queue, but that decision is something you need to research on your own. For example if you don't want to manage the messaging system you could look into something like AWS Simple Queue Service.
I think looping through 10,000 devices ids and calling APNS provider is not the right way forward. The documentations strictly says here node-apn readme file to reuse apn.Provider rather than recreate it every time to achieve the best possible performance.
If you send notification using arrays of device ids rather than just a device id then you will get a response from the APNS mentioning all the details for each device.

Resources