Skip to content

Commit

Permalink
Updated with small changes to fix blocking Android bug
Browse files Browse the repository at this point in the history
  • Loading branch information
auser committed Jan 13, 2017
1 parent 17b870d commit d9babd5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
12 changes: 6 additions & 6 deletions android/build.gradle
Expand Up @@ -22,11 +22,11 @@ dependencies {
compile 'com.facebook.react:react-native:0.20.+'
compile 'com.google.android.gms:play-services-base:+'

compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-auth:9.8.0'
compile 'com.google.firebase:firebase-analytics:9.8.0'
compile 'com.google.firebase:firebase-database:9.8.0'
compile 'com.google.firebase:firebase-storage:9.8.0'
compile 'com.google.firebase:firebase-messaging:9.8.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-analytics:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
}

Expand Up @@ -29,8 +29,8 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
modules.add(new FirestackAuthModule(reactContext));
modules.add(new FirestackDatabaseModule(reactContext));
modules.add(new FirestackAnalyticsModule(reactContext));
modules.add(new FirestackStorageModule(reactContext));
modules.add(new FirestackCloudMessaging(reactContext));
modules.add(new FirestackStorage(reactContext));
// modules.add(new FirestackCloudMessaging(reactContext));

This comment has been minimized.

Copy link
@buhe

buhe Mar 18, 2017

Why comment this module?

return modules;
}

Expand Down
Expand Up @@ -43,7 +43,7 @@
import com.google.firebase.storage.StorageMetadata;
import com.google.firebase.storage.StorageReference;

class FirestackStorageModule extends ReactContextBaseJavaModule {
class FirestackStorage extends ReactContextBaseJavaModule {

private static final String TAG = "FirestackStorage";
private static final String DocumentDirectoryPath = "DOCUMENT_DIRECTORY_PATH";
Expand All @@ -53,6 +53,7 @@ class FirestackStorageModule extends ReactContextBaseJavaModule {
private static final String TemporaryDirectoryPath = "TEMPORARY_DIRECTORY_PATH";
private static final String CachesDirectoryPath = "CACHES_DIRECTORY_PATH";
private static final String DocumentDirectory = "DOCUMENT_DIRECTORY_PATH";
private static final String BundlePath = "MAIN_BUNDLE_PATH";

private static final String FileTypeRegular = "FILETYPE_REGULAR";
private static final String FileTypeDirectory = "FILETYPE_DIRECTORY";
Expand All @@ -62,8 +63,10 @@ class FirestackStorageModule extends ReactContextBaseJavaModule {
private ReactContext mReactContext;
private FirebaseApp app;

public FirestackStorageModule(ReactApplicationContext reactContext) {
public FirestackStorage(ReactApplicationContext reactContext) {
super(reactContext);

Log.d(TAG, "Attaching FirestackStorage");
this.context = reactContext;
mReactContext = reactContext;

Expand Down Expand Up @@ -279,6 +282,7 @@ public Map<String, Object> getConstants() {
constants.put(CachesDirectoryPath, this.getReactApplicationContext().getCacheDir().getAbsolutePath());
constants.put(FileTypeRegular, 0);
constants.put(FileTypeDirectory, 1);
constants.put(BundlePath, null);

File externalStorageDirectory = Environment.getExternalStorageDirectory();
if (externalStorageDirectory != null) {
Expand Down
2 changes: 2 additions & 0 deletions lib/modules/storage.js
Expand Up @@ -6,6 +6,8 @@ const FirestackStorageEvt = new NativeEventEmitter(FirestackStorage);
import promisify from '../utils/promisify'
import { Base, ReferenceBase } from './base'

console.log('FirestackStorage ---->', FirestackStorage);

class StorageRef extends ReferenceBase {
constructor(storage, path) {
super(storage.firestack, path);
Expand Down

0 comments on commit d9babd5

Please sign in to comment.