Reputation: 113
My problem is here:
I use Parse Push Notifications services, all works fine, I receive local notifications on the device, all works, but now the problem is at that point: the custom sound isn't played, instead, this is the default iOS notification sound that is played.
All is done in the rules, I have a supported packaged sound in ".wav" verified with QuickTime player that confirmed the custom sound file is in "PCM linear" format.
The sound file, is correctly present in the main bundle of the application and copied if needed in copy bundle resources (furthermore, the code in AppDelegate is looking correct)
I show you the code for more details:
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
@"You have received an coin !", @"alert",
@"Increment", @"badge",
@"custom_bell.wav", @"sound",
nil];
PFPush *push = [[PFPush alloc] init];
[push setData:data];
[push sendPushInBackground];
What am I missing with setting up ? Why am I wrong ? Is something changed in iOS 8 ?
Upvotes: 1
Views: 1568
Reputation: 21
According to the push notification guide:
"You can package the audio data in an aiff, wav, or caf file. Then, in Xcode, add the sound file to your project as a nonlocalized resource of the application bundle."
It doesn't say anything about MP3s. I've used aif files which worked. I'd stick to what Apple specifies. Check here for more info: https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6
Upvotes: 2
Reputation: 1
yes something changed in iOS 8 because in IOS 8 if the audio play time is more than 30 second the audio is not play, if less than 30 sec then you play it easily
Upvotes: 0