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 12-05-2010, 11:25 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 920
spiderguy84 is on a distinguished road
Default Airplay in background

I am working on an app to airplay audio to a supported device, similar to pandora. In the AppDelegate .h @interface I have:
Code:
UIBackgroundTaskIdentifier *backgroundTask;
In the .m I have:
Code:
@implementation VideoAppAppDelegate

@synthesize window;
@synthesize viewController;


- (void)applicationDidFinishLaunching:(UIApplication *)application {    
    
    // Override point for customization after app launch    
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];
	[[ UIApplication sharedApplication ] setIdleTimerDisabled: YES];

}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
	NSAssert(backgroundTask == UIBackgroundTaskInvalid, nil);
	backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil];
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
	[[UIApplication sharedApplication] endBackgroundTask:backgroundTask];
	backgroundTask = UIBackgroundTaskInvalid;
}

- (void)dealloc {
    [viewController release];
    [window release];
    [super dealloc];
}


@end
I then add the required background mode in .plist of App plays audio in the background. When I am using Airplay, however, and try to run a different app, it pauses. Any ideas for how to accomplish this?
__________________
My latest app...i Miss Mommy
spiderguy84 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: 391
7 members and 384 guests
chemistry, daudrizek, HemiMG, jeroenkeij, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,665
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, daudrizek
Powered by vBadvanced CMPS v3.1.0

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