peterhajas / MobileNotifier

iOS Notifications. Done right.
BSD 3-Clause "New" or "Revised" License
302 stars 32 forks source link

SMS sound fix suggestion #207

Closed aznair closed 13 years ago

aznair commented 13 years ago

A lot of people seem to be complaining that MN plays the default Tri-Tone sound for SMS messages regardless of what the user actually set for the alert tone.

I've found that using [SBSMSAlertItem shouldPlayMessageReceived] and [SBSMSAlertitem playMessageReceived] to handle SMS alert tones will fix this issue.

iMuggle commented 13 years ago

I'm assuming you need to edit this into a file? Which file exactly are you changing?

aznair commented 13 years ago

In Tweak.xm, in the function "activateAlertItem", inside the block for SMS alerts, add: if ([%c(SBSMSAlertItem) shouldPlayMessageReceived]) { [%c(SBSMSAlertItem) playMessageReceived]; } Then in MNWhistleBlowerController.m, inside "alertArrivedWithData", remove the if block.

This isn't really the "right" place to put the sound handling code but for me it's the easiest way to make it work.

iMuggle commented 13 years ago

Thanks! That works!

Sent from my iPad

On May 27, 2011, at 1:14 AM, aznairreply@reply.github.com wrote:

In Tweak.xm, in the function "activateAlertItem", inside the block for SMS alerts, add: if ([%c(SBSMSAlertItem) shouldPlayMessageReceived]) { [%c(SBSMSAlertItem) playMessageReceived]; } Then in MNWhistleBlowerController.m, inside "alertArrivedWithData", remove the if block.

This isn't really the "right" place to put the sound handling code but for me it's the easiest way to make it work.

Reply to this email directly or view it on GitHub: https://github.com/peterhajas/MobileNotifier/issues/207#comment_1247411

Drudoo commented 13 years ago

To do it properly you need to find the AudioServicesPlaySystemSound variable that is the chosen sms sound. Looking over apples audiobox frame work, i cant seem to find it =/

aznair commented 13 years ago

Yeah that was my first choice as well but as far as I can tell no such identifier exists, only specific tones :(

Drudoo commented 13 years ago

Check out some info regarding the SMS sounds here: https://github.com/peterhajas/MobileNotifier/pull/266 quite interesting.

timnovinger commented 13 years ago

This issue was fixed in this commit. Thanks for the bug report!