BTNotificationEnabler icon indicating copy to clipboard operation
BTNotificationEnabler copied to clipboard

Added basic Do Not Disturb functionality

Open conradev opened this issue 11 years ago • 13 comments

This contains the functionality described in #4.

I need someone to test this, as I am not able to verify if it works on my own.

conradev avatar Feb 21 '13 18:02 conradev

I can do it if you can either tell me how to build it (last time I did something, I spent days trying to get a cross-compile setup working) or if you can send me a build.

chendo avatar Feb 21 '13 22:02 chendo

Does 08edbd42db provide adequate instructions?

conradev avatar Feb 22 '13 00:02 conradev

When you compile as to the exact instructions, the following errors are logged:

In file included from BulletinHandler.xm:14: /Users/matt/BTNotificationEnabler/theos/include/substrate.h:17:63: error: redefinition of default argument IMP MSHookMessage(Class _class, SEL sel, IMP imp, const char *prefix _default(NULL)); ^ ~~~~ /Users/matt/BTNotificationEnabler/theos/include/substrate.h:17:63: note: previous definition is here IMP MSHookMessage(Class _class, SEL sel, IMP imp, const char *prefix _default(NULL)); ^ ~~~~ BulletinHandler.xm:16:43: error: use of undeclared identifier 'MSHookIvar' NSMutableArray *interestingSections = MSHookIvar<NSMutableArray *>(self, "fInterestingSections"); ^ BulletinHandler.xm:16:54: error: unexpected interface name 'NSMutableArray': expected expression NSMutableArray *interestingSections = MSHookIvar<NSMutableArray *>(self, "fInterestingSections"); ^ BulletinHandler.xm:16:70: error: expected expression NSMutableArray *interestingSections = MSHookIvar<NSMutableArray *>(self, "fInterestingSections"); ^ BulletinHandler.xm:16:72: error: expression result unused [-Werror,-Wunused-value] NSMutableArray *interestingSections = MSHookIvar<NSMutableArray *>(self, "fInterestingSections"); ^~~~ 5 errors generated.

matthew-roberts avatar Feb 23 '13 01:02 matthew-roberts

I just got that myself, although I found out XCode didn't update properly and was still at 4.5.2 so I'm upgrading to 4.56 now

chendo avatar Feb 23 '13 01:02 chendo

Oh! That is because the version of substrate.h that comes bootstrapped with Theos is incomplete. To fix this, you can get the real substrate.h. Run the following from the repository directory:

mkdir substrate
cd substrate
curl -LO http://apt.saurik.com/debs/mobilesubstrate_0.9.4001_iphoneos-arm.deb
ar x mobilesubstrate_0.9.4001_iphoneos-arm.deb
tar xvf data.tar.gz
cd ..
cp substrate/usr/include/substrate.h theos/include
rm -r substrate

conradev avatar Feb 23 '13 04:02 conradev

Although those commands didn't work (I just ended up with alias' that lead no where), seems this file is it - https://raw.github.com/kennytm/iphone-private-frameworks/master/substrate.h

matthew-roberts avatar Feb 23 '13 05:02 matthew-roberts

Has anyone tested this functionality yet?

conradev avatar Feb 28 '13 15:02 conradev

Didn't seem to work for me.. That said, the notification popped up on the screen as well so it seems Pushover is bypassing DND.

chendo avatar Mar 02 '13 07:03 chendo

Whoops, just did more reading and DND only works when the device is locked. I tested again with the screen locked however and the notification was still pushed to my Pebble.

chendo avatar Mar 02 '13 07:03 chendo

Okay. It appears as if BBSettingsGateway is having trouble connecting to its backing XPC service and retrieving the current DND status.

conradev avatar Mar 03 '13 00:03 conradev

Any progress on this?

DouweM avatar Mar 29 '13 13:03 DouweM

Just for those who can't download the do not disturb patch and successfully build it, use the following build steps (assuming you're starting from scratch):

git clone -b donotdisturb git://github.com/conradev/BTNotificationEnabler.git cd BTNotificationEnabler git submodule update --init curl -O http://cloud.github.com/downloads/rpetrich/ldid/ldid.zip unzip ldid.zip make mv ldid theos/bin rm ldid.zip curl -O https://raw.github.com/kennytm/iphone-private-frameworks/master/substrate.h rm theos/include/substrate.h mv substrate.h theos/include make package

matthew-roberts avatar May 24 '13 13:05 matthew-roberts

Still not working because BulletinBoard.framework in the BTMap service cannot connect to its backing XPC service.

Haven't tried to figure out why yet

conradev avatar May 25 '13 18:05 conradev