How to get gmail notification when new email arrives? - oauth-2.0

I have created a java web application that authenticates the gmail user using OAuth API. Currently I have to check for any new email at regular interval. Now I want to get notification from gmail when a new email arrives. Doing this it will save my calling gmail API at regular interval. Please help.
Thanks.

try using Atom feed; it's a XML feed provided by gmail containing all new emails in the inbox

Related

Send email using Graph API only from few user accounts in background process

I have a background application ( azure function ) which needs to send email from our service account to set of the users under same tenant . I am planning to use the GRAPH api to send the email and I can achieve it using below steps
a. Register an app in azure directory
b. Assign the application permission to send email as any user
c. Get the admin consent for that permission
d. write c# code to get the token and call graph api to send email
I do not see issue with the above approach except the fact that we will be getting the consent to send email as any user , which is quiet dangerous , this will enable me to send email as CEO or CFO of our company
could you please help or guide me if there is any way to send email on behalf of other user using graph api for demon applications ?
Regards,
Kumar
You can scope the Service principal permission just to the mailboxes you need to send as https://learn.microsoft.com/en-us/graph/auth-limit-mailbox-access. The other way is to have a service account and the grant it delegate access to mailboxes you want to send as but this is generally less secure and harder to maintain (eg you have username and password).

Sending email without showing email composer view in ios 7

I'm making an iOS app and the user has to enter their info to register for an account. I'm wanting to make it so that it sends an email to the provided email account with the info that they just entered. But I don't want them to be able to see the email view. Is there a way to send an email in the background in iOS 7? I'm familiar with the SMTP Gmail workaround but I was wondering if there was anything more generic.
There is no documented API available using which you can perform this.
send this detail to your server via web service and than server will send the email using that detail.

Sending a Facebook private message within app

I already have an active Facebook session in my app, and want to be able to send a private message to a friend using the access token I already have. The closest I've gotten is to open a UIWebview to the touch interface, but the user will need to log into Facebook again before being able to send a message. Is there a way to send a private message using the session that is already active, and ideally, using my own interface? If I could send an email to the username#facebook.com programmatically, that would be perfect, but that isn't possible in iOS that I know of.
As I understand it, here are the options to send messages to friends in iOS:
Send an email using the mail composer to the username#facebook.com (unable to send email programmatically, otherwise this will be perfect)
Send an app request/post on the wall using the Facebook SDK
Open a webview (and log into Facebook again) show the touch dialog for messaging
Is there anything I'm missing?
I found that you can send private Facebook messages using the Facebook Chat API using XMPP.
https://github.com/robbiehanson/XMPPFramework
Quickblox has some sample code that demonstrates how to send FB messages.

Parsing and Receiving Email in iOS

Suppose I have an email address that only receives a specific type of email, i.e. an automatically generated receipt email from a transaction.
I would like to build an iOS app to receive the email text from this email address and parse according to a predefined format and display the results. Is it possible to do this without dealing with the email server directly from the app?
Meaning can I for instance piggyback off the native mail client (assuming it is set up to receive pushed email sent to the email address). I tried looking through Apple's docs for iOS but could not find anything useful. Anyone know of something?
3rd party apps have no way to integrate with the Mail app or to make use of any configured mail account the user has setup on the device.
However, you can write an app that can access external email accounts if the user provides all of the usual email account details. The App Store has several 3rd party mail apps that serve as replacements for Apple's Mail app.
If your app is written to work with a specific email account, and not one entered by the user of the app, then you can hardcode all of the account details in the app.
Your app is basically a run of the mill email client. You just have to know how to access IMAP or POP3 accounts, retrieve the emails, and process them as needed.
Again, there is no way your app can intercept or make use of any emails accessed by any email accounts the user has setup for use with the standard Mail app.
There are at least two aspects to your question:
How do I get an email to open in my iOS app?
Put the data in an attachment and see this link
What format can I use in an email attachment to transport persistent
objects?
I've had decent results with NSKeyedArchive as an interchange format. There are lots of other choices, depending on what generates the receipts attachments.
Post a followup with your choices. Good luck!

Send Message using Facebook API attaching an App Link

I need to send a Facebook new message using Facebook PHP sdk or Javascript sdk. This message should be attached a link for a Facebook app. please check this image, Then you can understand about what I exactly want.
New Message with Link Attachment Image
Please anyone can help me?
This is not currently possible. Applications are prevented from sending private messages to their users (or any users for that matter) because it would be a serious vulnerability for spam.
One Alternative
would be to request the email permission from your applications users and then using
Graph API
or
FQL - Facebook Query Language
you'll be able to request the email of the user and send him an email using some code on the server.
You can read more about requesting permissions for facebook applications at these links :
https://developers.facebook.com/docs/reference/api/permissions/
https://developers.facebook.com/docs/authentication/
Another Alternative
would be to utilize facebook dialogs and initiate a 'request' or 'apprequest' dialog. For this you'll need to implement the Facebook JavaScript SDK and the Request Dialog.
The Request Dialog
When you initiate this dialog you can specify a message to be sent along with the request. When a user responds to one of these requests they are redirected to your application.
(source: fbcdn.net)

Resources