Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-09-2011, 02:18 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Ypsilanti, Michigan
Age: 63
Posts: 1,549
RLScott is on a distinguished road
Default SMS Text Interruptions

In the process of debugging the problem described in this thread , I have found a troubling variation in the response of some iPhones to an SMS Text Message interruption as it is handled by the built-in SMS Text Message app. This variation seems to be the cause of the problem discussed in that other thread.

Here is what my iPhone 4 does when an SMS Text Message is received:

AppDelegate: applicationWillResignActive. This is called when the SMS alert view asks if I want to dismiss the message or reply right now. My app is still visible behind the alert view, but it is inactive.

I tap on "Reply" to the SMS Text Message.

AppDelegate: applicationDidEnterBackground is called as the SMS Reply window takes over the full screen.

I send the SMS reply, press "Home", and relaunch my app (actually, just bring it out of background).

AppDelegate: applicationWillEnterForeground and applicationDidBecomeActive are both called, and everything is fine.

But, on an iPhone 4 used by a beta tester in Sweden, the sequence is a little different (confirmed by some custom logging in an ad hoc build):

AppDelegate: applicationWillResignActive is called just as before when the SMS alert view becomes active. So far everything is the same.

The user taps on "Reply" to the SMS Text Message. At this point the Swedish phone does something different. The alert view briefly disappears, but before it can be replaced by a full-screen SMS Text Message window, my app gets a:

AppDelegate: applicationDidBecomeActive (what the?)
AppDelegate: applicationWillResignActive (what the?)
AppDelegate: applicationDidEnterBackground

in quick succession. In other words, during the brief interval between when the SMS alert view is tapped and when the full-screen SMS message window takes over, my app is briefly told to go active and then told to go inactive. There seems to be some delay in the SMS Text Message app on this Swedish iPhone 4.

Why is this a problem? Because my app's response to applicationDidBecomeActive is to attempt to resume my Audio Session. But the iPhone is in some strange mode where this is not allowed - probably because the SMS Text Message app did not really intend to allow another app to activate its audio session between the time the first alert view is answered and when the SMS app goes full screen. The result is I get an error return from my AudioSessionSetActive(TRUE) (error = "!cat"), which I dutifully display for the user. I feel like I have been misled by the OS. It tells me I may go active, but then refuses to allow me to do something that active apps are allowed to do.

Can anyone confirm my findings with regard to the sequence of AppDelegate calls that occur when receiving and replying to an SMS text message while your app is running?
RLScott is offline   Reply With Quote
Old 09-09-2011, 03:10 PM   #2 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

That is odd. Have you checked if it is a bug in the target iOS? Is the beta-tester using a beta-OS?
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 09-10-2011, 03:50 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Ypsilanti, Michigan
Age: 63
Posts: 1,549
RLScott is on a distinguished road
Default

Quote:
Originally Posted by Objective Zero View Post
That is odd. Have you checked if it is a bug in the target iOS? Is the beta-tester using a beta-OS?
It's just a stock iPhone 4 such as anyone can buy in Sweden. I don't know the exact build number. But this behavior should be easy to confirm with a couple of NSLogs in any app you are developing, if you have an iPhone 4. I have checked mine and it doesn't misbehave like this other one. So are there any others?
RLScott is offline   Reply With Quote
Old 09-10-2011, 12:05 PM   #4 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Ypsilanti, Michigan
Age: 63
Posts: 1,549
RLScott is on a distinguished road
Default

Quote:
Originally Posted by Objective Zero View Post
That is odd. Have you checked if it is a bug in the target iOS? Is the beta-tester using a beta-OS?
FWIW, the OS used by my Swedish beta tester is 4.3.5.
RLScott is offline   Reply With Quote
Old 09-10-2011, 03:19 PM   #5 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Hmm, I doubt it would be a bug then. I would test it but I am not running 4.3.5, I am running a Beta OS. Maybe this is worth a technical support request? Also just in case, I would check the bug list for 4.3.5.
This shouldn't be happening.
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 09-10-2011, 08:00 PM   #6 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Ypsilanti, Michigan
Age: 63
Posts: 1,549
RLScott is on a distinguished road
Default

Quote:
Originally Posted by Objective Zero View Post
Hmm, I doubt it would be a bug then. I would test it but I am not running 4.3.5, I am running a Beta OS. Maybe this is worth a technical support request? Also just in case, I would check the bug list for 4.3.5.
This shouldn't be happening.
Can you tell me where to find the bug list for 4.3.5? I found several unofficial lists.

Last edited by RLScott; 09-10-2011 at 08:03 PM.
RLScott is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 410
10 members and 400 guests
apatsufas, Eclectic, fiftysixty, JackReidy, jeroenkeij, teebee74, tim0504, UMAD, yomo710, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:00 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0