Is it possible to implement an IMAP push client in iOS? - ios

Would it be possible for me to implement a client that is capable of receiving IMAP push messages, without the awareness of the user (i.e. they are not displayed in an inbox etc.)

Yes. You can create a job (corn) to check for emails every few often and send a push message (apns) to the user (using your app) with the email message attached as body.

Related

Sending push notifications from one device to another in iOS

I am creating an iOS application in which user orders an item, when the order ready, the vendor is supposed to inform the user via push notification.
My question is, is it possible to send push notification from one device to another?
For this purpose I want to use FCM. I read that they allow two sorts of messages.
Downstream, messages from server to device.
Upstream, messages from device to server.
Will upstream messages serve the purpose according to my requirement? If so, how am I supposed to implement them?
Let's say you were using Firebase, so for every registered users there is an ssociated device token id save into some collection right. (Registering flow)
Let's say you were using cloud functions (a vague definition would be function that are running into serverless architecture, and they get executed when there are called)
so you'd call this function from your app via HTTP with Post Method
logic:
- extract that http request
- who is sending the message (uid, message)
- who needs to receive that message (someone)
- query that someone's device token id and save it to recipient_device_token_id
- construct to push notification payload (message)
- send push notification for recipients using its recipient_device_token_id
- end the http response
Voila, I am sure there is other way of doing it, but this extracting all the logic from your app to the cloud.

GroupChat Push Notification on XMPP

We are developing an xmpp application on IOS and Android. We are using ejabberd as the xmpp server and we are also using mod_interact (https://github.com/adamvduke/mod_interact) to inform our webservers to send push notifications to clients for their offline messages:
Flow is like this:
Sender sends the message to ejabberd
Ejabberd receives the message and check if the receipant is online
If the receipant is offline ejabberd saves the offline message
mod_interact works when an offline message received by ejabberd and deliver the message to our webservers
Web server finds the push notification informations about clients and sends the push notification
Its working very well on 1 to 1 chat. But in group chat(MUC) mod_interact doesnt work and I cannot send push notification to group receipants. Do you know any other solutions to fix that problem on both 1 to 1 and group chat.
Thanks
Look into ejabberd_mod_offline_post, it supports both one2one and MUC.
First config the Room must be a Member-Only room, and add all users as members right after you created it, so that be able to get a total.
Add above model into ejabberd models.
Implement a Callback Service to handle the callback post.
The idea is when User go offline:
In one-to-one case, offline_message_hook will be raised
In MUC case, muc_filter_message will be raised, and any one not Presence-Available is offline.

Push notification message customization?

I am working on chat application. Whenever someone send me a message I receive a push notification with text "A send a message to you".But sometimes I receive push with text "You have 4 new messages".(4 is the variable number). Server team claims that they are not sending this type of message.Just wanted to know if apple customize the message in any case.
No, Apple doesn't do that.
It has to be your server developers or some third party library they are using to send Push Notifications.

How to send and receive text messages without MFMessageComposeViewController?

I want to send and receive text messages without showing MFMessageViewController from my application. Could anybody tell me how is it possible?
Not Possible , Unless you use 3rd party api for send/received sms.
you have to use Web service and Apple Push Notification Service for send message to other user without using MFMessageComposeViewController
You can't do it without MFMessageComposeViewController. Apple won't allow to send SMS without user interaction.
I've alternate solution of this, out of scope of iOS. Use web service API. Create a web service at server side that send a message to specific number(s) that accept numbers as parameters with request.
At specific time interval (according to your requirement) send a web service call with number as request parameter.
Web server can do it. It can send message to any device.

Regional Monitoring and Push notifications in iOS

I need to update my users for things that happened around their current location while the app is in the background.
To my understanding:
If my server sends a Push Notification to a client, the client would immediately show that message.
I can set up the app so that there is a specific location, with a given radius could fire a message.
So what I want to understand if it is even possible to update my users about things that are new in their locations.
I was thinking of two possible solutions, I am not sure they are possible.
One, I guess if the Push Notifications would allow a function to run prior to its display,
deciding if the message should appear.
For example: something happened in area x,y - The server initiates a message to all devices. Only the devices within range of x,y and a radius z, would show the message to the users.
Maybe the Regional Monitoring service can send a message to my server and my server can then decide if to send a Push Notification back to the client...
For example
The user has entered a defined location, determined by the app. The app sends a message to the server. The server decides if a message is due.
Any ideas? is that even possible?
Filtering push notifications by topic is something you need to do on the server side, not the client side. Apple specifically states not to send messages to users that aren't relevant and you won't be able to block them when the app isn't running. Additionally, if you are using a service to manage your push notifications you don't want to pay for messages that aren't relevant.
So when you register a device into your database, you should register what topics that person is subscribing to (ie. save a list of topics that user is eligible to receive). Then when the event is triggered that generates the push notification only send to devices that are registered to that topic. I believe a number of push platforms have this capability already built in. On UrbanAirship and Azure Notification Hubs you can use their tags feature. Or you can develop it yourself if you do your own push server.
Take a look at Parse. They have this kind of functionality baked right in, just send the push to clients that match a geoPoint query.

Resources