Receive mails with Flutter - email

I want to create an app with Flutter for which it is necessary to receive (and send) mails. Clients share information with eachother in a decentral way using i.e. Googlemail without using an own server.
During my research I found several ways to send mails but no way to receive them since this seems to be not implemented yet in any package.
Flutter offers the option to use platform-specific code with platform channels (flutter plattform-channels) which might be a solution.
However I haven't tested this yet because I write the app for both iOS and Android which means that I'd have to do this for each java and Swift/Objective C.
Maybe someone here knows a better solution.

Related

Firebase Messaging in flutter sendMessage()

I am a flutter programmer and I use in my projects when it comes to pushing notifications Firebase cloud messaging using node.js
I just discovered that there is a method called sendMessage in the firebase_Messaging package in flutter but I looked every where for documentation and I tried everything to find out how it works but got nothing.
That's all what the package offers as information:
so if anyone used it before or can help me to understand it I would really appreciate it <3
Unfortunately this method does not do what you might think it does: it is not for sending messages from one device directly to another device through FCM, but rather an alternative protocol that is infrequently used these days (afaik).
The FlutterFire documentation describes the sendMessage method as:
Send a new RemoteMessage to the FCM server. Android only.
Unfortunately that is missing a few crucial details, so I recommend also checking out the Android documentation on the Firebase site, where this is covered under sending upstream messages, which starts with:
If your app server implements the XMPP Connection Server protocol, it can receive upstream messages from a user's device to the cloud.
Still a bit vague, but keep reading it also mentions:
Receive XMPP messages on the app server
When FCM receives an upstream messaging call from a client app, it generates the necessary XMPP stanza for sending the upstream message. FCM adds the category and from fields, and then sends a stanza like the following to the app server:
The key here is the mention of an app server. As many places explain: there is no way to directly send messages from one device to another, as doing so would allow any user to send any message they want to any other user, which is a security risk.
The sendMessage method you found allows you to send a message to the FCM infrastructure, which then forwards it to your app server. It isn't much used anymore these days, as tools like Cloud Functions offer (at least equivalent and probably better) scalability with better flexibility.

Flutter package for sending bulk sms without launching sms app

In my application, there gonna be about 400 users and we need to send them an sms notification. And I'm searching for suitable package, I asked almost same question about a month ago.
I was suggested sms package, but it doesn't support iOS. So I tried to look for other options, and I go through these packages:
sms_maintained (I guess it is the same package, but updated and maintained by different author)
Issues with this package:
Does not support <21 SDK version
Does not find option to send bulk SMS (looping the recipients is an option but maybe resource extensive and also difficult to keep track of failed sms)
It supports a lot of options and prompt for phone call permissions, I just need permission to send sms; even don't need to read sms so most of it's feature are unnecessary in my project
flutter_sms This package is almost according to my needs because it is clean and only performs one function which I need. But it doesn't work in the background, it launches sms app.
Q. Does anyone knows any solution/package for this?

Listening to incoming notifications Flutter

I am deciding whether to use Flutter for cross platform app. I have investigated in ways to implement other functionalities.
But I need one other feature to implement which needs listening to incoming notification from other app in background. (something like notification listener in Android)
While I was searching came across the issue here which may effect what I intend to implement.
Is there any way to achieve what I want in Flutter?
I am willing to write plugins in native languages if its possible.
You can benefit from platform channels to write a plugin to utilise native code for each platforms. This medium post explains how to execute dart in the background and have example code for Android (Kotlin) and iOS (Objective-C).
However, according to this SO post you are not able to create an similar service like a NotificationListener for iOS.

How to develop MvvmCross app with SignalR Chat Technology?

I have a simple app in Android, that uses some features like Services and Broadcast Receivers. It is a simple project, that uses SignalR to make a chat. A basic chat, where the service has the signalR connection and staying listening for any new messages or contact's status's updates.
Then, I have some broadcast receivers:
to start the service,
when receive a new message to add in the chatList
when receive a new contact online to update the contactList.
So it connects to a server that uses SignalR implementation, and do all the server job that is expected from a chatWebServer.
So, I'd like to re-write this app, using MvvmCross, so i could have a WindowsPhone, iOS and Android versions. I know the broadcast receiver could be changed for the Messages Services in MvvmCross, but the Android Services/ iOS Long Tasks/ WindowsBackgroundsTasks would be implemented as what in MvvmCross? Would be possible to have it implementation in Core project, so I can reuse it in all platforms? Can anyone help how would be it archtiecture?
Thanks in regard,
Gabriel Bastos
You will still need to rely on what the platform has available for you. So on Android you would still need to have a BroadcastReceiver or at least a Service which has the SignalR connection, otherwise it will not survive if the application is closed.
iOS and Windows is a bit of a different story, there you are not allowed to have stuff running in the background. So here you would probably need to use push notifications to notify of new messages. Although on Windows Phone you can have Scheduled Tasks or also called Background Agents here I think you can do something every 60 seconds at most.
On iOS you are out of luck you simply can't do stuff in the background unless you are using the built in Location Services or something like that.
MvvmCross does not do anything magically, nor does it allow to create a service which does something the platform does not provide.

Messaging service within my app

I need to implement a message service into my app that works exactly like this:
users register with a nickname within the app
they can add contacts (just nicknames) and send them a message by just specifying their nickname
they can send a message whenever they want, and the message is stored on a server until when the receiver connects to internet.
when a message is received, a push notification is triggered.
So, the messages work pretty much like emails, however instead of using email addresses, we only use usernames. I'm also going to build my own back-end for it.
Which APIs should I use or which 3rd party framework can I use ?
And any tip ?
N.B. I need to make it work with iOS 3.0 as well.
and in the future I will develop an Android app, so the nicknames should be unique and I should be able to send messages from iPhone to Android devices within the same app.
thanks
I've successfully used the Three20 library and would recommend giving it a try. It's an open source spin-off originated by the author of the Facebook app. It features a bunch of additional GUI components that might be useful to your project, like a message composer that resembles the one used by Apple's email app.
Also, Three20 features a nice framework for handling navigation within your app. Currently, the biggest drawback seems to be that certain features don't play well with the iPad API.
The answer seems to be Push Notifications