Skip to content

Added basic Do Not Disturb functionality#7

Open
conradev wants to merge 1 commit intomasterfrom
donotdisturb
Open

Added basic Do Not Disturb functionality#7
conradev wants to merge 1 commit intomasterfrom
donotdisturb

Conversation

@conradev
Copy link
Owner

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.

@chendo
Copy link

chendo commented Feb 21, 2013

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.

@conradev
Copy link
Owner Author

Does 08edbd4 provide adequate instructions?

@matthew-roberts
Copy link

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.

@chendo
Copy link

chendo commented Feb 23, 2013

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

@conradev
Copy link
Owner Author

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

@matthew-roberts
Copy link

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

@conradev
Copy link
Owner Author

Has anyone tested this functionality yet?

@chendo
Copy link

chendo commented Mar 2, 2013

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
Copy link

chendo commented Mar 2, 2013

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.

@conradev
Copy link
Owner Author

conradev commented Mar 3, 2013

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

@DouweM
Copy link

DouweM commented Mar 29, 2013

Any progress on this?

@matthew-roberts
Copy link

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

@conradev
Copy link
Owner Author

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

@ghost ghost assigned conradev Jun 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants