Skip to content

Commit 84d5194

Browse files
committed
Make the app parameter optional
1 parent 7cb4eee commit 84d5194

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Automatically store Device and FCM Token information for Firebase Auth Users in
1111
Add the following dependency to your `app/build.gradle`:
1212

1313
```
14-
implementation "com.csfrequency.firebase.devicestore:firebase-device-store:0.1.2"
14+
implementation "com.csfrequency.firebase.devicestore:firebase-device-store:0.1.3"
1515
```
1616

1717
## Example usage
@@ -71,7 +71,7 @@ Create a new DeviceStore.
7171
Parameters:
7272

7373
- `context`: `Context` the application context
74-
- `app`: `FirebaseApp` the Firebase App to use
74+
- `app`: `FirebaseApp` (Optional) the Firebase App to use. Defaults to the default Firebase App.
7575
- `collectionPath`: (Optional) `string` the Cloud Firestore collection where devices should be stored. Defaults to `user-devices`.
7676

7777
Returns a `FirebaseDeviceStore`.

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ ext {
6464
}
6565

6666
group = publishedGroupId
67-
version = '0.1.2'
67+
version = '0.1.3'
6868

6969
install {
7070
repositories.mavenInstaller {

src/main/java/com/csfrequency/firebase/devicestore/FirebaseDeviceStore.java

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public class FirebaseDeviceStore {
5252
private FirebaseUser currentUser = null;
5353
private boolean subscribed = false;
5454

55+
public FirebaseDeviceStore(Context context) {
56+
this(context, FirebaseApp.getInstance(), DEFAULT_COLLECTION_PATH);
57+
}
58+
5559
public FirebaseDeviceStore(Context context, FirebaseApp app) {
5660
this(context, app, DEFAULT_COLLECTION_PATH);
5761
}

0 commit comments

Comments
 (0)