Asp.Net Boilerplate Notifications - asp.net-core

I have Notifications working in a .NET Core web application using the Abp Boilerplate framework. I've also implemented EmailRealTimeNotifier so that after the Push notification is sent, an Email is sent as well.
I'd like to give Users of the application the ability to choose as a preference, whether they want to receive
Push Notifications Only
Email Notifications Only
Both Push and Email Notifications
I figure I can refactor the EmailRealTimeNotifier class used to send Emails with some clever logic hopefully. But I'm stuck on where and or how I would implement code to prevent the Push Notification from firing off.

You can save the settings in the Settings per user provided by abp, read those settings and based on that send the emails or push notifications.

Related

Is there a way where i can NOT send push notifications depending on payload?

Context:
So i have an app which sends reminder notification depending on user's preferred time.
I dont want to send notification if user's app is already open or running.
we are currently using react-native-notifications and of course #react-native-firebase/messaging.

Strategy for notification checking

Is there a recommended strategy for checking of notifications within my AngularJS app?
By 'notification' I'm talking about message alerts that are to be displayed to a user when they're logged into the application.
My plan is to notify the user of unread notifications in the app's NavBar as shown below:
My app communicates with my restFul API (written using Node.js, express, MongoDB), so I anticipate that new notification will be written to a MongoDB collection with details the user the notification is intended for.
What I'm unsure about is how the AngularJS application will check for notifications once a user is logged on. I could call my API for unread notifications every time the user navigates from one path to another but that seems simplistic and it wouldn't work if a new notification occurs whilst a user is viewing a page.
Another way would be some sort of timer system that checked, say, every 30 seconds. But this would results in unnecessary polling of my API when there aren't any new notification for a user.
So, wondering if there is a recommended strategy. Thanks for your help.
Polling is a solution but it is very inefficient. The solution to your problem are websockets. Websockets is a technology that provides a full-duplex bidirectional communication between your clients and your server. So you can send messages from your server to your connected clients. Your server maintains an array of connected clients and you just have to know which ID you need to send a message to it.
For your stack, the best solution I have came to is Socket.io http://socket.io
It also have cool features. For example, you can "observe" models, so if a model change in your database, for example an update to a user profile is made, you can trigger an event and automagically send a message to your client. This client get and handles the notification and do something, like put a badge on your alerts icon.
Hope this is useful for you.

Sending an Email Behind the Scenes

I am currently trying to figure out how to send an email behind the scenes. Basically, I don't want an MFMailComposeViewController popping up making me press the send button. All the fields are pre-populated so there is no need to type anything out. Is this possible? Will I have to use another framework?
Thanks
You'll have to use your own mail server (or ask the user for credentials for their own, which you probably don't want to do). The iOS SDK intentionally doesn't allow you to send an email on behalf of the user with no user interface; making the user press "Send" is the whole idea so that they are never surprised.
Apps that push email out automatically either do so from their own servers, or integrate with a server framework like Mailgun, or Parse, or etc, that offer this feature.
I've done that in one of my apps using Mailgun, which is a hosted email web service.

IOS implementation of simple messaging system (client/server) between clients

i've been looking around to find a simple library or a client/server sample code for implementing a messaging system between users of my IOS clients app and a REST server. I would need that each user has an incoming and sent messages view. This view would display the conversations grouped by user. For example, using a table view where each cell represent a thread between the 2 distinct users, selecting a user's conversation it would push a new view that would display all the messages between the two users.
I have to say that i didn't found much, this is a mix of libraries and front ends:
an XMPP objective-c library: https://github.com/robbiehanson/XMPPFramework, but i don't really want an IM behavior
Acani chat, https://github.com/acani/AcaniChat seems promising but waiting for the acani chat server, i could use the front end
another chat https://github.com/honcheng/iOS-nodechat
MailCore, an IMAP api for objective-c: https://github.com/mronge/mailcore . i would need to relay on a mail server, create emails for each user and ... too much!
too bad there isn't any iMessage API
dont want to send a SMS or an email
push notification it's not a must to start
maybe coding a simple REST service for publishing and retrieving messages to and from a user would be the best approach? i'm i missing something?
thanks!!

How does push work on ipod touch with respect to auth credentials?

I installed this instant messenger program called IM+ that keeps your accounts online even when you exit the application (you know... touch: only one app at a time) it accepts push deliveries to report you have a message.
I am kind of puzzled on how they can keep me logged in and send me a push notification that someone is messaging me. I noted the same happens for mail. If I receive a mail, even if I don't have mail open, a badge appears near the icon.
My main concern is the password. How does push work? does it mean that apple or the company behind IM+ stores my email and instant messenger passwords to keep me logged in and push me a notification when I have something new ?
Edit: ok... the tumbleweed is a bit too much for such a question.
Read this to understand how it works: Apple Push Notification Service