Search Results

Search found 36 results on 2 pages for 'mfmailcomposeviewcontroll'.

Page 1/2 | 1 2  | Next Page >

  • Hide/ change width/ change position of UIButton based on device type

    - by Giles Van Gruisen
    I'm using the new in-app SMS features in my iPhone app, but obviously iPod Touches aren't able to send and receive SMS without support of a third party app. I know all well how to detect the device and how to hide a UIButton, but what I do not know is how to change the width of the others. Above are the three icons. The one on the far rights needs to be hidden on an iPod Touch, and the other two need to adjust size/ position to fill the remaining space. Any tips on programatically changing the position and width of a UIButton is greatly appreciated. Thanks!

    Read the article

  • iPhone MFMailComposeViewController's "cancel" button displays Action Sheet w/ incorrect orientation.

    - by user211790
    I've been trying to add in-app email functionality and have been somewhat successful. The MailCompose view is displayed properly. But when "Cancel" is pressed the Action Sheet with "Delete", "Save as Draft" and "Cancel" animates in from the left as if the view controller is set to portrait mode*, yet the width (or height depending on how you look at it) is that of an action sheet in landscape mode as seen in the following image: http://dansandland.com/storage/screen-shot-2.png *The view controller is set to Landscape Left, both in the plist file and the shouldAutorotateToInterfaceOrientation method of all view controllers. MFMailComposeViewController code in a view controller: MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; controller.mailComposeDelegate = self; [controller setSubject:@"In app email..."]; [controller setMessageBody:@"...email body." isHTML:NO]; [self presentModalViewController:controller animated:YES]; [controller release]; Any ideas?

    Read the article

  • how to display image in MFMailComposer?

    - by Rahul Vyas
    Hello all i want to display an image in mfmailcomposer it shows when i add it to attachment but not at the exact place where i want to show it how do i show image in mfmailcomposer. also does someone knows how to launch safari when click on a url in mfmailcomposer?

    Read the article

  • cocos2d MFMailComposeViewController

    - by MRaguse
    hi, i tried to insert a mail tool in my app.... my app is based on the cocos2d engine the Toolbar (at the top -cancel,send...) is visible but i can't see the other parts of the mfMailComposerViewController view :-( code: -(void)displayComposerSheet { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:@"my message"]; // Set up recipients NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"]; NSArray *ccRecipients = [NSArray arrayWithObjects:@"[email protected]", @"[email protected]", nil]; NSArray *bccRecipients = [NSArray arrayWithObject:@"[email protected]"]; [picker setToRecipients:toRecipients]; [picker setCcRecipients:ccRecipients]; [picker setBccRecipients:bccRecipients]; // Attach an image to the email UIImage *screenshot = [[Director sharedDirector] screenShotUIImage]; NSData *myData = UIImagePNGRepresentation(screenshot); [picker addAttachmentData:myData mimeType:@"image/png" fileName:@"AdMotiv"]; // Fill out the email body text NSString *emailBody = @"test"; [picker setMessageBody:emailBody isHTML:NO]; [[picker view] setFrame:CGRectMake(0.0f,0.0f,320.0f, 480.0f)]; [[picker view] setTransform:CGAffineTransformIdentity]; [[picker view] setBounds:CGRectMake(0.0f,0.0f,320.0f, 480.0f)]; //[[[VariableStore sharedInstance] parentView] setTransform: CGAffineTransformIdentity]; //[[[VariableStore sharedInstance] parentView] setBounds : CGRectMake(0.0f, 0.0f, 480.0f, 320.0f)]; UITextField *textfeld = [[UITextField alloc] initWithFrame:CGRectMake(50.0f, 50.0f, 100.0f, 100.0f)]; [[picker view] addSubview:textfeld]; [[[VariableStore sharedInstance] window]addSubview:picker.view]; [[[VariableStore sharedInstance] window] makeKeyAndVisible]; [picker release]; }

    Read the article

  • New line and returns ignored in setMessageBody

    - by Magic Bullet Dave
    Am I doing something dumb? I can pre-fill and email ok but the "\r\n" is ignored in the emailBody: - (void) sendEventInEmail { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; NSString *emailSubject = [eventDictionary objectForKey:EVENT_NAME_KEY]; [picker setSubject:emailSubject]; // Fill out the email body text NSString *iTunesLink = @"http://itunes.apple.com/gb/app/whats-on-reading/id347859140?mt=8"; // Link to iTune App link NSString *content = [eventDictionary objectForKey:@"Description"]; NSString *emailBody = [NSString stringWithFormat:@"%@\r\nSent using <a href = '%@'>What's On Reading</a> for the iPhone.", content, iTunesLink]; [picker setMessageBody:emailBody isHTML:YES]; picker.navigationBar.barStyle = UIBarStyleBlack; [self presentModalViewController:picker animated:YES]; [picker release]; } Regards Dave

    Read the article

  • how to customize navigationbar color of MFMailComposeViewController?

    - by RAGOpoR
    from this code will show in original color how can i change it to another color? maybe it need to be override? MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init]; mail.mailComposeDelegate = self; if ([MFMailComposeViewController canSendMail]) { [mail setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]]; [mail setSubject:@"support"]; [mail setMessageBody:@"enter your message here" isHTML:NO]; [self presentModalViewController:mail animated:YES]; }

    Read the article

  • How to set title in the MFMailComposerViewController ?

    - by Biranchi
    Hi All, I am trying to set the title of MFMailComposerViewController , which is a subclass of UINavigationController. I am using these following ways : MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; [picker.navigationController navigationItem].title = @"Send Mail"; [[picker navigationItem] setTitle:@"Send Mail"]; But I am not able to set the Title. Am i doing it wrong ?? Is there any other method to do so ?? Thanks

    Read the article

  • MFMailComposeViewController in landscape

    - by Jatin
    My application is in landscape mod.When i call MFMailComposeViewController through Present model view, it comes in landscape mod.I rotate device and MFMailComposeViewController view goes to portrait mod i want to restrict this rotation it should always be in landscape mod only.Is there any way to do it..

    Read the article

  • MFMailComposeViewController hangs my app

    - by Neal L
    Hi, I am trying to add email functionality to my app. I can get the MFMailComposeViewController to display correctly and pre-populate its subject and body, but for some reason when the user clicks on the "Cancel" or "Send" buttons in the nav bar the app just hangs. I inserted a NSLog() statement into the first line of mailComposeController"didFinishWithResult:error and it doesn't even print that line out to the console. Does anybody have an idea what would cause the MFMailComposeViewController to hang like that? Here is my code from the header: #import "ManagedObjectEditor.h" #import <MessageUI/MessageUI.h> @interface MyManagedObjectEditor : ManagedObjectEditor <MFMailComposeViewControllerDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate> { } - (IBAction)emailObject; @end from the implementation file: if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init]; mailComposer.delegate = self; [mailComposer setSubject:NSLocalizedString(@"An email from me", @"An email from me")]; [mailComposer setMessageBody:emailString isHTML:YES]; [self presentModalViewController:mailComposer animated:YES]; [mailComposer release]; } [error release]; [emailString release]; and here is the code from the callback: #pragma mark - #pragma mark Mail Compose Delegate Methods - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error { NSLog(@"in didFinishWithResult:"); switch (result) { case MFMailComposeResultCancelled: NSLog(@"cancelled"); break; case MFMailComposeResultSaved: NSLog(@"saved"); break; case MFMailComposeResultSent: NSLog(@"sent"); break; case MFMailComposeResultFailed: { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error sending email!",@"Error sending email!") message:[error localizedDescription] delegate:nil cancelButtonTitle:NSLocalizedString(@"Bummer",@"Bummer") otherButtonTitles:nil]; [alert show]; [alert release]; break; } default: break; } [self dismissModalViewControllerAnimated:YES]; } Thanks!

    Read the article

  • MFMailComposeViewController broke CSS styles in html template

    - by Victor
    I use MFMailComposeViewController to send a message in html format. If my html template contains the css styles: <div class="margin:10 10 10 0"> <a href="domain.name">Go To</a></div> In this case it works good. But if I send: <a href="domain.name">Go&nbsp;To</a> then I see the letter that comes with broken styles as there (3D is not my misprint) <div style=3D"margin:10 10 10 10;"><a href=3D"www.google.com">Go=C2=A0To</a></div> Well as the letter goes broken when I insert in the template symbols from national alphabets. Somebody can tell what the problem and check with yourself?

    Read the article

  • How we should load the MFMailViewController in cocos2d ?

    - by srikanth rongali
    I am writing an app in using cocos2d. This method I have written for the selector goToFirstScreen: . The view is in landscape mode. I need to send an email. So, I need to launch the MFMailComposeViewController. I need it in portrait mode. But, the control is not entering in to viewDidLoad of the mailMe class. The problem is in goToScreen: method. But, I do not get where I am wrong ? -(void)goToFirstScreen:(id)sender { NSLog(@"goToFirstScreen: "); CCScene *Scene = [CCScene node]; CCLayer *Layer = [mailME node]; [Scene addChild:Layer]; [[CCDirector sharedDirector] setAnimationInterval:1.0/60]; [[CCDirector sharedDirector] pushScene: Scene]; } This is my mailMe class to launch mail controller #import <UIKit/UIKit.h> #import <MessageUI/MessageUI.h> #import <MessageUI/MFMailComposeViewController.h> #import "cocos2d.h" @interface mailME : CCLayer <MFMailComposeViewControllerDelegate> { UIViewController *mailComposer; } -(void)displayComposerSheet; -(void)launchMailAppOnDevice; @end #import "mailME.h" @implementation mailME -(void)viewDidLoad { NSLog(@"Enetrd in to mail"); Class mailClass = (NSClassFromString(@"MFMailComposeViewController")); if (mailClass != nil) { if ([mailClass canSendMail]) { [self displayComposerSheet]; } else { [self launchMailAppOnDevice]; } } else { [self launchMailAppOnDevice]; } } -(void)displayComposerSheet { CCDirector *director = [CCDirector sharedDirector]; [director pause]; [director stopAnimation]; [director.openGLView setUserInteractionEnabled:NO]; mailComposer = [[UIViewController alloc] init]; [mailComposer setView:[[CCDirector sharedDirector]openGLView]]; [mailComposer setModalTransitionStyle:UIModalTransitionStyleCoverVertical]; MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:@"Hello!"]; NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"]; [picker setToRecipients:toRecipients]; NSString *emailBody = @"It is not working!"; [picker setMessageBody:emailBody isHTML:YES]; [mailComposer presentModalViewController:picker animated:NO]; [picker release]; } - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { switch (result) { case MFMailComposeResultCancelled: break; case MFMailComposeResultSaved: break; case MFMailComposeResultSent: break; case MFMailComposeResultFailed: break; default: break; } [mailComposer dismissModalViewControllerAnimated:NO]; [[UIApplication sharedApplication] setStatusBarOrientation:CCDeviceOrientationLandscapeLeft animated:NO]; CCDirector *director = [CCDirector sharedDirector]; [director.openGLView setUserInteractionEnabled:YES]; [director startAnimation]; [director resume]; [mailComposer.view.superview removeFromSuperview]; } -(void)launchMailAppOnDevice { NSString *recipients = @"mailto:[email protected]?&subject=Hello!"; NSString *body = @"&body=It is not working"; NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body]; email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]]; } - (void)dealloc { [super dealloc]; } @end

    Read the article

  • There is no attachment in the sent mail by iPhone

    - by naruhodo
    I'm trying to send a recorded sound file as attachment with MFMailComposeViewController. The sound file is OK. The picker shows the correct file name, shows the audio file icon as attachment, sends the mail, but there is no attachment in the result. I attached below the source of the sent mail. There is a "text/plain" content type part instead of "Content-Disposition: attachment;" as expected. This is my code code to define the path and attach the audio file. What could be wrong? #define DOCUMENTS_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] #define FILEPATH [DOCUMENTS_FOLDER stringByAppendingPathComponent:[self dateString]] ... NSURL *url = [NSURL fileURLWithPath:FILEPATH]; self.recorder = [[AVAudioRecorder alloc] initWithURL:url settings:settings error:&error]; ... MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; NSURL *url = [NSURL fileURLWithPath: [NSString stringWithFormat:@"%@", [self.recorder url]]]; NSData *audioData = [NSData dataWithContentsOfFile:[url path]]; [picker addAttachmentData:audioData mimeType:@"audio/wav" fileName:[[url path] lastPathComponent]]; and the source of the sent mail: Content-type: multipart/mixed; boundary=Apple-Mail-1-614960740 Content-transfer-encoding: 7bit MIME-version: 1.0 (iPod Mail 7E18) Subject: Sound message: Date: Sun, 11 Apr 2010 11:58:56 +0200 X-Mailer: iPod Mail (7E18) --Apple-Mail-1-614960740 Content-Type: text/plain;     charset=us-ascii;     format=flowed Content-Transfer-Encoding: 7bit It is a text here --Apple-Mail-1-614960740 Content-Type: text/plain;     charset=us-ascii;     format=flowed Content-Transfer-Encoding: 7bit Sent from my iPod --Apple-Mail-1-614960740--

    Read the article

  • How can i attached iphone image through MFMailComposerView in iphone

    - by Pugal Devan
    Hi, I am new to iphone development. I have created a button in the view. On clicking the button it loads the photolibrary from the Iphone. Now i want to attached the those selected image through mail. I donno how can i attached the image in MFMailComposerView. How can i achieve this, Here my code is, -(IBAction) Pictures:(id)sender { self.imgpicker = [[UIImagePickerController alloc] init]; self.imgpicker.delegate = self; self.imgpicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:self.imgpicker animated:YES]; } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img1 editingInfo:(NSDictionary *)editInfo { [[picker parentViewController] dismissModalViewControllerAnimated:NO]; UIView *view = [[UIView alloc] init]; (This view for displaying the images) **imageview** = [[UIImageView alloc] initWithImage:img1]; [imageview setFrame:CGRectMake(0, 0, 320, 420)]; [self.view addSubview:imageview]; [view release]; UIBarButtonItem *rightbutton = [[UIBarButtonItem alloc] initWithTitle:@"Email" style:UIBarButtonItemStyleBordered target:self action:@selector(rightbutton)]; self.navigationItem.rightBarButtonItem = rightbutton; [rightbutton release]; } -(void) rightbutton { ***[self emailImage:(UIImage *)image]***;(I donno how to pass the image instance to mail view) } - (void)emailImage:(UIImage *)image { picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]]; NSData *data = UIImagePNGRepresentation(image); [picker addAttachmentData:data mimeType:@"image/png" fileName:@"iPod Library Image"]; [self presentModalViewController:picker animated:YES]; [picker release]; } Plese help me out. Thanks.

    Read the article

  • how to know email address of sender

    - by maddy
    hi, how to know email-Id of sender using MFmailComposerView controller.My requirement is to get all email-Id's who are sending mails using my application. i tried by adding Bcc to my mail-Id. But it may erase by user(sender), so i will not get his/her mail-Id. So how to overcome this issue. is it possible to get email-Id's of all using our Application

    Read the article

  • How can i attached iphone image through mail in iphone

    - by Pugal Devan
    Hi, I am new to iphone development. I have created a button in the view. On clicking the button it loads the photolibrary from the Iphone. Now i want to attached the those selected image through mail. I donno how to attach the image in MFMailComposerView. How can i achieve this, Here my code is, -(IBAction) Pictures:(id)sender { self.imgpicker = [[UIImagePickerController alloc] init]; self.imgpicker.delegate = self; self.imgpicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:self.imgpicker animated:YES]; } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img1 editingInfo:(NSDictionary *)editInfo { [[picker parentViewController] dismissModalViewControllerAnimated:NO]; UIView *view = [[UIView alloc] init]; (This view for displaying the images) imageview = [[UIImageView alloc] initWithImage:img1]; [imageview setFrame:CGRectMake(0, 0, 320, 420)]; [self.view addSubview:imageview]; [view release]; UIBarButtonItem *rightbutton = [[UIBarButtonItem alloc] initWithTitle:@"Email" style:UIBarButtonItemStyleBordered target:self action:@selector(rightbutton)]; self.navigationItem.rightBarButtonItem = rightbutton; [rightbutton release]; } -(void) rightbutton { [self emailImage:(UIImage *)image];( how to pass the image to mail view) } - (void)emailImage:(UIImage *)image { picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]]; NSData *data = UIImagePNGRepresentation(image); [picker addAttachmentData:data mimeType:@"image/png" fileName:@"iPod Library Image"]; [self presentModalViewController:picker animated:YES]; [picker release]; } Please help me out. Thanks.

    Read the article

  • UIViewController dismissModalViewControllerAnimated: causes main window to disappear

    - by Jim
    I want to present a modal mail dialogue like so in the iPad app: MFMailComposeViewController* picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:title]; [picker setMessageBody:[NSString stringWithFormat:[self emailBody], title, [link absoluteString]] isHTML:YES]; [self.viewController presentModalViewController:picker animated:YES]; The following delegate is called when the user sends/cancels: - (void) mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self.viewController dismissModalViewControllerAnimated:YES]; } This works great in portrait mode. In landscape mode the right hand pane of the UISplitViewController completely disappears.

    Read the article

  • MFMailComposerViewController doesn't always display attachments

    - by davbryn
    I'm attaching a few files to an email to export from the application I've written, namely a .pdf and a .png. I create these by rendering some view to a context and creating an image and a pdf. I can validate that the files are created properly (I can confirm this by looking in my apps sandbox from Finder, and also by sending the email. I receive the files correctly.) The problem I'm getting is that larger files don't have a preview generated for them within the MFMailComposerViewController view (I simply get a blue icon with a question mark). Is there a limitation on file sizes that can be attached in order for preview to function correctly? With small files it works as expected, but if I try and attach a pdf with the following properties: Pages: 1 Dimensions: 2414 x 1452 Size: 307 KB the file is generated correctly, but displays the question mark icon. If there is no way around that, can I remove the attachment preview altogether? Many thanks, Bryn

    Read the article

  • How to dismiss the MFMailComposeViewController in cocos2d ?

    - by srikanth rongali
    I have changed my code to this way. Now mail controller is opening in landscape mode. But the problem is If I touch on cancel button or send button the mail controller is not dismissing its view. How can I do it ? -(void)goToFirstScreen:(id)sender { NSLog(@"goToFirstScreen: "); CCScene *Scene = [CCScene node]; CCLayer *Layer = [EmailScene node]; [Scene addChild:Layer]; [[CCDirector sharedDirector] setAnimationInterval:1.0/60]; [[CCDirector sharedDirector] pushScene: Scene]; } Th EmailScene class is #import "EmailScene.h" #import "testOfEnd.h" @implementation EmailScene - (id) init { self = [super init]; if (self != nil) { [self displayComposerSheet]; } return self; } -(void)displayComposerSheet { [[CCDirector sharedDirector] pause]; picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [[[CCDirector sharedDirector] openGLView] addSubview:picker.view]; [[CCDirector sharedDirector] stopAnimation]; [picker presentModalViewController:picker animated:YES]; [picker release]; } - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [[CCDirector sharedDirector] resume]; //dismiss view after otherwise the code is not executed [picker.view removeFromSuperview]; [[CCDirector sharedDirector] startAnimation]; [picker dismissModalViewControllerAnimated:YES]; //return to previous scene CCScene *Scene = [CCScene node]; CCLayer *Layer = [testOfEnd node]; [Scene addChild:Layer]; [[CCDirector sharedDirector] replaceScene:Scene]; } @end Thank You.

    Read the article

  • iPhone: How to Display Underlined Text in a Button?

    - by Warrior
    I want to display the mail ID in my view such that clicking the mail ID should open the mail composer view. I want to display the button text as underlined to show it is a hyperlink and for the button click event to call the mail composer view. At present, I am not able to show the button text underlined. I thought of placing a label above the button and adjusting the label property to get the underlined text but that did not work. Is there a different way to get the appearance and behavior I want?

    Read the article

1 2  | Next Page >