android-notify 0.3__py3-none-any.whl → 1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of android-notify might be problematic. Click here for more details.

android_notify/core.py CHANGED
@@ -3,6 +3,24 @@ from jnius import autoclass,cast
3
3
  import random
4
4
  import os
5
5
 
6
+
7
+ def asks_permission_if_needed():
8
+ """
9
+ Ask for permission to send notifications if needed.
10
+ """
11
+ # Get the required Java classes
12
+ from android.permissions import request_permissions, Permission,check_permission # type: ignore
13
+
14
+ def check_permissions(permissions):
15
+ for permission in permissions:
16
+ if check_permission(permission) != True:
17
+ return False
18
+ return True
19
+
20
+ permissions=[Permission.POST_NOTIFICATIONS]
21
+ if check_permissions(permissions):
22
+ request_permissions(permissions)
23
+
6
24
  def get_image_uri(relative_path):
7
25
  """
8
26
  Get the absolute URI for an image in the assets folder.
@@ -1,10 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: android-notify
3
- Version: 0.3
3
+ Version: 1.1
4
4
  Summary: A Python package for sending Android notifications.
5
5
  Home-page: https://github.com/Fector101/android_notify/
6
6
  Author: Fabian
7
7
  Author-email: fabianjoseph063@gmail.com
8
+ Project-URL: Funding, https://buymeacoffee.com/fector101
9
+ Project-URL: Source, https://github.com/Fector101/android_notify/
8
10
  Requires-Python: >=3.6
9
11
  Description-Content-Type: text/markdown
10
12
  Requires-Dist: pyjnius
@@ -30,22 +32,37 @@ Requires-Dist: pyjnius
30
32
  Make sure you have the required dependencies installed:
31
33
 
32
34
  ```bash
33
- pip install android_notify
35
+ pip install android-notify
34
36
  ```
35
37
 
36
38
  ## Usage
37
39
 
40
+ **Prerequisites:**
41
+
42
+ - Buildozer
43
+ - Kivy
44
+
45
+ In your **`buildozer.spec`** file, ensure you include the following:
46
+
47
+ ```ini
48
+ # Add pyjnius so it's packaged with the build
49
+ requirements = python3,kivy,pyjnius
50
+
51
+ # Add permission for notifications
52
+ android.permissions = POST_NOTIFICATIONS
53
+
54
+ # Required dependencies (write exactly as shown, no quotation marks)
55
+ android.gradle_dependencies = androidx.core:core:1.6.0
56
+ android.enable_androidx = True
57
+ ```
58
+
38
59
  ### Example Notification
39
60
 
40
61
  ```python
41
62
  from android_notify.core import send_notification
42
63
 
43
64
  # Send a basic notification
44
- send_notification(
45
- title='Hello!',
46
- message='This is a sample notification.',
47
- style='big_text'
48
- )
65
+ send_notification("Hello", "This is a basic notification.")
49
66
 
50
67
  # Send a notification with an image
51
68
  send_notification(
@@ -61,6 +78,13 @@ send_notification(
61
78
  message='Line 1\nLine 2\nLine 3',
62
79
  style='inbox'
63
80
  )
81
+
82
+ # Send a Big Text notification (Note this send as a normal notification if not supported on said device)
83
+ send_notification(
84
+ title='Hello!',
85
+ message='This is a sample notification.',
86
+ style='big_text'
87
+ )
64
88
  ```
65
89
 
66
90
  ### Function Reference
@@ -90,27 +114,27 @@ send_notification(
90
114
  )
91
115
  ```
92
116
 
93
- ## Requirements
117
+ ## Contribution
94
118
 
95
- - Python 3.x
96
- - Kivy
97
- - Pyjnius
98
- - Android SDK (For building APKs)
119
+ Feel free to open issues or submit pull requests for improvements!
99
120
 
100
- ## License
121
+ ## 🐛 Reporting Issues
101
122
 
102
- This project is licensed under the MIT License.
123
+ Found a bug? Please open an issue on our [GitHub Issues](https://github.com/Fector101/android_notify/issues) page.
103
124
 
104
- ## Contribution
125
+ ## ☕ Support the Project
105
126
 
106
- Feel free to open issues or submit pull requests for improvements!
127
+ If you find this project helpful, consider buying me a coffee! Your support helps maintain and improve the project.
128
+
129
+ <a href="https://www.buymeacoffee.com/fector101" target="_blank">
130
+ <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60">
131
+ </a>
107
132
 
108
133
  ## Author
109
134
 
110
- **Fabian** - *Full-Stack Developer* 🚀
135
+ - Fabian - <fector101@yahoo.com>
136
+ - GitHub: <https://github.com/Fector101/android_notify>
111
137
 
112
138
  ## Acknowledgments
113
139
 
114
140
  - Thanks to the Kivy and Pyjnius communities for their support.
115
- - Inspired by modern Android notification practices.
116
-
@@ -0,0 +1,8 @@
1
+ android_notify/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ android_notify/__main__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ android_notify/core.py,sha256=0edRXIF6ltTboJtkGjnOhLJDrYCYa2fzrB7cy61Y1PM,6598
4
+ android_notify/styles.py,sha256=P_8sAqb3Hbf_vbhqSoCVjKeqJ05Fr_CksO-HX5pj8pU,134
5
+ android_notify-1.1.dist-info/METADATA,sha256=q2w4ak4jAcfJ9103bpKU-kPXdFdVgtpc4cbI7z5nd9I,3808
6
+ android_notify-1.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
7
+ android_notify-1.1.dist-info/top_level.txt,sha256=IR1ONMrRSRINZpWn2X0dL5gbWwWINsK7PW8Jy2p4fU8,15
8
+ android_notify-1.1.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- android_notify/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- android_notify/__main__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- android_notify/core.py,sha256=_OlwriMgR3qqC_kDZf_fvuOO9_UO0SOkg49n2P2bKfQ,6040
4
- android_notify/styles.py,sha256=P_8sAqb3Hbf_vbhqSoCVjKeqJ05Fr_CksO-HX5pj8pU,134
5
- android_notify-0.3.dist-info/METADATA,sha256=9cF2tcS-mrMifHQqdbnD1ywoxiElkcjS8eNaiyKluB8,2761
6
- android_notify-0.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
7
- android_notify-0.3.dist-info/top_level.txt,sha256=IR1ONMrRSRINZpWn2X0dL5gbWwWINsK7PW8Jy2p4fU8,15
8
- android_notify-0.3.dist-info/RECORD,,