Native.showPopup opens menu on Android - lua

I'm trying to send an email from my game. This is the function involved:
local function showMailPicker()
-- Create mail options --
local options =
{
to = "my#email.com",
subject = "some text",
body = " ",
attachment = { baseDir=system.DocumentsDirectory, filename="file.txt", type="text" },
}
-- Send mail --
native.showPopup("mail", options)
end
this function is then triggered on a touch event. but instead of getting straight to the email program on android, I get the selection menu for Facebook, Twitter, SMS, bluetooth, gmail, ...
Can this be avoided?

I would just ask, why would you want to bypass this?
I have my work email + hotmail account in the "email" application, plus a gmail account in the "gmail" app.
I would much prefer that it came up with the "which application would you like to use" when I try to send an email rather than going straight to the email app.

Related

How imap.seqno works in nodejs?

My Node app is using imap module to retrieve emails:
var f = imap.seq.fetch('1:3', {
bodies: ['HEADER.FIELDS (FROM TO SUBJECT DATE)', 'TEXT'],
struct: true
});
The app fetches emails with seqno 1-3 in gmail mail box. However I did not see those 3 emails in the mail box and only found them by searching the email subject. It seems the imap module retrieve some real old emails which are not visible in the mail box. I am wondering how seqno is issued in a mail box and weather a seqno for an email is unique and stay unchanged after issuing.

Facebook plugin for phonegap ios application - share on the wall

I am trying to share from my phonegap ios application. I use this code to post to my facebook wall
var facebookConnectPluginPostToTheWall = function () {
var options =
{
method: "feed",
name: "Shared via my cool app",
message: "This is a post shared from my app. I have earned 300xps."
};
facebookConnectPlugin.showDialog(options,
function (response) {
alert(JSON.stringify(response))
});
};
And it shares the post to the facebook, but I can't make it work with these preset values for message, title etc. It just shares the text I enter in the popup shown after calling this function. I hope someone can help with this.
The feed dialog does not accept any prefilled messsage - but prefilling is not allowed anyway, the message always must be 100% user generated.
If you want to post without a dialog, you have to authorize the user with publish_actions and use the feed API: https://developers.facebook.com/docs/graph-api/reference/v2.2/user/feed
But again, prefilling the message is not allowed. Read the platform policy for more information: https://developers.facebook.com/policy/

Send an email from my app without using MFMailComposeViewController

Is it possible to send an automatically generated email using my own email address to another email address of mine by clicking a button?
I tried to use MFMailComposeViewController but another view appeared. Can I do it without this view?
You can do it only by creating own server-side mailer. On button clicking you have to send request with all needed data (email address, body, subject, etc) and server will send mail.
If You want send directly from app - MFMailComposeViewController is the only LEGAL way
By default in iOS you can only use the MFMailComposeViewController, which uses the user's mail account. Therefore you cannot send fully automated mail messages (the user allways has to confirm/cancel).
libMailCore is a great iOS framework which allows you to generate and send mails without any user interferance. In that case you'll be using your own server/credentials (thus not the user mail account). There are apps in the App Store using mailcore, so i would guess it's legit.
Yes there is a way using Swift-SMTP.
Send email
Create a Mail object and use your SMTP handle to send it. To set the sender and receiver of an email, use the User struct:
let drLight = Mail.User(name: "Dr. Light", email: "drlight#gmail.com")
let megaman = Mail.User(name: "Megaman", email: "megaman#gmail.com")
let mail = Mail(
from: drLight,
to: [megaman],
subject: "Humans and robots living together in harmony and equality.",
text: "That was my ultimate wish."
)
smtp.send(mail) { (error) in
if let error = error {
print(error)
}
}

how to receive mail and send notification to the user in rails?

I have been trying to receive emails in rails using IMAP and send a notification to user that new mail has come. I have a table namely "email" where i have to store the email information like message_from, message_to, message and i wanted to know how to fetch the emails from the gmail whenever a new mail comes in. And the following is the code
require 'net/imap'
require 'net/http'
imap = Net::IMAP.new('imap.gmail.com', 993, usessl = true, certs = nil, verify = false)
imap.login('sampleuser', 'password')
imap.select('INBOX')
imap.search(["NOT", "SEEN"]).each do |message_id|
emails = imap.fetch(mail,'RFC822')[0].attr['RFC822']
#mail = Email.new("from" => emails.from, "to" => emails.to)
#mail.save
end
but i cannot able to fetch the message_from or message_to or the message, it shows error as
TypeError (can't convert Symbol into Integer):
how can i get those details and i want to send notification to the user when a new entry is created in the table and clicking on that should take it to the page where i have to display the email.
How can i do this and should i be using something like scheduler to check if the new mail has come and if i am not reading the mail how can i identify that i have received the mail already and i do not want to duplicate. Please help me.
Your best bet on receiving emails is Griddler. It's easy to setup
You can send the email to the model you want and do the processing there.

how to share a link via sms in blackberry

I am building an application where I need the option to share via email and SMS.
I have done the share via Email, where when the user selects the image, the url is passed as the content of the email. But while sharing via SMS, I can't do something like setContent as I did for email and fetch the url in the SMS directly, instead of user typing the address manually.
I am using Message class in email and MessageConnection class for SMS, as shown in the blackberry community example.
The Message object you receive when calling MessageConnection.newMessage(TEXT_MESSAGE) is actually a TextMessage object (or a BinaryMessage object with BINARY_MESSAGE).
If you cast the received object to the proper class (TextMessage or BinaryMessage), you should be able to use its setPayloadText(String data) (or setPayloadData(byte[] data) for a BinaryMessage) to enter a value in the message before sending it.
Your code should look like this:
Message msg = myMessageConnection.newMessage(TEXT_MESSAGE, /* address */);
TextMessage txtMsg = (TextMessage)msg;
txtMsg.setPayloadText(/* Text to send */);
myMessageConnection.send(msg);
When you send an email, you can set the body of it and send it to the user from the Email native application. You cant do taht for SMSs. I worked on that issue and for BB Torch I was able to set the text of the SMS message but for other devices that was impossible. I always obtain an empty text message!!
So y suggestion to you is using the following code wich will send the SMS to a number without the interference of the user
MessageConnection conn = (MessageConnection) Connector.open("sms://" + userNumber);
TextMessage txtmessage = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
txtmessage.setPayloadText(text);
conn.send(txtmessage);

Resources