Add email and print facility to Share icon on navigation bar in an iPad application - objective-c

I am working on an application for iPad. This application has some PDF files and some mp4 videos. I have a share icon on the navigation bar. When the user clicks on the share icon it shows option to email or print that particular file. I want to add both email and print facility to all the pdf files and only email facility to all videos. I need help in getting this done. Help with code would be great.
Any help will be highly appreciated.
Regards
PC

How to send email: How can I send mail from an iPhone application
How to print: http://cocoacoding.com/2011/05/01/airprint-tutorial/
How to create an action sheet: http://ykyuen.wordpress.com/2010/04/14/iphone-uiactionsheet-example/
Put it all together:
Add an Action Sheet button to your UI.
Create action sheet with options for email and printing, depending on the content.
Depending on the clicked button, start sending an email or printing.

Related

Take a screenshot in appcelerator and send it by email

How do I take a screenshot in appcelerator using a click event and send it using email? I have developed a floating action bar and want to associate a click event with it that takes a screenshot of the current screen and then opens an email dialog.
I tried the following:
$.btnScreen.addEventListener("click",function(e){ Ti.Media.takeScreenshot(function(){
I see you're calling the right method, but you're not actually capturing the blob. You should do something along these lines: (keep in mind, email dialog doesn't work in simulator)
Ti.Media.takeScreenshot(function(blob){
var dialog = Ti.UI.createEmailDialog();
dialog.addAttachment(blob.media);
dialog.open();
});

Activity Indicator on "Send" button and "Save Draft" button on MFMailComposeViewController in iPad

In my iPad application, I am playing some PDF and Video files. In the application user have option to email these files to himself or a friend. Email functionality is working fine and email gets delivered too. However, when user presses send button to send the email it freezes the application for sometime, also, when user presses Save Draft button to save that email, it freezes too. I think this happens because of large size of the PDF or Video file being attached and since it takes time to attach a file. When app freezes it seems like as if the iPad has hung or the app is crashing. However, it is working fine. But it doesn't look good. That is why I need to apply an activity indicator when Send or Save Draft button is pressed. It should work till the file is attached. I would apply an activity indicator, but not sure how to apply it on Send and Save Draft buttons as they come automatically in Email modal view controller.
Thanks in advance
PC
I have also experienced the same problem. Not because of the size of an attachment. It happens arbitrarily, Here's a workaround:
Enter anything in the "To:" field and then immediately backspace over it.
The "Send" and "Cancel" buttons should start working again.
If not, Quit Mail by double tapping the "Home" key, press and hold the "Mail" icon, when a minus signal shows press it on the "Mail" icon.
Relaunch mail. Your previous work should be intact.
Hope this helps.

How to add email facility in an iPad app?

In my app for iPad I have several videos and pdfs. What I want is when user is watching a video or reading a pdf and if he wants to email that video or pdf to himself or to his friends, then how would he do it? I have added a button on the navigation bar for this purpose. When the user clicks that button an option should appear which should say "Email". now when the user selects Email, the app asks the user to enter an email address. After entering email address the user presses "Send" button. And that particular file is sent to the user's email. How can this be done?
Thanks
Take a look at MFMailComposeViewController class. It provides access to standard mail functionality and it includes addAttachmentData:mimeType:fileName: method to add attachments (and you also don't need to present custom UI for e-mail address).
However, if files are big (video), it makes sense to put them somewhere to your server and send only links and in this way avoid sending big attachments. This is important because many mail servers will not allow big attachments (10MB is already big).
I'm guessing you'd use MFMailComposeViewController, the same as for iPhone.

Compose a new message in the mail app by a clicking a button

I'm working on a Mac app and I want the user to be able to contact me via email. So I was thinking that there was going to be a button that says contact or something and when the user click on the button it will open the mail app and compose a new message that will be sent to my email address already added.
So kinda like an in app mail function that you can add on the iPhone and iPad apps.
Is this possible?
Using NSWorkspace's -openURL: method you can open a standard mailto: link which can include subject and body and it will launch user's default e-mail app (usually Mail) with pre-populated fields.
mailto:you#domain.com?subject=hello&body=text

Display Pop-Up in PDF when Clicked or Typed?

I have a collection of example documents in PDF forms that are viewed by clients, They all include a "Example" watermark prominently displayed but I have had some issues with clients trying to fill in the example forms and submitting as Official forms, normally followed by a support phone call from the client. I am looking for a way to pop up a message in the pdf if the client trys to type or click in the example document, I know how to pop up a message if they click in a form field but some of my documents do not have any form fields so I am looking for a way to show a message if a client trys to type or click anywhere in the actual document. I am using Acrobat X Pro.
Does anyone know of a way to do this?
Thanks in advance for any advice!!
Plop a big invisible button (not hidden, invisible) over the entire page, with a click action that pops up a message dialog with whatever warning you wish.