Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8023691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:37:58+00:00 2026-06-04T22:37:58+00:00

Hi I’m trying to make a SMS native extension for adobe AIR. I Havnt

  • 0

Hi I’m trying to make a SMS native extension for adobe AIR.
I Havnt coded in objective-c before but everything works fine except for the fact that the SMS window won’t close when pressing send or cancel. Below is the main section of code but ask me if you need any more info. Thanks for reading.
also why is xcode telling me :”Method in protocol not implemented” for the second line ?

#import "SMSComposerHelper.h"
@implementation SMSComposerHelper

//Event name
static  NSString *event_name = @"SMS_COMPOSER_EVENT";


-(void) sendSMS:(NSString *)toRecipient
         messageBody:(NSString *)messageBody
{

    FREDispatchStatusEventAsync(context, (uint8_t*)[event_name UTF8String], (uint8_t*)[@"WILL_SHOW_MAIL_COMPOSER" UTF8String]);

           MFMessageComposeViewController *smsComposer = [[MFMessageComposeViewController alloc] init];
          smsComposer.messageComposeDelegate = self;

    //make string into array
    NSArray *recipientArray;
    recipientArray = [NSArray arrayWithObjects: toRecipient, nil];

    smsComposer.body = messageBody;   
    smsComposer.recipients = recipientArray;

    //show sms composer
    [[[[UIApplication sharedApplication] keyWindow] rootViewController] presentModalViewController:smsComposer animated:YES];

}


// Dismisses the sms composition interface when users tap Cancel or Send.
-(void) smsComposeController: (MFMessageComposeViewController*)controller didFinishWithResult: (MessageComposeResult)result error:(NSError*)error
{
    NSString *event_info = @"";
          // Notifies users about errors associated with the interface
          switch (result)
          {
                    case MessageComposeResultCancelled:
            event_info = @"SMS_CANCELED";
                              break;
        case MessageComposeResultSent:
            event_info = @"SMS_SENT";
                              break;
                    case MessageComposeResultFailed:
            event_info = @"SMS_FAILED";
                              break;
                    default:
            event_info = @"SMS_UNKNOWN";
            break;
          }

    FREDispatchStatusEventAsync(context, (uint8_t*)[event_name UTF8String], (uint8_t*)[event_info UTF8String]);
    FREDispatchStatusEventAsync(context, (uint8_t*)[event_name UTF8String], (uint8_t*)[@"WILL_HIDE_SMS_COMPOSER" UTF8String]);

    context = nil;


    //hide mail composer
   [[[[UIApplication sharedApplication] keyWindow] rootViewController] dismissModalViewControllerAnimated:YES];
}

-(void)setContext:(FREContext)ctx {
    context = ctx;
}

@end

RESPONSE :

Omar thankyou so much for your answer and for answering so quickly!
First I tried your solution of using

[controller dismissModalViewControllerAnimated:YES];

but this did nothing so I changed it back.
My header already was :

@interface SMSComposerHelper : NSObject<MFMessageComposeViewControllerDelegate> {

So I decided to focus on fixing the warning.
The warning was solved by changing :

-(void) smsComposeController: (MFMessageComposeViewController*)controller didFinishWithResult: (MessageComposeResult)result error:(NSError*)error

to:

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result

I would love to know why this worked ? do you know Omar ?
So I solved the warning but it still didn’t dismiss.
So I tried your suggestion again:

[controller dismissModalViewControllerAnimated:YES];

AND IT WORKED !!!!
thanks so much man. You don’t know how many hours I was stuck for.
I will be happy to accept your answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:38:01+00:00Added an answer on June 4, 2026 at 10:38 pm

    Instead of

     [[[[UIApplication sharedApplication] keyWindow] rootViewController] dismissModalViewControllerAnimated:YES];
    

    write

     [controller dismissModalViewControllerAnimated:YES];
    

    Also for the warning

    Go to SMSComposerHelper.h
    And add the following

    @interface SMSComposerHelper : UIViewController<MFMessageComposeViewControllerDelegate>{
    

    instead of

    @interface SMSComposerHelper : UIViewController{
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm trying to select an H1 element which is the second-child in its group

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.