PoomSmart / Messages-Preview-Flipswitch

Toggle for Show Messages Preview option.
1 stars 0 forks source link

No longer works on iOS 9 #1

Closed Platypus2 closed 7 years ago

Platypus2 commented 8 years ago

It seems like the 'SBShowSMSPreview' key no longer works in toggling the option on iOS 9.

In fact, it doesn't seem like anything in the springboard.plist is changed with respect to toggling message preview on or off.

Might it not be possible to update this flipswitch then?

joemerlino commented 8 years ago

Actually SBShowSMSPreview is still there, I think the problem on iOS 9 is the kSMSNotification (SpringBoardMessageSettingsChangedNotification).

Platypus2 commented 8 years ago

Just checked on iOS 9.0.2, SpringBoardMessageSettingsChangedNotification is still present;

<key>SpringBoardMessageSettingsChangedNotification</key>
    <dict>
        <key>APIs</key>
        <array>
            <string>CNotifications</string>
            <string>CFNotificationCenter</string>
        </array>
        <key>actions</key>
        <array>
            <string>register</string>
            <string>observe</string>
        </array>
        <key>type</key>
        <string>notification</string>
    </dict>

On a fresh device, SBShowSMSPreview isn't in the springboard.plist, and using the toggle 'manually' does not cause any springboard plists to change :/

PoomSmart commented 8 years ago

I will see what I can do to fix today, thanks for all suggestions.

PoomSmart commented 8 years ago

@Platypus2 Updated for iOS 9. Can you help me test it?

Platypus2 commented 8 years ago

@PoomSmart Thank you for taking the time to look into it :)

I have just tested on iOS 9.0.2 and it has a bit of a weird behaviour.

For me, the flipswitch will work successfully the first time you toggle it but any further changes do not take effect until I respring the device (which will allow me to toggle it only once again).

For example, message preview is on before installing.

Message Preview is on. Turn flipswitch off. Message Preview is off. Turn flipswitch on. Message Preview remains off (no change) - can confirm this both by the banner and the toggle switch in notification settings.

If I respring the device at that point; Message Preview is off (carried over from before respring) Turn flipswitch on. Message Preview is on. Turn flipswitch off. Message Preview remains on (no change) - can confirm this both by the banner and the toggle switch in notification settings.

Does what I wrote make sense? Do you have the same behaviour?

Just added some debug code, seems like theres some logic wrong in the switch :), nothing gets called if you try to toggle the switch back again after the first attempt, will keep looking at the code if you haven't seen this yet.

Haven't tested on iOS 8 yet, I have a range of devices on different firmwares down to iOS 7 so happy to test those, though looking at the code, anything below iOS 9 should work like it did before, so will probably hold off testing those until iOS 9 is sorted :)

Platypus2 commented 8 years ago

Okay with the help of some debug code this is what I have found;

After a respring you can change the state once and then it stops working, however if you select the same state as the switch is on, the switch will then work as intended until you respring again. So;

Message preview on Turn flipswitch off Message preview off Turn flipswitch on Message preview remains off

Now if i trigger flipswitch off again Message preview remains off Turn flipswitch on Message preview on

And it will now work correctly (setting the correct state) until I respring. Seems like a small bug :)

I had been testing by changing the state directly (i.e. ON/OFF). If I use the toggle switch, the first toggle will 'fail', any after that work correctly.

PoomSmart commented 8 years ago

@Platypus2 Updating for iOS 9 won't affect support for earlier iOS versions anyway since I deal with iOS 9 by distinct algorithm. Anyway, I updated the code. Note that if you try to toggling each from settings and from flipswitch, they might not sync instantly because there's timeout for preferences values changes or either side did not yet update value.

Platypus2 commented 8 years ago

Just using flipswitch with Activator menu, the adjustment seems to be worse for me in that now it will just get stuck and no longer work until a respring. Example;

Message 1 - Preview not shown Use toggle flipswitch Message 2- preview shown Use toggle flipswitch Message 3- preview not shown use toggle flipswitch Message 4 - preview not shown use toggle flipswitch Message 5 - preview not shown

Before it was working correctly after the first 'failed' toggle until a respring.

Are you experiencing these or is it just me? The core functionality is there, it just seems like the flipswitch state is getting stuck somewhere - looking at the debug code for me in this instance it seems to be that there is no 'keyexist' and it keeps returning on (even though that makes no sense as the preview is off).

PoomSmart commented 8 years ago

@Platypus2 I should really test sending image to my account, so that I can see the behavior. Right now I have only one ID, one iMessages-working device. I'll figure out any way to test it.

Platypus2 commented 8 years ago

You should be able to send yourself messages on one imessage device. The only issue is the banner does not appear when you are in the message app. To get around that you can use something to trigger a message - e.g. Activator (with Programmable SMS) or a scheduling tweak. I can appreciate not wanting to do that though if the only imessage device you have is your 'main device' :)

Could also create something from this (it's essentially the core of the code for Programmable SMS): http://iphonedevwiki.net/index.php/ChatKit.framework#Sending_a_Message_in_iOS_8

Alternatively, do you not have imessage on Mac to send yourself a message (I forget what the requirements that is)?

PoomSmart commented 8 years ago

@Platypus2 I have a hackintosh, and looks like iMessages there hates it.

PoomSmart commented 8 years ago

@Platypus2 I updated it, can you test?

Platypus2 commented 8 years ago

Hi, sorry I missed your update/comment.

Just installed the update, and its still doing the same thing as I described above. The core of it works, its just a case of getting over that first initial bit where it doesn't correctly change (i.e. have to toggle twice after a respring to get it to work correctly).

I don't know if I am explaining the issue poorly, would a video help?