Sergey Grishchev
Sergey Grishchev

Reputation: 12051

Play sound when each time app is launched

Is there a convenient way to play a sound when the app is launched? I want it to be played only when the app is launched, not when the app entered background and went out of a background state.

Any ideas where I could put the code for this?

Upvotes: 0

Views: 145

Answers (2)

shabbirv
shabbirv

Reputation: 9098

Add your sound code to

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

That method is only called once, when the app first opens.

Upvotes: 3

Convolution
Convolution

Reputation: 2351

In your app delegate in the function...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Upvotes: 3

Related Questions