English 中文(简体)
Invoke the application to conduct a 音乐 on receive an Bull iniso
原标题:Invoke the application to play a music on receiving a push in iOS
  • 时间:2012-04-10 16:29:48
  •  标签:
  • ios
  • push

I implemented Push notifications in iOS. I want my application to play a music (about 15sec) when I send a push message. I am currently getting the push message, and the music is being played only if the app is in the foreground. If the app is in the background, it shows up a notification, and when i tap it, it then plays the music.

但是,我如何自动发挥音乐的作用? 我认为,之所以能够做到这一点,是因为在西里,视听镜子可以在背景下运行。 因此,我只想让音乐在观看背景时起作用,并且得到推动。

Can anyone help me with this please?

Thanks, Nithin

问题回答

Yes, there are two ways to do this.

www.un.org/spanish/ecosoc 传统方式在OS 7之前是登记音频游戏背景模式,并永远保持沉默,这样,在用户杀人之前,你就能够保持自己的背景,或者由于记忆低而死亡。

This way has many drawbacks, the user must launch your app once so that you can start playing the sound and every time the iPhone is shut off, the user need to relaunch your app when he turn on the iPhone.

这也将消耗大量电池。 每天20%-30%

www.un.org/spanish/ecosoc “7”之后的新途径是利用背景名声和远距离通知,你可以在进行有30秒钟的背景情况时,发挥你的健全作用。 另外,你还可以发出一份推动通知书,引发背景 f。

This is an article about background fetch and push notification http://www.objc.io/issue-5/multitasking.html





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签