Skip to content

Commit e5bac85

Browse files
committed
Update README.md
1 parent 8d60c61 commit e5bac85

4 files changed

Lines changed: 97 additions & 0 deletions

File tree

README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,95 @@ Port Firebase to Python
77
android.gradle_dependencies = io.github.simplejnius:sjfirebase:0.3.0
88
requirements = https://github.com/SimpleJnius/sj-firebase-python/archive/refs/heads/master.zip
99
```
10+
The current version of [python-for-android](https://github.com/kivy/python-for-android)
11+
lacks support for incorporating bom dependencies, modifying the classpath, and copying the `google-service.json`.
12+
To address this limitation, a fork of python-for-android has been developed to include these functionalities.
13+
To implement these changes in your `buildozer.spec` file,
14+
make adjustments to the specified section using the provided values below:
15+
```properties
16+
android.gradle_dependencies = io.github.simplejnius:sjfirebase:1.0.0,
17+
com.google.firebase:firebase-auth,com.google.firebase:firebase-database,
18+
com.google.firebase:firebase-firestore,com.google.firebase:firebase-storage,
19+
com.google.firebase:firebase-analytics
20+
p4a.fork = SimpleJnius
21+
p4a.branch = firebase
22+
```
23+
**Important Note:** Upon creating an Android project within your [Firebase Console](https://firebase.google.com),
24+
ensure to transfer the `google-service.json` file to the same location as your `main.py` file.
25+
#### Python(Buildozer) installation
26+
```shell
27+
# pip
28+
pip install sjfirebase
29+
30+
# buildozer.spec
31+
requirements = sjfirebase
32+
```
33+
### Python API
34+
#### ActionCodeSettings
35+
```python
36+
class sjfirebase.jclass.action.ActionCodeSettings
37+
```
38+
Structure that contains the required continue/state URL with optional Android and iOS bundle identifiers.
39+
The stateUrl used to initialize this class is the link/deep link/fallback url used while constructing the
40+
Firebase dynamic link.
41+
42+
**methods**
43+
- `newBuilder`
44+
##### Visit [ActionCodeSettings Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/ActionCodeSettings) for more API
45+
46+
#### SJFirebaseAuthEmai
47+
```python
48+
class sjfirebase.jclass.auth.SJFirebaseAuthEmai
49+
```
50+
The entry point of the Firebase Authentication SDK.
51+
First, obtain an instance of this class by calling `get_instance`
52+
53+
**methods**
54+
- check_user_signed_in
55+
- get_instance
56+
##### Visit [FirebaseAuth Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseAuth) for more API
57+
58+
#### SJFirebaseDatabase
59+
```python
60+
class sjfirebase.jclass.database.SJFirebaseDatabase
61+
```
62+
The entry point for accessing a Firebase Database.
63+
You can get an instance by calling getInstance.
64+
To access a location in the database and read or write data, use `get_ref`
65+
66+
**methods**
67+
- get_db
68+
- get_ref
69+
##### Visit [FirebaseDatabase Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/database/FirebaseDatabase) for more API
70+
71+
#### SJFirebaseFirestore
72+
```python
73+
class sjfirebase.jclass.firestore.SJFirebaseFirestore
74+
```
75+
76+
**methods**
77+
- get_db
78+
##### Visit [FirebaseFirestore Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FirebaseFirestore) for more API
79+
80+
#### SJFirebaseUser
81+
```python
82+
class sjfirebase.jclass.user.SJFirebaseUser
83+
```
84+
Represents a user's profile information in your Firebase project's user database.
85+
It also contains helper methods to change or retrieve profile information,
86+
as well as to manage that user's authentication state.
87+
88+
**methods**
89+
- get_current_user
90+
- profile_change_request_builder
91+
##### Visit [FirebaseUser Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser) for more API
92+
93+
#### OnCompleteListener
94+
```python
95+
class sjfirebase.jinterface.oncomplete.OnCompleteListener
96+
```
97+
Listener called when a Task completes.
98+
99+
**methods**
100+
- onComplete
101+
##### Visit [OnCompleteListener Documentation](https://developers.google.com/android/reference/com/google/android/gms/tasks/OnCompleteListener) for more API

sjfirebase/jclass/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
from .storage import *
33
from .firestore import *
44
from .database import *
5+
from .user import *
6+
from .action import *

sjfirebase/jinterface/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .oncomplete import *

sjfirebase/jinterface/oncomplete.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from jnius import PythonJavaClass, java_method
22

3+
__all__ = ("OnCompleteListener", )
4+
35

46
class OnCompleteListener(PythonJavaClass):
57
__javainterfaces__ = ["com/google/android/gms/tasks/OnCompleteListener"]

0 commit comments

Comments
 (0)