Podfile
target 'yourAppNameHere' do
pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'BatchedBridge', # Required For React Native 0.45.0+
'Core',
// All necessary imports | |
class AppAuthScreen extends Component { | |
async componentDidMount() { | |
const { navigation } = this.props; | |
const currentEmail = await AsyncStorage.getItem( | |
'@footballApp:currentEmail' // key used to save email during user singup | |
); |
// @flow | |
import firebase from 'react-native-firebase'; | |
export const DB = firebase.firestore(); | |
export const USER_COLLECTION = 'users'; // name of collection in Firestore | |
export async function createUserDataBaseEntry(userId: string) { | |
// creating a new transaction |
import com.facebook.react.ReactActivity; | |
public class MainActivity extends ReactActivity { | |
@Override | |
protected String getMainComponentName() { | |
return "kotlin_app"; | |
} | |
} |
import com.facebook.react.ReactActivity | |
class MainActivity : ReactActivity() { | |
override fun getMainComponentName(): String? { | |
return "kotlin_app" | |
} | |
} |
//... | |
apply plugin: "kotlin-android" // apply plugin | |
dependencies { | |
// ... | |
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // add dependency | |
} | |
// ... |
/* | |
Variables | |
- Must be initialized with value | |
- Can be either immutable or mutable | |
- Can be null, but need to be declared with nullable type (more later) | |
- Various in Kotlin | |
- Numbers | |
- Byte | |
- Short |
buildscript { | |
ext.kotlin_version = '1.2.31' // add version | |
// ... | |
dependencies { | |
// ... | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Add kotlin dependency | |
} | |
} | |
// ... |
// This will vary | |
package com.example.application; | |
// Core RNFirebase | |
import io.invertase.firebase.RNFirebasePackage; | |
public class MainApplication extends Application implements ReactApplication { | |
@Override | |
protected List<ReactPackage> getPackages() { |
dependencies { | |
// Add to dependencies | |
compile(project(':react-native-firebase')) { | |
transitive = false | |
} | |
compile "com.google.firebase:firebase-core:11.4.2" | |
// If you are receiving Google Play API availability issues, add the following dependency | |
compile "com.google.android.gms:play-services-base:11.4.2" | |
} |