Coder Social home page Coder Social logo

evanbacon / expo-native-firebase Goto Github PK

View Code? Open in Web Editor NEW
209.0 16.0 41.0 902.56 MB

πŸ”₯ Native Firebase Expo App (iOS, Android) Demo for Firestore, Notifications, Analytics, Storage, Messaging, Database 🚨

JavaScript 66.37% Java 9.10% Ruby 7.86% Objective-C 9.49% Starlark 7.19%
firebase react-native expo android ios objective-c java es6 javascript template

expo-native-firebase's Introduction

You can now just use the built-in Expo Go Firebase modules, or RNFirebase with managed EAS Build

expo-native-firebase's People

Contributors

evanbacon avatar ijzerenhein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

expo-native-firebase's Issues

Weekly Digest (26 January, 2020 - 2 February, 2020)

Here's the Weekly Digest for EvanBacon/expo-native-firebase:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there was 1 stargazer.
⭐ cf8
You are the star! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please πŸ‘€ Watch and ⭐ Star the repository EvanBacon/expo-native-firebase to receive next weekly updates. πŸ˜ƒ

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. πŸ“†

I only need expo-firebase-analytics, But this never works

One more issue is this, I only need expo-firebase-analytics, But this never works, I had to import all the packages, performance, database, auth, functions... all. If we skip any, android app crashes saying error message like: can't find module expo-firebase-auth, even If don't use this.

I tried using rn firebase as well, but it makes things more complicated, Their official doc says

"Due to some breaking changes in v12+ of the Android Firebase libraries, you'll need to upgrade your Gradle version to at least v4.4"

whereas expo eject guide does not recommend to upgrade.

In one of the post on medium you clearly mentioned this:

"By having separate modules we can enable developers to create much slimmer apps. If there is a library you don’t want, or don’t need, just don’t include it"

But, I guess this does not work that way

Please help
@EvanBacon

Gradle Sync Failure

Hi Evan,

I was trying to set up a new project (for android predominantly atm), and after I had followed all the steps, I let Android Studio Sync the Gradle files, and it gave me this error (errorlog1.txt), then I commented out those lines and am left with this (errorlog2.txt), and have no clue where to go.

Respectfully,
Aditya A.

errorlog1.txt
errorlog2.txt

State of project

Hello

As I know there is no possibility to use native Firebase packages in Expo, so what is the state of this project? Is it recommended for ExpoKit? Or should we use packages from https://rnfirebase.io?

NoSuchMethodError on android

screenshot_1518045351

I have followed the tutorial and it works fine on iOS but received the above error. I have asked the same question on RNFirebase and they said it's because the version of the google play services libraries (9.8.0) doesn't have that method. (invertase/react-native-firebase#818)

So I downgraded RNFirebase to 3.2.0 and even 3.0.0 but still having the same problem. I saw in your project's package.json you're using "^3.2.2" so I suppose that wasn't the case.

Also, some people mentioned it could be due to unmatching versions of google play service and firebase mine are all of the same version of '9.8.0'

my app/build.graddle:

buildscript {
  repositories {
    maven { url 'https://maven.fabric.io/public' }
  }

  dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
  }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
  maven { url 'https://maven.fabric.io/public' }
}

android {
  compileSdkVersion 26
  buildToolsVersion '26.0.2'

  defaultConfig {
    applicationId 'com.resure.glever'
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 5
    versionName '0.9.5'
    ndk {
      abiFilters 'armeabi-v7a', 'x86'
    }
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    // Deprecated. Used by net.openid:appauth
    manifestPlaceholders = [
      'appAuthRedirectScheme': 'host.exp.exponent'
    ]
  }
  dexOptions {
    javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
  }

  // Specifies two flavor dimensions.
  flavorDimensions "dev"

  productFlavors {
    // Define separate dev and prod product flavors.
    dev {
      // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
      // to pre-dex each module and produce an APK that can be tested on
      // Android Lollipop without time consuming dex merging processes.
      dimension "dev"
      minSdkVersion 21
    }
   
  }
  buildTypes {
    debug {
      debuggable true
    }
    release {
      minifyEnabled true
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      zipAlignEnabled true
    }
  }
    signingConfigs {
        debug {
            storeFile file('../debug.keystore')
        }
        devRelease {
            storeFile file('../debug.keystore')
        }
    }
  lintOptions {
    abortOnError false
  }
}

// Don't use modern jsc-android since it still has some critical bugs that
// crash applications when the string for the JS bundle is loaded and when
// locale-specific date functions are called.
// configurations.all {
//   resolutionStrategy {
//     force 'org.webkit:android-jsc:r216113'
//   }
// }


task exponentPrebuildStep(type: Exec) {
  workingDir '../'
  if (System.getProperty('os.name').toLowerCase().contains('windows')) {
    commandLine 'cmd', '/c', '.\\detach-scripts\\prepare-detached-build.bat'
  } else {
    commandLine './detach-scripts/prepare-detached-build.sh'
  }
}
preBuild.dependsOn exponentPrebuildStep


dependencies {

    compile(project(':react-native-firebase')) {
        transitive = false
    }
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:multidex:1.0.1'
    // Our dependencies
    compile 'com.android.support:appcompat-v7:26.0.1'
    // Our dependencies from ExpoView
    // DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
    compile 'com.android.support:appcompat-v7:26.0.1'
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
    compile('com.facebook.android:audience-network-sdk:4.22.1') {
        exclude module: 'play-services-ads'
    }
    provided 'org.glassfish:javax.annotation:3.1.1'
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'com.amplitude:android-sdk:2.9.2'
    // Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.android.gms:play-services-gcm:9.8.0'
    compile 'com.google.android.gms:play-services-analytics:9.8.0'
    compile 'com.google.android.gms:play-services-maps:9.8.0'
    compile 'com.google.android.gms:play-services-auth:9.8.0'
    compile 'com.google.android.gms:play-services-location:9.8.0'
    compile 'com.google.android.gms:play-services-ads:9.8.0'
    compile 'com.google.android.gms:play-services-base:9.8.0'
    compile 'com.google.firebase:firebase-core:9.8.0'
    compile 'com.google.firebase:firebase-analytics:9.8.0'
    annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
    compile 'com.raizlabs.android:DBFlow-Core:2.2.1'
    compile 'com.raizlabs.android:DBFlow:2.2.1'
    compile 'com.madgag.spongycastle:core:1.53.0.0'
    compile 'com.madgag.spongycastle:prov:1.53.0.0'
    debugCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
    // debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
    compile 'com.facebook.device.yearclass:yearclass:1.0.1'
    compile 'commons-io:commons-io:1.3.2'
    compile 'me.leolin:ShortcutBadger:1.1.4@aar'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
    compile 'com.yqritc:android-scalablevideoview:1.0.1'
    compile 'commons-codec:commons-codec:1.10'
    compile 'com.segment.analytics.android:analytics:4.3.0'
    compile 'com.google.zxing:core:3.2.1'
    compile 'net.openid:appauth:0.4.1'
    compile 'com.airbnb.android:lottie:2.2.0'
    compile 'io.branch.sdk.android:library:2.6.1'
    compile('io.nlopez.smartlocation:library:3.2.11') {
        transitive = false
    }
    compile 'com.android.support:exifinterface:26.0.1'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
    compile 'com.squareup.okhttp3:okhttp-ws:3.4.1'
    compile 'com.squareup.okio:okio:1.9.0'
    // Testing
    androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
    // We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
    androidTestCompile 'com.android.support.test:runner:1.0.1'
    androidTestCompile 'com.android.support:support-annotations:26.0.1'
    androidTestCompile 'com.google.code.findbugs:jsr305:3.0.0'
    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
    androidTestCompile 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
    compile('host.exp.exponent:expoview:25.0.0@aar') {
        transitive = true
    }
}

// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'

my project gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
  repositories {
    jcenter()
    maven { url 'https://maven.google.com' }
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath 'com.google.gms:google-services:3.1.2'
    classpath 'de.undercouch:gradle-download-task:2.0.0'
    classpath 'com.google.firebase:firebase-plugins:1.1.1'
  }
}

allprojects {
  repositories {
    google()
    maven {
      url "$rootDir/maven"
    }
    maven {
      // We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
      url "$rootDir/maven-test"
    }
    jcenter()
    maven {
      // Local Maven repo containing AARs with JSC built for Android
      url "$rootDir/../js/node_modules/jsc-android/android"
    }
    flatDir {
      dirs 'libs'
      // dirs project(':expoview').file('libs')
    }
    maven { url "https://jitpack.io" }
    maven {
      url 'https://maven.google.com'
    }

    // Want this last so that we never end up with a stale cache
    mavenLocal()
  }
}

task clean(type: Delete) {
  delete rootProject.buildDir
}


Weekly Digest (23 January, 2020 - 30 January, 2020)

Here's the Weekly Digest for EvanBacon/expo-native-firebase:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please πŸ‘€ Watch and ⭐ Star the repository EvanBacon/expo-native-firebase to receive next weekly updates. πŸ˜ƒ

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. πŸ“†

App crashed when using firebase.firestore.FieldValue.serverTimestamp()

When use firebase.firestore.FieldValue.serverTimestamp(), the app would be terminated by Xcode with an error message "libc++abi.dylib: terminating with uncaught exception of type NSException
", and it looks like there is a type error in EXFirebaseFirestoreDocumentReference.m at #422,

NSString *string = (NSString *) value;

but value is NSDictionary instead of NSString, so when modified #422 to

NSString *string = (NSString *) value[typeKey];

it works fine.

Error: You attempted to use a firebase module that's not installed on your Android project by calling firebase.app()

Hey,

I have been strictly following the guide ever since i ejected from Expo to Expo Bare. For IOS the tutorial worked as expected, everything is running as it should. However, today I tried to do the same for Android. Everytime I launch the application I get the following error message:
"Error: You attempted to use a firebase module that's not installed on your Android project by calling firebase.app()"

I've tried to upgrade the gradle version to 5.1.1, cleaned and sheared the project, and even tried to manually integrating the core app (see: https://invertase.io/oss/react-native-firebase/v6/app/android) - but no luck.

Do you have any input on this matter?

83807002_204271280713427_791787511759241216_n

Firebase auth signInWithCredential

Hello,

I am using react-native-fbsdk to sign in users with facebook and firebase

I am using this function

try {
        const currentUser = await firebase
          .auth()
          .signInWithCredential(credential);
        } catch (e) {
        console.log(e);
      }

it works fine on both apple and android,

But if the user is disabled in firebase, it works only on IOS and throws an error

the problem is on android that the currentUser promise never returns anything, not an error nor nothing and it takes forever without returning when the user is disabled in firebase

it was working fine using rnFirebase, but when I switched to expo-native-firebase, it doesn't work when the user is disabled,

I am not sure what is causing this.

Thank you

The Expo SDK requires Expo to run

Hello there,

I followed the toturial, and everything is fine on iOS, but on Android, even though it builds is ok, I get this error when trying to run the app on the simulator

W/ReactNativeJS:
No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?
E/ReactNativeJS: The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo.

versions

node: 11.6.0
npm: 6.5.0
expo-cli: 2.6.14
yarn: 1.12.3

package.json

...
"dependencies": {
    "expo": "^32.0.0",
    "expo-firebase-analytics": "^2.0.0",
    "expo-firebase-app": "^2.0.0",
    "expo-firebase-auth": "^2.0.0",
    "expo-firebase-crashlytics": "^2.0.0",
    "expo-firebase-database": "^2.0.0",
    "expo-firebase-firestore": "^2.0.0",
    "expo-firebase-functions": "^2.0.0",
    "expo-firebase-instance-id": "^2.0.0",
    "expo-firebase-invites": "^2.0.0",
    "expo-firebase-links": "^2.0.0",
    "expo-firebase-messaging": "^2.0.0",
    "expo-firebase-notifications": "^2.0.0",
    "expo-firebase-performance": "^2.0.0",
    "expo-firebase-remote-config": "^2.0.0",
    "expo-firebase-storage": "^2.0.0",
    "expokit": "32.0.1",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
  },
...

settings.gradle

include ':app'
def modulesDir = new File(rootDir, "../node_modules")
def includeUniversalModule = { name ->
    include ":$name"
    project(":$name").projectDir = new File(modulesDir, "$name/android")
}
[
        'expo-core',
        'expo-firebase-app'
].forEach({ moduleName -> includeUniversalModule(moduleName) })

MainActivity.java

...
  @Override
  public List<Package> expoPackages() {
    return Arrays.<Package>asList(
            new FirebaseAppPackage()
    );
  }
...

app/build.gradle ❗ (here I found some code that is not present in your tutorial)

...
api project(':expo-core')
api project(':expo-firebase-app')

// below this line is some code that isn’t present in your tutorial, but it was here after I ejected
api 'com.facebook.react:react-native:32.0.0'
api 'host.exp.exponent:expo-app-loader-provider:1.0.0'
api 'host.exp.exponent:expo-core:2.0.0'
api 'host.exp.exponent:expo-constants-interface:2.0.0'
api 'host.exp.exponent:expo-constants:2.0.0'
api 'host.exp.exponent:expo-errors:1.0.0'
api 'host.exp.exponent:expo-file-system-interface:2.0.0'
api 'host.exp.exponent:expo-file-system:2.0.0'
api 'host.exp.exponent:expo-image-loader-interface:2.0.0'
api 'host.exp.exponent:expo-permissions:2.0.0'
api 'host.exp.exponent:expo-permissions-interface:2.0.0'
api 'host.exp.exponent:expo-sensors-interface:2.0.0'
api 'host.exp.exponent:expo-react-native-adapter:2.0.0'
api 'host.exp.exponent:expo-task-manager:1.0.0'
api 'host.exp.exponent:expo-task-manager-interface:1.0.0'

// Optional universal modules, could be removed
// along with references in MainActivity
api 'host.exp.exponent:expo-ads-admob:2.0.0'
api 'host.exp.exponent:expo-app-auth:2.0.0'
api 'host.exp.exponent:expo-analytics-segment:2.0.0'
api 'host.exp.exponent:expo-barcode-scanner-interface:2.0.0'
api 'host.exp.exponent:expo-barcode-scanner:2.0.0'
api 'host.exp.exponent:expo-camera-interface:2.0.0'
api 'host.exp.exponent:expo-camera:2.0.0'
api 'host.exp.exponent:expo-contacts:2.0.0'
api 'host.exp.exponent:expo-face-detector:2.0.0'
api 'host.exp.exponent:expo-face-detector-interface:2.0.0'
api 'host.exp.exponent:expo-font:2.0.0'
api 'host.exp.exponent:expo-gl-cpp:2.0.0'
api 'host.exp.exponent:expo-gl:2.0.0'
api 'host.exp.exponent:expo-google-sign-in:2.0.0'
api 'host.exp.exponent:expo-local-authentication:2.0.0'
api 'host.exp.exponent:expo-localization:2.0.0'
api 'host.exp.exponent:expo-location:2.0.0'
api 'host.exp.exponent:expo-media-library:2.0.0'
api 'host.exp.exponent:expo-print:2.0.0'
api 'host.exp.exponent:expo-sensors:2.0.0'
api 'host.exp.exponent:expo-sms:2.0.0'
api 'host.exp.exponent:expo-background-fetch:1.0.0'
...

I think it's because of the expoKit/expoCore versions (which are different from the ones in the tutorial). Something is different from your version after ejecting. Can you help fix this?

Thanks

Error:(5, 8) error: duplicate class: host.exp.exponent.BuildVariantConstants

Followed all steps but have this problem:

Information:Gradle tasks [:app:assembleDevDevRemoteKernelProdDebug, :react-native-firebase:assembleDebug]
/Users/ethanwang/Github/reactnative/Glever/android/app/src/devRemoteKernel/java/host/exp/exponent/BuildVariantConstants.java
Error:(5, 8) error: duplicate class: host.exp.exponent.BuildVariantConstants
/Users/ethanwang/Github/reactnative/Glever/android/app/src/dev/java/host/exp/exponent/BuildVariantConstants.java
Error:(5, 8) error: duplicate class: host.exp.exponent.BuildVariantConstants
Error:Execution failed for task ':app:compileDevDevRemoteKernelProdDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Information:BUILD FAILED in 2s
Information:3 errors
Information:0 warnings
Information:See complete output in console

Firebase onAuthStateChanged not called on expo reload

I can use all firebase SDKs without problems.

I call onAuthStateChanged like so in my app.

import firebase from 'expo-firebase-app'

export default class LoadingScreen extends React.Component {
  componentDidMount() {
    this._unsubscribe = firebase.auth().onAuthStateChanged(user => {
      setTimeout(() => {
        this.props.navigation.navigate(user ? 'Main' : 'Introduction'); //Welcome / Introduction
      }, 1500)
    });
  }
  componentWillUnmount() {
    this._unsubscribe();
  }
}

When I first start up the app, the callback in onAuthStateChanged triggered fine. However, if I do a reload of the app by saving any file inside the proyect, it doesn't call the callback anymore.

If I close and reopen the app, then it works again.

ExpoFirebase core module was not found

screenshot_20190227-111923

i have this issue.

androind settings.gradle

include ':app'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')

include ':expo-core'
project(':expo-core').projectDir = new File(rootProject.projectDir, '../node_modules/expo-core/android')
include ':expo-firebase-app'
project(':expo-firebase-app').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-app/android')
include ':expo-firebase-analytics'
project(':expo-firebase-analytics').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-analytics/android')
include ':expo-firebase-auth'
project(':expo-firebase-auth').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-auth/android')
include ':expo-firebase-crashlytics'
project(':expo-firebase-crashlytics').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-crashlytics/android')
include ':expo-firebase-database'
project(':expo-firebase-database').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-database/android')
include ':expo-firebase-firestore'
project(':expo-firebase-firestore').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-firestore/android')
include ':expo-firebase-functions'
project(':expo-firebase-functions').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-functions/android')
include ':expo-firebase-instance-id'
project(':expo-firebase-instance-id').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-instance-id/android')
include ':expo-firebase-invites'
project(':expo-firebase-invites').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-invites/android')
include ':expo-firebase-links'
project(':expo-firebase-links').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-links/android')
include ':expo-firebase-performance'
project(':expo-firebase-performance').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-performance/android')
include ':expo-firebase-remote-config'
project(':expo-firebase-remote-config').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-remote-config/android')
include ':expo-firebase-storage'
project(':expo-firebase-storage').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-storage/android')

android app build.gradle

buildscript {
  repositories {
    google()
    maven { url 'https://maven.fabric.io/public' }
  }

  dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
  }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
  maven { url 'https://maven.fabric.io/public' }
}

android {
  compileSdkVersion 27
  buildToolsVersion '27.0.3'

  defaultConfig {
    applicationId 'application_name'
    targetSdkVersion 26
    versionCode 1
    versionName '2.0.2'
    ndk {
      abiFilters 'armeabi-v7a', 'x86'
    }
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    // Deprecated. Used by net.openid:appauth
    manifestPlaceholders = [
      'appAuthRedirectScheme': 'host.exp.exponent'
    ]
  }
  dexOptions {
    javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
  }

  flavorDimensions 'minSdk', 'remoteKernel'
  productFlavors {
    devKernel {
      dimension 'remoteKernel'
    }
    prodKernel {
      dimension 'remoteKernel'
    }
    devMinSdk {
      dimension 'minSdk'
      // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
      // to pre-dex each module and produce an APK that can be tested on
      // Android Lollipop without time consuming dex merging processes.
      minSdkVersion 21
    }
    prodMinSdk {
      dimension 'minSdk'
      minSdkVersion 21
    }
  }
  buildTypes {
    debug {
      debuggable true
      ext.enableCrashlytics = false
    }
    release {
      minifyEnabled true
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      zipAlignEnabled true
    }
  }
  signingConfigs {
    debug {
      storeFile file('../debug.keystore')
    }
  }
  lintOptions {
    abortOnError false
  }
  packagingOptions {
    pickFirst "**"
  }
  configurations.all {
    resolutionStrategy.force 'com.android.support:design:27.1.0'
  }
}


configurations.all {
  resolutionStrategy {
    force 'org.webkit:android-jsc:r224109'
  }
}


apply from: 'expo.gradle'


dependencies {
    compile project(':react-native-vector-icons')
    compile project(':react-native-linear-gradient')
  implementation fileTree(dir: 'libs', include: ['*.jar'])

  implementation 'com.android.support:multidex:1.0.1'

  // Our dependencies
  implementation 'com.android.support:appcompat-v7:27.1.1'

  // Our dependencies from ExpoView
  // DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
  implementation 'com.android.support:appcompat-v7:27.1.1'
  implementation 'com.facebook.android:facebook-android-sdk:4.37.0'
  implementation('com.facebook.android:audience-network-sdk:4.99.0') {
    exclude module: 'play-services-ads'
  }
  compileOnly 'org.glassfish:javax.annotation:3.1.1'
  implementation 'com.jakewharton:butterknife:8.4.0'
  implementation 'de.greenrobot:eventbus:2.4.0'
  implementation 'com.amplitude:android-sdk:2.9.2' // Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
  implementation 'com.squareup.picasso:picasso:2.5.2'
  implementation 'com.google.android.gms:play-services-gcm:15.0.1'
  implementation 'com.google.android.gms:play-services-analytics:16.0.1'
  implementation 'com.google.android.gms:play-services-maps:15.0.1'
  implementation 'com.google.android.gms:play-services-auth:15.0.1'
  implementation 'com.google.android.gms:play-services-location:15.0.1'
  implementation 'com.google.android.gms:play-services-ads:15.0.1'
  annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
  implementation "com.raizlabs.android:DBFlow-Core:2.2.1"
  implementation "com.raizlabs.android:DBFlow:2.2.1"
  implementation "com.madgag.spongycastle:core:1.53.0.0"
  implementation "com.madgag.spongycastle:prov:1.53.0.0"
  debugImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
  // debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
  releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
  implementation 'com.facebook.device.yearclass:yearclass:1.0.1'
  implementation 'commons-io:commons-io:1.3.2'
  implementation 'me.leolin:ShortcutBadger:1.1.4@aar'
  implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
  implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
  implementation 'com.yqritc:android-scalablevideoview:1.0.1'
  implementation 'commons-codec:commons-codec:1.10'
  implementation 'com.segment.analytics.android:analytics:4.3.0'
  implementation 'com.google.zxing:core:3.2.1'
  implementation 'net.openid:appauth:0.4.1'
  implementation('com.airbnb.android:lottie:2.5.5')  {
      exclude group: 'com.android.support', module: 'appcompat-v7'
  }
  implementation 'io.branch.sdk.android:library:2.17.1'
  implementation('io.nlopez.smartlocation:library:3.2.11') {
    transitive = false
  }
  implementation 'com.android.support:exifinterface:27.1.1'
  implementation 'com.squareup.okio:okio:1.9.0'
  implementation 'com.facebook.soloader:soloader:0.5.1'

  implementation 'com.google.android.exoplayer:exoplayer:2.6.1'
  implementation 'expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1@aar'

  // expo-file-system
  implementation 'com.squareup.okhttp3:okhttp:3.10.0'
  implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'

  // Testing
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  // We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
  androidTestImplementation 'com.android.support.test:runner:1.0.1'
  androidTestImplementation 'com.android.support:support-annotations:27.1.1'
  androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
  androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
  androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'

  testImplementation 'junit:junit:4.12'
  testImplementation 'org.mockito:mockito-core:1.10.19'
  testImplementation 'org.robolectric:robolectric:3.8'
  testImplementation 'com.android.support.test:runner:1.0.2-alpha1'
  testImplementation 'com.android.support.test:rules:1.0.2-alpha1'

  
  implementation('host.exp.exponent:expoview:31.0.0@aar') {
    transitive = true
    exclude group: 'com.squareup.okhttp3', module: 'okhttp'
    exclude group: 'com.squareup.okhttp3', module: 'okhttp-urlconnection'
  }

	api project(':expo-core')
  api project(':expo-firebase-analytics')
  api project(':expo-firebase-app')
  api project(':expo-firebase-auth')
  api project(':expo-firebase-crashlytics')
  api project(':expo-firebase-database')
  api project(':expo-firebase-firestore')
  api project(':expo-firebase-functions')
  api project(':expo-firebase-instance-id')
  api project(':expo-firebase-invites')
  api project(':expo-firebase-links')
  api project(':expo-firebase-performance')
  api project(':expo-firebase-remote-config')
	api project(':expo-firebase-storage')
  

}

// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'

MainActivity.java

package host.exp.exponent;

import android.os.Bundle;

import com.facebook.react.ReactPackage;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import expo.core.interfaces.Package;
import expo.modules.firebase.analytics.FirebaseAnalyticsPackage;
import expo.modules.firebase.app.FirebaseAppPackage;
import expo.modules.firebase.auth.FirebaseAuthPackage;
import expo.modules.firebase.fabric.crashlytics.FirebaseCrashlyticsPackage;
import expo.modules.firebase.database.FirebaseDatabasePackage;
import expo.modules.firebase.firestore.FirebaseFirestorePackage;
import expo.modules.firebase.functions.FirebaseFunctionsPackage;
import expo.modules.firebase.instanceid.FirebaseInstanceIDPackage;
import expo.modules.firebase.invites.FirebaseInvitesPackage;
import expo.modules.firebase.links.FirebaseLinksPackage;
import expo.modules.firebase.performance.FirebasePerformancePackage;
import expo.modules.firebase.remoteconfig.FirebaseRemoteConfigPackage;
import expo.modules.firebase.storage.FirebaseStoragePackage;

import host.exp.exponent.generated.DetachBuildConstants;
import host.exp.exponent.experience.DetachActivity;

public class MainActivity extends DetachActivity {

  @Override
  public String publishedUrl() {
    return "exp://exp.host/@resal-team/resalApp";
  }

  @Override
  public String developmentUrl() {
    return DetachBuildConstants.DEVELOPMENT_URL;
  }

  @Override
  public List<String> sdkVersions() {
    return new ArrayList<>(Arrays.asList("31.0.0"));
  }

  @Override
  public List<ReactPackage> reactPackages() {
    return ((MainApplication) getApplication()).getPackages();
  }

  @Override
  public List<Package> expoPackages() {
    // Here you can add your own packages.
		return Arrays.<Package>asList(
			
      new FirebaseAppPackage(),
      new FirebaseAnalyticsPackage(),
      new FirebaseAuthPackage(),
      new FirebaseCrashlyticsPackage(),
      new FirebaseDatabasePackage(),
      new FirebaseFirestorePackage(),
      new FirebaseFunctionsPackage(),
      new FirebaseInstanceIDPackage(),
      new FirebaseInvitesPackage(),
      new FirebaseLinksPackage(),
      new FirebasePerformancePackage(),
      new FirebaseRemoteConfigPackage(),
      new FirebaseStoragePackage()
	);
    // return super.expoPackages();
  }

  @Override
  public boolean isDebug() {
    return BuildConfig.DEBUG;
  }

  @Override
  public Bundle initialProps(Bundle expBundle) {
    // Add extra initialProps here
    return expBundle;
  }
}

Any suggestion.

On mac, run-exp.sh finished with non-zero exit value 127

org.gradle.process.internal.ExecException: Process 'command './node_modules/expokit/detach-scripts/run-exp.sh'' finished with non-zero exit value 127

contents of file:
#!/bin/bash


value=$(cat ~/.expo/PATH)
PATH="$PATH:$value" exp "$@"
# For testing
# PATH="$PATH:$value" ../../dev/exp/bin/exp.js "$@"

running these manually:
MacBook-Pro:Egghunt user$ cat ~/.expo/PATH
/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/sbin:/Users/user/.fastlane/bin:/Users/user/.composer/vendor/bin:/usr/local/mysql/bin:/.npm-global/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/user/Library/Android/sdk/emulator:/Users/user/Library/Android/sdk/tools:/Users/user/Library/Android/sdk/tools/bin:/Users/user/Library/Android/sdk/platform

MacBMacBook-Pro:Egghunt user$ PATH="$PATH:$value" exp "$@"
-bash: exp: command not found

Should be expo not exp?

Or do i need to npm install -g exp

Doing either - installing exp or using expo, let Android Studio build successfully..

though doing exp whoami says:
We've built a brand new CLI for Expo!
Expo CLI is a drop in replacement for exp.
Install: npm install -g expo-cli
Use: expo --help

So i guess either is fine?

Dynamic Linking `getInitialLink`

Any ideas on when will this get implemented?

Also, can we help with it? expo-firebase-links seems to be a private repo for now...

Firestore - All dates are null

I installed all expo firebase modules in version 2.0, and expo in version 31.
I store document in firebase firestore and when loading them, all returned dates are null. I believe there was a recent change made in firestore SDK to manage timestamps.
The exact same operation on the same firestore data directly loaded with Web SDK is working fine.

App crashes on Android first install, works fine second time.

Unable to instantiate service expo.modules.firebase.messaging.EXFirebaseInstanceIdService: java.lang.ClassNotFoundException: Didn't find class "expo.modules.firebase.messaging.EXFirebaseInstanceIdService" on path: DexPathList[[zip file "/data/app/com.evanbacon.demofirebasemodulesapp-1/base.apk"

I tried cloning this repo as well, got the same error on the first launch after apk installation.

notification callbacks doesn't get called

onNotificationOpened()
onNotificationDisplayed()
onNotification()

after tapping on notification, both in background and when app is killed, none of above callbacks doesn't get called. Because of that, I cant override opening handler.

Expo CLI 2.2.4 environment info:
System:
OS: macOS High Sierra 10.13.6
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.1.0 - /usr/local/bin/node
Yarn: 1.9.2 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
expo: ^30.0.1 => 30.0.2
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4
npmGlobalPackages:
expo-cli: 2.2.4

How do I create a notification channel ?

createNotificationChannel = () => {
    const channel = new firebase.notifications.Android.Channel('test-channel', 'Test Channel', firebase.notifications.Android.Importance.Max)
      .setDescription('My apps test channel');
    // Create the channel
    firebase.notifications().android.createChannel(channel);
  }

I am using this code, but getting this warning "undefined not an object(evaluating 'new _expoFirebaseApp.default.notifications.Android.Channel'

Q question: why would I want to use this?

Tried to write a comment in the medium article of Oct 4th, but failed. That's why I am asking this here.

The understanding of a novice (myself) is the following:

  • I wouldn't like to create a detached project, since I will lose important advantages of working within expo (creating an apk/ipa is one that is extremely important to me)
  • If I want to use this package I need to detach
  • I can use firebase with expo without detaching, as explained in in the expo docs.

So why would I want to use this package? is it only for reducing the app's size? Or for being able to use functionality that I cannot use without detaching?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.