this question is a lot like Share data between two or more iPhone applications except:
(this basically rules out using the share sheet and custom url's to pass data as described in the post above)
I am using AVAudioPlayer
and AVAudioSession
in the first app to play the sound if that is at all helpful.
You can share actual NSData
through the NSUserDefaults
:
if let userDefaults = NSUserDefaults(suiteName: <group>) {
userDefaults.setObject(obj, forKey: key)
}
and retrieve from another app in the same group like so:
if let userDefaults = NSUserDefaults(suiteName: <group>) {
if let obj = userDefaults.objectForKey(key) {
// magic
}
}
It appears that the only limitation for passing data through the user defaults is the device storage capacity, and since NSUserDefaults
accepts NSData
as a storage format, it makes a prime candidate for sharing tidbits information.