MessageComposeResult is sent even if the message send failed - iphone

I am using MFMessageComposeViewController to send sms within my app. Everything is correct until i try to get the result of the operation. Actually the Message sending failed as It can be seen in the SMS native app (I have no service in the sim card), but I get MessageComposeResultSent in - (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result.
Have you ever gone though this? Could we get a real assert that the sms has been properly sent?
Thanks a lot.

Here is a snippet from the MessageComposeResult struct's discussion in MFMessageComposeViewController.h :
Typically MessageComposeResultSent
will be sent, but
MessageComposeResultFailed will be
sent in the case of failure. Send may
only be interpreted as a successful
queueing of the message for later
sending. The actual send will occur
when the device is able to send.

Related

Avoiding duplicates with Apple's Push Notification Service (APNS)

We referred to Apple's TN2265 (https://developer.apple.com/library/ios/technotes/tn2265/_index.html) for implementing error handling in our app, which sends push notifications to our users. The documentation suggests that we deal with errors asynchronously, specifically:
If you get six bytes back, that's an error response that you can check for the response code and the ID of the notification that caused the error. You'll need to send every notification following that one again.
Is it the case that in a sequence of notifications, if one fails then all notifications following it are guaranteed to have failed? If not, then how does one avoid duplicate sends of the same notification to a given device?
Yes, in that case all the notifications following it are guaranteed to not even be processed by the APNS server.
When APNS detects an invalid message, it writes the error response to the socket and closes the connection. Until you receive that error response, it's possible that you already sent more messages to Apple on the same socket. All of them won't reach Apple. Once you create a new socket you should resend all of them.
There is no risk of duplicates.

Is it possible to create an app that auto responds to phone calls with a text message, and auto replies to received texts and emails?

I have not been able to find any information about the topic online, so I am assuming it is not possible, but is there a way to create an app that when turned on will respond to all incoming calls by sending them to voicemail and responding with a text message? I know you can set the reply with message in iOS6, but we would want the message to be sent automatically when the call is recieved, currently the respond with message the user still needs to hit a button when the call comes in to send this. We would also want to respond to any incoming SMS/imessages with a text. As well as reply automatically via email to any incoming emails. If anyone could link me to an apple site or somewhere that says you can't do this? Thanks for your help.
Edit - is there any way to get information about notifications for these items? I was thinking if you can't directly handle the call itself, on a timed loop you could check to see if there were any missed calls or any info relating to those? Thanks
Not unless you want to develop and application for jailbroken phones, which will not be allowed in the Apple App Store.

How to "Auto SMS Sender" work - send sms in background

This application support send a scheduled sms in background mode! How to they do that?
What do you think about this their info:
In order to send out the scheduled message:
This app must be running on your iPhone, either in the background or in the foreground;
Your iPhone must not be in the airplane mode;
Your iPhone must have carrier's signal at the scheduled time;
NOTES:
If you schedule a message with a large number of recipients, please check with your carrier for the maximum number of recipients allowed per message. If you exceed the maximum number allowed, your message may be blocked by your carrier.
Your iPhone must be powered on at the scheduled time so that the message can be sent out;
If you reboot your iPhone, or turn it off/on, remember to restart this app as soon as possible so that the timer can still be active.
Some results from testing...confirms this app is sending normal SMS WITHOUT user interaction!
WLAN ON + GSM OFF (no reception) => the app does NOT send SMS, even after reception is back no SMS gets send. In the phone's messages log it tells "failed sending SMS"
WLAN OFF + GSM ON => the app sends SMS without user interaction (I checked my bill, and in fact a SMS got sent through the provider! - no data traffic to a server!)
Also, by the way when the SMS is received the sender's SMS number is displayed correctly. I know one could do this through a SMS server - but in fact a REAL SMS got sent through the provider! There was no data traffic, no other cost than my providers SMS charge, and on the past activities it explicitly showed this SMS!
So somehow this app sends a real SMS without user confirmation.
Probably there is a way to use the direct SMS library without Apple's review team finding out? Anyway I know for sure, that Apple rejects apps that use this library (if they find out!)
Your best bet is to setup an intermediate server on the internet that uses an online SMS sending service, and send the SMSs via that route if you need complete automation. (ie, your program on the iPhone sends a UDP packet to your server, which sends the real SMS)

Waiting until an email has been sent on iOS?

My app allows the user to send an email through MFMailComposeViewController. While the email is being sent, I'd like to display an activity indicator. Problem is I can't find a way to know when it's been sent. The delegate is only being told whether the mail was placed in the outbox:
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
Is there any way to know whether an email has been sent on iOS?
I think you're out of luck, sort of. Once the email gets passed to the Mail app, you lose track of it, and it becomes the responsibility of the Mail app alone. And there isn't a way to even poll the Mail app to determine if an email has been sent.
But as long as the device has a network connection and the user has an email account set up, you're pretty much guaranteed the email will be sent, assuming you don't get an error returned to you. And you can always pre-check for network connectivity and email access before you attempt to present the MFMailComposeViewController.

MFMessageComposer iPhone,Auto Message Send

Any one know how to implement auto send message using MFMessageComposer....i mean No need of displaying The message Composer..we Have to sent the pre-defined message to a given Number..Or any other way without using MFMessageComposer..???
You can't auto-send messages with MFMessageComposer. It always displays the message to the user before sending (and rightly so).
An alternative would be to call a webservice which dispatches an email to you. Or put enough SMTP code in your app to get emails sending. You'll need your own email system for this though as you'll not be able to get the users email settings.