dschep / dschep/ntfy

AttributeError: 'NoneType' object has no attribute 'scheduleNotification_' on macOS Sierra (10.12.6)

Open
#171 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5k
Forks
216
PR merge metrics
No merged PRs in 30d

Description

#### update
If I use the system python, it seems to work. Therefore, I added a simple wrapper:
```
ntpy () {
pyenv shell system
ntfy "$@"
pyenv shell --unset
}
```

This fixes triggering a notification, for now. But haven't even tried messing around with all the other fancy stuff `ntfy` does.

Mac support is not a huge priority for me as I'm migrating off it (hopefully) anyhow.

#### debugging
I'm guessing this might have something to do with permissions or something...

Running:
* ntfy 2.5.1
* iTerm`Build 3.1.5.beta.2`
* GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin15.6.0)
* python 3.6.1
* pyenv 1.1.0

Did the install quickly with `sudo pip install ntfy` (later tried omitting the sudo) and did `ntfy send test`:
![image](https://user-images.githubusercontent.com/5614134/37870205-fa5079ca-2f84-11e8-85e8-ec33390f295d.png)
(also tried above command with sudo)

Seems like `NSUserNotificationCenter.defaultUserNotificationCenter()` (docs at https://developer.apple.com/documentation/foundation/nsusernotificationcenter) is not returning anything
![image](https://user-images.githubusercontent.com/5614134/37870220-3730d146-2f85-11e8-8255-52252f168527.png)

Got curious and started printing out stuff using https://pythonhosted.org/pyobjc/api/module-objc.html - no protocols on `NSUserNotificationCenter` and the properties are shown below - don't really know anything about Objective C
![image](https://user-images.githubusercontent.com/5614134/37870343-9cff5198-2f88-11e8-8c8d-84ccdc9a7f30.png)

Notifications center settings don't look too interesting:
![image](https://user-images.githubusercontent.com/5614134/37870366-27396060-2f89-11e8-8464-6ea12bbd78dd.png)

Looks like the Console.app log says this:
![image](https://user-images.githubusercontent.com/5614134/37870381-9e87ef6a-2f89-11e8-91c7-7085971a842d.png)

Nothing in the system.log..

I also set up a very minimal `~/.ntfy.yml`:
![image](https://user-images.githubusercontent.com/5614134/37870403-1492324c-2f8a-11e8-92de-26fa3f51f37e.png)

Also tried adding
```
darwin:
prio: DEBUG
```

Not sure that's right - but I seem to see more logs? This taskgated thing seems to do with SIP, or System Integrity Protection and it seems to be not so easy to disable (https://apple.stackexchange.com/questions/281006/how-to-stop-taskgated-on-sierra)
![image](https://user-images.githubusercontent.com/5614134/37870439-d5cebcd2-2f8a-11e8-934d-2e2cb1c00e09.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.