Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you checked <code>+[MFMessageComposeViewController canSendText]</code>?</p> <p>From the <a href="http://developer.apple.com/library/ios/documentation/MessageUI/Reference/MFMessageComposeViewController_class/Reference/Reference.html" rel="noreferrer">MFMessageComposeViewController Class Reference</a>,</p> <blockquote> <p>Before presenting a message composition view, call the <code>canSendText</code> class method to ensure that the user’s device is appropriately configured. Do not attempt to present a message composition view if the canSendText method returns NO. If SMS delivery isn’t available, you can notify the user or simply disable the SMS features in your application.</p> <p>Starting in iOS 5, you can register to be notified of changes to the availability of text message sending by way of the <code>MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification</code> notification.</p> </blockquote> <p>Reasons it might be returning <code>nil</code>:</p> <ul> <li>Device isn't running iOS 4.</li> <li>Device is an iPod Touch/iPad without iMessage enabled.</li> <li>No SIM card? (The view now shows in iOS 6; the app is not notified of the message send failure.)</li> <li>"Device" is actually the simulator. (Perhaps this works in iOS 6 too.)</li> </ul> <p>Similarly, <code>[[MFMailComposeViewController alloc] init]</code> returns <code>nil</code> when no mail accounts are enabled (you can quickly test this by disabling accounts in Settings), but also shows a "No mail accounts configured" alert for you. MFMessageComposeViewController does not do this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload