Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ble_apple_notification_center/badge/?version=latest
:target: https://docs.circuitpython.org/projects/ble_apple_notification_center/en/latest/
:alt: Documentation Status
.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/actions
:alt: Build Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black
BLE library for the Apple Notification Center
Dependencies
=============
This driver depends on:
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_.
Installing from PyPI
=====================
.. note:: This library is not available on PyPI yet. Install documentation is included
as a standard element. Stay tuned for PyPI availability!
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-ble_apple_notification_center/>`_. To install for current user:
.. code-block:: shell
pip3 install adafruit-circuitpython-ble-apple-notification-center
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install adafruit-circuitpython-ble-apple-notification-center
To install in a virtual environment in your current project:
.. code-block:: shell
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-ble-apple-notification-center
Usage Example
=============
.. code::python
"""
This example solicits that apple devices that provide notifications connect to it, initiates
pairing, and prints existing notifications.
"""
import adafruit_ble
from adafruit_ble.advertising.standard import SolicitServicesAdvertisement
import adafruit_ble_apple_notification_center as ancs
radio = adafruit_ble.BLERadio()
a = SolicitServicesAdvertisement()
a.solicited_services.append(ancs.AppleNotificationCenterService)
radio.start_advertising(a)
print("Waiting for connection")
while not radio.connected:
pass
print("Connected")
for connection in radio.connections:
if ancs.AppleNotificationCenterService not in connection:
continue
if not connection.paired:
connection.pair()
print("Paired")
ans = connection[ancs.AppleNotificationCenterService]
# Wait for the notifications to load.
while len(ans.active_notifications) == 0:
pass
for notification_id in ans.active_notifications:
notification = ans.active_notifications[notification_id]
print(notification.app_id, notification.title)
Documentation
=============
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/ble_apple_notification_center/en/latest/>`_.
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/blob/main/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Raw data
{
"_id": null,
"home_page": null,
"name": "adafruit-circuitpython-ble-apple-notification-center",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "adafruit, blinka, circuitpython, micropython, ble_apple_notification_center, ble, ancs, apple, notification",
"author": null,
"author_email": "Adafruit Industries <circuitpython@adafruit.com>",
"download_url": "https://files.pythonhosted.org/packages/db/f2/0d214809016e8ba86275e9761a78b19bd021ac8a7994c46640760102e6fc/adafruit_circuitpython_ble_apple_notification_center-0.10.11.tar.gz",
"platform": null,
"description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ble_apple_notification_center/badge/?version=latest\n :target: https://docs.circuitpython.org/projects/ble_apple_notification_center/en/latest/\n :alt: Documentation Status\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n :target: https://adafru.it/discord\n :alt: Discord\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/workflows/Build%20CI/badge.svg\n :target: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/actions\n :alt: Build Status\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: Code Style: Black\n\nBLE library for the Apple Notification Center\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_.\n\nInstalling from PyPI\n=====================\n.. note:: This library is not available on PyPI yet. Install documentation is included\n as a standard element. Stay tuned for PyPI availability!\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI <https://pypi.org/project/adafruit-circuitpython-ble_apple_notification_center/>`_. To install for current user:\n\n.. code-block:: shell\n\n pip3 install adafruit-circuitpython-ble-apple-notification-center\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n sudo pip3 install adafruit-circuitpython-ble-apple-notification-center\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n mkdir project-name && cd project-name\n python3 -m venv .venv\n source .venv/bin/activate\n pip3 install adafruit-circuitpython-ble-apple-notification-center\n\nUsage Example\n=============\n\n.. code::python\n\n \"\"\"\n This example solicits that apple devices that provide notifications connect to it, initiates\n pairing, and prints existing notifications.\n \"\"\"\n\n import adafruit_ble\n from adafruit_ble.advertising.standard import SolicitServicesAdvertisement\n import adafruit_ble_apple_notification_center as ancs\n\n radio = adafruit_ble.BLERadio()\n a = SolicitServicesAdvertisement()\n a.solicited_services.append(ancs.AppleNotificationCenterService)\n radio.start_advertising(a)\n\n print(\"Waiting for connection\")\n\n while not radio.connected:\n pass\n\n print(\"Connected\")\n\n for connection in radio.connections:\n if ancs.AppleNotificationCenterService not in connection:\n continue\n\n if not connection.paired:\n connection.pair()\n print(\"Paired\")\n\n ans = connection[ancs.AppleNotificationCenterService]\n # Wait for the notifications to load.\n while len(ans.active_notifications) == 0:\n pass\n for notification_id in ans.active_notifications:\n notification = ans.active_notifications[notification_id]\n print(notification.app_id, notification.title)\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/ble_apple_notification_center/en/latest/>`_.\n\nFor information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/blob/main/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "BLE library for the Apple Notification Center",
"version": "0.10.11",
"project_urls": {
"Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center"
},
"split_keywords": [
"adafruit",
" blinka",
" circuitpython",
" micropython",
" ble_apple_notification_center",
" ble",
" ancs",
" apple",
" notification"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9f33e9834db70a68e61e6821f07476af506d110fc4ea4ffadaed456a5903aa2e",
"md5": "2503d4c65b67cb2f1c261e0c59ea0383",
"sha256": "1fcd7e68a0d3f663399adf5de67e37ab57af098d89ed243a4d3e53440d3d55c7"
},
"downloads": -1,
"filename": "adafruit_circuitpython_ble_apple_notification_center-0.10.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2503d4c65b67cb2f1c261e0c59ea0383",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7112,
"upload_time": "2025-01-16T19:28:59",
"upload_time_iso_8601": "2025-01-16T19:28:59.573899Z",
"url": "https://files.pythonhosted.org/packages/9f/33/e9834db70a68e61e6821f07476af506d110fc4ea4ffadaed456a5903aa2e/adafruit_circuitpython_ble_apple_notification_center-0.10.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dbf20d214809016e8ba86275e9761a78b19bd021ac8a7994c46640760102e6fc",
"md5": "01bb69987a453b40769514509555007c",
"sha256": "7f71c34e08e5cb0c704af6949ae5abfb0c5b85d5d17cfc33ee5ad1d8686755f8"
},
"downloads": -1,
"filename": "adafruit_circuitpython_ble_apple_notification_center-0.10.11.tar.gz",
"has_sig": false,
"md5_digest": "01bb69987a453b40769514509555007c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 29229,
"upload_time": "2025-01-16T19:29:03",
"upload_time_iso_8601": "2025-01-16T19:29:03.194563Z",
"url": "https://files.pythonhosted.org/packages/db/f2/0d214809016e8ba86275e9761a78b19bd021ac8a7994c46640760102e6fc/adafruit_circuitpython_ble_apple_notification_center-0.10.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-16 19:29:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adafruit",
"github_project": "Adafruit_CircuitPython_BLE_Apple_Notification_Center",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "Adafruit-Blinka",
"specs": []
},
{
"name": "adafruit-circuitpython-ble",
"specs": []
}
],
"lcname": "adafruit-circuitpython-ble-apple-notification-center"
}