diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/docs/index.rst b/docs/index.rst index 4d7073c..fc8c003 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -546,6 +546,26 @@ Push subscription dicts | |||
546 | # if webpushes have been requested for those events. | 546 | # if webpushes have been requested for those events. |
547 | } | 547 | } |
548 | 548 | ||
549 | Push notification dicts | ||
550 | ~~~~~~~~~~~~~~~~~~~~~~~ | ||
551 | .. _push notification dict: | ||
552 | |||
553 | .. code-block:: python | ||
554 | |||
555 | mastodon.push_subscription_decrypt_push(...) | ||
556 | # Returns the following dictionary | ||
557 | { | ||
558 | 'access_token': # Access token that can be used to access the API as the | ||
559 | # notified user | ||
560 | 'body': # Text body of the notification | ||
561 | 'icon': # URL to an icon for the notification | ||
562 | 'notification_id': # ID that can be passed to notification() to get the full | ||
563 | # notification object, | ||
564 | 'notification_type': # 'mention', 'reblog', 'follow' or 'favourite' | ||
565 | 'preferred_locale': # The users preferred locale | ||
566 | 'title': # Title for the notification | ||
567 | } | ||
568 | |||
549 | App registration and user authentication | 569 | App registration and user authentication |
550 | ---------------------------------------- | 570 | ---------------------------------------- |
551 | Before you can use the mastodon API, you have to register your | 571 | Before you can use the mastodon API, you have to register your |
@@ -795,7 +815,8 @@ will return a handle corresponding to the open connection. If, in addition, `asy | |||
795 | the thread will attempt to reconnect to the streaming API if any errors are encountered, waiting | 815 | the thread will attempt to reconnect to the streaming API if any errors are encountered, waiting |
796 | `async_reconnect_wait_sec` seconds between reconnection attempts. Note that no effort is made | 816 | `async_reconnect_wait_sec` seconds between reconnection attempts. Note that no effort is made |
797 | to "catch up" - events created while the connection is broken will not be received. If you need to make | 817 | to "catch up" - events created while the connection is broken will not be received. If you need to make |
798 | sure to get absolutely all notifications / deletes / toots, you will have to do that manually. | 818 | sure to get absolutely all notifications / deletes / toots, you will have to do that manually, e.g. |
819 | using the `on_abort` handler to fill in events since the last received one and then reconnecting. | ||
799 | 820 | ||
800 | The connection may be closed at any time by calling the handles close() method. The | 821 | The connection may be closed at any time by calling the handles close() method. The |
801 | current status of the handler thread can be checked with the handles is_alive() function, | 822 | current status of the handler thread can be checked with the handles is_alive() function, |