Option to play a notification sound iOS - ios

I wrote an Android application and it had options to choose what system notification sound the user wanted to play for each of the different types of notifications, three in total.
Now I want to write the same application for iOS, but is it possible to do this in iOS, I Googled about this but didn't really find a way on how to do it. Seeing as though iOS 7 is out, have Apple made any changes?
Or is it still restricted, like a million other things?

Choose custom sound for local notifications
This link provides the answer. You can find more detail in the apple doc. "In iOS, an application can specify a sound file along with an alert message or badge number.".
Specifically:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW1

Ok, I have downloaded the standard iOS 7 alert sounds, and will put them in my bundle, and play them from there. Why does Apple make things so hard?

Related

Send intent to create an alarm in default app

In android we can do an Intent to add an alarm to the default alarm app installed on the device example.
I wonder if it's possible to achieve something similar on iOS?
Regarding to Alarm App, Here you have answer from Apple support and it's related with iOS sandbox.
As far as I know the rationale for this has never been publicly documented. However, the iOS sandbox does not, in general, allow app A to make changes that affect app B or the system as a whole.
In Apple docs you can find description how to set up calendar alarms.

watchOS Show App When Message Received [duplicate]

I know that an apple watch app can launch its parent application in the background to pass data back and forth but can it work the other way around? Can my iOS app launch the related watchOS app?
For a bit more insight, I'm trying to accomplish this so that I can monitor data periodically for the sake of notifications. The 70 seconds apple gives me to keep an app active and pulling data from healthKit isn't conducive to an app that provides alerts to users based on changes in behavior.
I apologize if this is a basic question. I'm new to watchOS development and haven't been able to find the answer to this anywhere. =/
No it cannot happen.
At the moment communication between the Watch and the Device is limited to the Watch App initialising communication with the iOS app and not the other way around.
This might help:
https://developer.apple.com/library//ios/documentation/General/Conceptual/WatchKitProgrammingGuide/SharingData.html#//apple_ref/doc/uid/TP40014969-CH29-SW1
Yes, you can. Try the startWatchApp(with:completion:) func in HealthStore. However, it can only be used in a workout app that enable the background mode of "workout processing".
Unfortunately I think I found the answer here How to programmatically open Apple Watch companion app from iOS app.
It doesn't look like it can be done. If anyone finds otherwise, let me know!

A workaround for custom and "dynamic" notification sounds

From the apple documentation, we can read
For remote notifications in iOS, you can specify a custom sound that
iOS plays when it presents a local or remote notification for an app.
The sound files must be in the main bundle of the client app.
My app evolves around notifications, like many other apps, and I would really like to have the ability to add sounds later on, or at least to have some kind of control over them. The best scenario would be :
On launch, my app checks the sound database online and downloads any updates.
But obviously if all the sounds have to be in the bundle, this can't be done.
I have over 400Mb of sounds, and as obvious as this sounds, this is also too much for the app store, and that's why I'd need some control from the user, to not download all the sounds.
Is there any possible workaround so that I can play sounds written on disk and not in bundle? Or any other possibility you might think of so I can play a custom push notification sound?
If that is of any help, my app works 100% online, so if there is a solution, it can be server-related.
I understand that I'm most probably get a "No" as the best answer, but I need to make sure.
Thank in advance.
You can place custom sounds in the Library/Sounds folder.
Preparing Custom Alert Sounds
If your app wants to be in App Store, then you should follow the apple documentation. That is to say, we can only play the sound from the main bundle.
And we also could not modify the main bundle dynamically. Because it's encrypted.
So I'm afraid you could not go this way. But I suggest to upload the whole app to App Store if you could sacrifice the sound file dynamically update feature.

Iphone SDK Disable Notifications of Another App

I am writing a simple app (For personal use only) that needs to disable the text message notifications. I am open to how to go about this (disable push notifications of imessage, mute phone, etc.) but everything I read says that apple does not allow an app to modify the user settings. I know there has to be a way to do this, but I have hit a dead end. Does anyone have any suggestions?
Apple doesn't allow this though any official SDK methods.

What's solution to make task background in iOS same service in Android?

I'm newbie iOS. I have been develop Phonegap for Android and iOS. My App is update data from server every 1hour. In Android, i use service to do that. My app in Android working very good. Now, i want to develop version for iOS, and i have problem when update data from server every 1hour. I was research but not find anyway for my app.I don't know what's solution to replace for service in Android. Can you help me, what's solution. This have been kill me. Thank you so much.
Short answer is NO as Apple has restriction on background task running especially cases like yours.
But if you are downloading small amount of content, you do have some other options. From IOS 4.0 or above, you can declare your app to run in background when you fall under the following categories:
Audio
Location updates
Voice over IP
Newsstand downloads
External accessory communication
Bluetooth networking
Bluetooth data sharing
Background fetch (IOS 7)
Remote notifications (IOS 7)
In order to do so, you need to flag your app in the info.plist for Required Background Modes option. Apple will review your app specific in this area once you declared the option.
For your case to download the data, the possible option is to use the new feature in IOS 7 that's the background fetch or remote notification above. The suggestion from DOM was not asking you to download the content through push notification. But instead to use push notification to wake up your application and start downloading new content.
If you don't want to use push notification, the only way to go is register for background fetch. However, no matter which option you want to use, each download will only last for 30 seconds. And after that, your app will put into suspension mode again.
you can have a look on the link here:
Declaring Your App’s Supported Background Tasks
I think your best bet would be to use the push services instead of having your app go get data. Making your app do it is unreliable with phonegap apps because you cant create a service interface and you can not guarantee that your app will be running. With push service though, if your app isn't running, it will be woken up in a manner of speaking.
Take a look at this great how-to article that also discusses what push provides you.

Resources