android-notify 0.3__tar.gz → 1.0__tar.gz

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.

@@ -1,10 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: android_notify
3
- Version: 0.3
3
+ Version: 1.0
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
 
@@ -29,22 +31,37 @@ Description-Content-Type: text/markdown
29
31
  Make sure you have the required dependencies installed:
30
32
 
31
33
  ```bash
32
- pip install android_notify
34
+ pip install android-notify
33
35
  ```
34
36
 
35
37
  ## Usage
36
38
 
39
+ **Prerequisites:**
40
+
41
+ - Buildozer
42
+ - Kivy
43
+
44
+ In your **`buildozer.spec`** file, ensure you include the following:
45
+
46
+ ```ini
47
+ # Add pyjnius so it's packaged with the build
48
+ requirements = python3,kivy,pyjnius
49
+
50
+ # Add permission for notifications
51
+ android.permissions = POST_NOTIFICATIONS
52
+
53
+ # Required dependencies (write exactly as shown, no quotation marks)
54
+ android.gradle_dependencies = androidx.core:core:1.6.0
55
+ android.enable_androidx = True
56
+ ```
57
+
37
58
  ### Example Notification
38
59
 
39
60
  ```python
40
61
  from android_notify.core import send_notification
41
62
 
42
63
  # Send a basic notification
43
- send_notification(
44
- title='Hello!',
45
- message='This is a sample notification.',
46
- style='big_text'
47
- )
64
+ send_notification("Hello", "This is a basic notification.")
48
65
 
49
66
  # Send a notification with an image
50
67
  send_notification(
@@ -60,6 +77,13 @@ send_notification(
60
77
  message='Line 1\nLine 2\nLine 3',
61
78
  style='inbox'
62
79
  )
80
+
81
+ # Send a Big Text notification (Note this send as a normal notification if not supported on said device)
82
+ send_notification(
83
+ title='Hello!',
84
+ message='This is a sample notification.',
85
+ style='big_text'
86
+ )
63
87
  ```
64
88
 
65
89
  ### Function Reference
@@ -89,27 +113,27 @@ send_notification(
89
113
  )
90
114
  ```
91
115
 
92
- ## Requirements
116
+ ## Contribution
93
117
 
94
- - Python 3.x
95
- - Kivy
96
- - Pyjnius
97
- - Android SDK (For building APKs)
118
+ Feel free to open issues or submit pull requests for improvements!
98
119
 
99
- ## License
120
+ ## 🐛 Reporting Issues
100
121
 
101
- This project is licensed under the MIT License.
122
+ Found a bug? Please open an issue on our [GitHub Issues](https://github.com/Fector101/android_notify/issues) page.
102
123
 
103
- ## Contribution
124
+ ## ☕ Support the Project
104
125
 
105
- Feel free to open issues or submit pull requests for improvements!
126
+ If you find TurboTask helpful, consider buying me a coffee! Your support helps maintain and improve the project.
127
+
128
+ <a href="https://www.buymeacoffee.com/fector101" target="_blank">
129
+ <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60">
130
+ </a>
106
131
 
107
132
  ## Author
108
133
 
109
- **Fabian** - *Full-Stack Developer* 🚀
134
+ - Fabian - <fector101@yahoo.com>
135
+ - GitHub: <https://github.com/Fector101/android_notify>
110
136
 
111
137
  ## Acknowledgments
112
138
 
113
139
  - Thanks to the Kivy and Pyjnius communities for their support.
114
- - Inspired by modern Android notification practices.
115
-
@@ -19,22 +19,37 @@
19
19
  Make sure you have the required dependencies installed:
20
20
 
21
21
  ```bash
22
- pip install android_notify
22
+ pip install android-notify
23
23
  ```
24
24
 
25
25
  ## Usage
26
26
 
27
+ **Prerequisites:**
28
+
29
+ - Buildozer
30
+ - Kivy
31
+
32
+ In your **`buildozer.spec`** file, ensure you include the following:
33
+
34
+ ```ini
35
+ # Add pyjnius so it's packaged with the build
36
+ requirements = python3,kivy,pyjnius
37
+
38
+ # Add permission for notifications
39
+ android.permissions = POST_NOTIFICATIONS
40
+
41
+ # Required dependencies (write exactly as shown, no quotation marks)
42
+ android.gradle_dependencies = androidx.core:core:1.6.0
43
+ android.enable_androidx = True
44
+ ```
45
+
27
46
  ### Example Notification
28
47
 
29
48
  ```python
30
49
  from android_notify.core import send_notification
31
50
 
32
51
  # Send a basic notification
33
- send_notification(
34
- title='Hello!',
35
- message='This is a sample notification.',
36
- style='big_text'
37
- )
52
+ send_notification("Hello", "This is a basic notification.")
38
53
 
39
54
  # Send a notification with an image
40
55
  send_notification(
@@ -50,6 +65,13 @@ send_notification(
50
65
  message='Line 1\nLine 2\nLine 3',
51
66
  style='inbox'
52
67
  )
68
+
69
+ # Send a Big Text notification (Note this send as a normal notification if not supported on said device)
70
+ send_notification(
71
+ title='Hello!',
72
+ message='This is a sample notification.',
73
+ style='big_text'
74
+ )
53
75
  ```
54
76
 
55
77
  ### Function Reference
@@ -79,27 +101,27 @@ send_notification(
79
101
  )
80
102
  ```
81
103
 
82
- ## Requirements
104
+ ## Contribution
83
105
 
84
- - Python 3.x
85
- - Kivy
86
- - Pyjnius
87
- - Android SDK (For building APKs)
106
+ Feel free to open issues or submit pull requests for improvements!
88
107
 
89
- ## License
108
+ ## 🐛 Reporting Issues
90
109
 
91
- This project is licensed under the MIT License.
110
+ Found a bug? Please open an issue on our [GitHub Issues](https://github.com/Fector101/android_notify/issues) page.
92
111
 
93
- ## Contribution
112
+ ## ☕ Support the Project
94
113
 
95
- Feel free to open issues or submit pull requests for improvements!
114
+ If you find TurboTask helpful, consider buying me a coffee! Your support helps maintain and improve the project.
115
+
116
+ <a href="https://www.buymeacoffee.com/fector101" target="_blank">
117
+ <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60">
118
+ </a>
96
119
 
97
120
  ## Author
98
121
 
99
- **Fabian** - *Full-Stack Developer* 🚀
122
+ - Fabian - <fector101@yahoo.com>
123
+ - GitHub: <https://github.com/Fector101/android_notify>
100
124
 
101
125
  ## Acknowledgments
102
126
 
103
127
  - Thanks to the Kivy and Pyjnius communities for their support.
104
- - Inspired by modern Android notification practices.
105
-
@@ -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.0
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
 
@@ -29,22 +31,37 @@ Description-Content-Type: text/markdown
29
31
  Make sure you have the required dependencies installed:
30
32
 
31
33
  ```bash
32
- pip install android_notify
34
+ pip install android-notify
33
35
  ```
34
36
 
35
37
  ## Usage
36
38
 
39
+ **Prerequisites:**
40
+
41
+ - Buildozer
42
+ - Kivy
43
+
44
+ In your **`buildozer.spec`** file, ensure you include the following:
45
+
46
+ ```ini
47
+ # Add pyjnius so it's packaged with the build
48
+ requirements = python3,kivy,pyjnius
49
+
50
+ # Add permission for notifications
51
+ android.permissions = POST_NOTIFICATIONS
52
+
53
+ # Required dependencies (write exactly as shown, no quotation marks)
54
+ android.gradle_dependencies = androidx.core:core:1.6.0
55
+ android.enable_androidx = True
56
+ ```
57
+
37
58
  ### Example Notification
38
59
 
39
60
  ```python
40
61
  from android_notify.core import send_notification
41
62
 
42
63
  # Send a basic notification
43
- send_notification(
44
- title='Hello!',
45
- message='This is a sample notification.',
46
- style='big_text'
47
- )
64
+ send_notification("Hello", "This is a basic notification.")
48
65
 
49
66
  # Send a notification with an image
50
67
  send_notification(
@@ -60,6 +77,13 @@ send_notification(
60
77
  message='Line 1\nLine 2\nLine 3',
61
78
  style='inbox'
62
79
  )
80
+
81
+ # Send a Big Text notification (Note this send as a normal notification if not supported on said device)
82
+ send_notification(
83
+ title='Hello!',
84
+ message='This is a sample notification.',
85
+ style='big_text'
86
+ )
63
87
  ```
64
88
 
65
89
  ### Function Reference
@@ -89,27 +113,27 @@ send_notification(
89
113
  )
90
114
  ```
91
115
 
92
- ## Requirements
116
+ ## Contribution
93
117
 
94
- - Python 3.x
95
- - Kivy
96
- - Pyjnius
97
- - Android SDK (For building APKs)
118
+ Feel free to open issues or submit pull requests for improvements!
98
119
 
99
- ## License
120
+ ## 🐛 Reporting Issues
100
121
 
101
- This project is licensed under the MIT License.
122
+ Found a bug? Please open an issue on our [GitHub Issues](https://github.com/Fector101/android_notify/issues) page.
102
123
 
103
- ## Contribution
124
+ ## ☕ Support the Project
104
125
 
105
- Feel free to open issues or submit pull requests for improvements!
126
+ If you find TurboTask helpful, consider buying me a coffee! Your support helps maintain and improve the project.
127
+
128
+ <a href="https://www.buymeacoffee.com/fector101" target="_blank">
129
+ <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60">
130
+ </a>
106
131
 
107
132
  ## Author
108
133
 
109
- **Fabian** - *Full-Stack Developer* 🚀
134
+ - Fabian - <fector101@yahoo.com>
135
+ - GitHub: <https://github.com/Fector101/android_notify>
110
136
 
111
137
  ## Acknowledgments
112
138
 
113
139
  - Thanks to the Kivy and Pyjnius communities for their support.
114
- - Inspired by modern Android notification practices.
115
-
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='android_notify',
5
- version='0.3',
5
+ version='1.0',
6
6
  author='Fabian',
7
7
  url='https://github.com/Fector101/android_notify/',
8
8
  description='A Python package for sending Android notifications.',
@@ -12,4 +12,8 @@ setup(
12
12
  long_description=open("README.md").read(),
13
13
  long_description_content_type="text/markdown",
14
14
  python_requires='>=3.6',
15
- )
15
+ project_urls={
16
+ 'Funding': 'https://buymeacoffee.com/fector101',
17
+ 'Source': 'https://github.com/Fector101/android_notify/',
18
+ },
19
+ )
File without changes