mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 22:50:20 +08:00
[crashlytics] create package
This commit is contained in:
65
packages/crashlytics/.npmignore
Normal file
65
packages/crashlytics/.npmignore
Normal file
@@ -0,0 +1,65 @@
|
||||
# Built application files
|
||||
android/*/build/
|
||||
|
||||
# Crashlytics configuations
|
||||
android/com_crashlytics_export_strings.xml
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
android/local.properties
|
||||
|
||||
# Gradle generated files
|
||||
android/.gradle/
|
||||
|
||||
# Signing files
|
||||
android/.signing/
|
||||
|
||||
# User-specific configurations
|
||||
android/.idea/gradle.xml
|
||||
android/.idea/libraries/
|
||||
android/.idea/workspace.xml
|
||||
android/.idea/tasks.xml
|
||||
android/.idea/.name
|
||||
android/.idea/compiler.xml
|
||||
android/.idea/copyright/profiles_settings.xml
|
||||
android/.idea/encodings.xml
|
||||
android/.idea/misc.xml
|
||||
android/.idea/modules.xml
|
||||
android/.idea/scopes/scope_settings.xml
|
||||
android/.idea/vcs.xml
|
||||
android/*.iml
|
||||
|
||||
# Xcode
|
||||
*.pbxuser
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.perspectivev3
|
||||
*.xcuserstate
|
||||
ios/Pods
|
||||
ios/build
|
||||
*project.xcworkspace*
|
||||
*xcuserdata*
|
||||
|
||||
# OS-specific files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.dbandroid/gradle
|
||||
android/gradlew
|
||||
android/build
|
||||
android/gradlew.bat
|
||||
android/gradle/
|
||||
|
||||
.idea
|
||||
coverage
|
||||
yarn.lock
|
||||
e2e/
|
||||
.github
|
||||
.vscode
|
||||
.nyc_output
|
||||
android/.settings
|
||||
*.coverage.json
|
||||
.circleci
|
||||
.eslintignore
|
||||
32
packages/crashlytics/LICENSE
Normal file
32
packages/crashlytics/LICENSE
Normal file
@@ -0,0 +1,32 @@
|
||||
Apache-2.0 License
|
||||
------------------
|
||||
|
||||
Copyright (c) 2016-present Invertase Limited <oss@invertase.io> & Contributors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this library except in compliance with the License.
|
||||
|
||||
You may obtain a copy of the Apache-2.0 License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
Creative Commons Attribution 3.0 License
|
||||
----------------------------------------
|
||||
|
||||
Copyright (c) 2016-present Invertase Limited <oss@invertase.io> & Contributors
|
||||
|
||||
Documentation and other instructional materials provided for this project
|
||||
(including on a separate documentation repository or it's documentation website) are
|
||||
licensed under the Creative Commons Attribution 3.0 License. Code samples/blocks
|
||||
contained therein are licensed under the Apache License, Version 2.0 (the "License"), as above.
|
||||
|
||||
You may obtain a copy of the Creative Commons Attribution 3.0 License at
|
||||
|
||||
https://creativecommons.org/licenses/by/3.0/
|
||||
47
packages/crashlytics/README.md
Normal file
47
packages/crashlytics/README.md
Normal file
@@ -0,0 +1,47 @@
|
||||
<p align="center">
|
||||
<a href="https://invertase.io/oss/react-native-firebase">
|
||||
<img width="160px" src="https://i.imgur.com/JIyBtKW.png"><br/>
|
||||
</a>
|
||||
<h4 align="center">React Native Firebase - Crashlytics</h2>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@react-native-firebase/crashlytics"><img src="https://img.shields.io/npm/dm/@react-native-firebase/crashlytics.svg?style=flat-square" alt="NPM downloads"></a>
|
||||
<a href="https://www.npmjs.com/package/@react-native-firebase/crashlytics"><img src="https://img.shields.io/npm/v/@react-native-firebase/crashlytics.svg?style=flat-square" alt="NPM version"></a>
|
||||
<a href="/LICENSE"><img src="https://img.shields.io/npm/l/react-native-firebase.svg?style=flat-square" alt="License"></a>
|
||||
<a href="#backers"><img src="https://opencollective.com/react-native-firebase/backers/badge.svg?style=flat-square" alt="Backers on Open Collective"></a>
|
||||
<a href="#sponsors"><img src="https://opencollective.com/react-native-firebase/sponsors/badge.svg?style=flat-square" alt="Sponsors on Open Collective"></a>
|
||||
<a href="https://discord.gg/C9aK28N"><img src="https://img.shields.io/discord/295953187817521152.svg?logo=discord&style=flat-square&colorA=7289da&label=discord" alt="Chat"></a>
|
||||
<a href="https://twitter.com/rnfirebase"><img src="https://img.shields.io/twitter/follow/rnfirebase.svg?style=social&label=Follow" alt="Follow on Twitter"></a>
|
||||
</p>
|
||||
|
||||
----
|
||||
|
||||
Crashlytics description.
|
||||
|
||||
[> Learn More](https://firebase.google.com/products/crashlytics/)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @react-native-firebase/crashlytics
|
||||
react-native link @react-native-firebase/crashlytics
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
- [Guides](#TODO)
|
||||
- [Installation](#TODO)
|
||||
- [Reference](#TODO)
|
||||
|
||||
## License
|
||||
|
||||
- See [LICENSE](/LICENSE)
|
||||
|
||||
----
|
||||
|
||||
Built and maintained with 💛 by [Invertase](https://invertase.io).
|
||||
|
||||
- [💼 Hire Us](https://invertase.io/hire-us)
|
||||
- [☕️ Sponsor Us](https://opencollective.com/react-native-firebase)
|
||||
- [👩💻 Work With Us](https://invertase.io/jobs)
|
||||
66
packages/crashlytics/android/build.gradle
Normal file
66
packages/crashlytics/android/build.gradle
Normal file
@@ -0,0 +1,66 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.3.0'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "io.invertase.gradle.build" version "1.3"
|
||||
}
|
||||
|
||||
project.ext {
|
||||
set('react-native', [
|
||||
versions: [
|
||||
android : [
|
||||
minSdk : 16,
|
||||
targetSdk : 28,
|
||||
compileSdk: 28,
|
||||
// optional as gradle.buildTools comes with one by default
|
||||
// overriding here though to match the version RN uses
|
||||
buildTools: "28.0.3"
|
||||
],
|
||||
|
||||
googlePlayServices: [
|
||||
base: "16.0.1",
|
||||
],
|
||||
|
||||
firebase : [
|
||||
crashlytics: "16.0.6"
|
||||
],
|
||||
],
|
||||
])
|
||||
}
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
multiDexEnabled true
|
||||
}
|
||||
lintOptions {
|
||||
disable 'GradleCompatible'
|
||||
abortOnError false
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api project(':@react-native-firebase/app')
|
||||
implementation "com.google.firebase:firebase-crashlytics:${ReactNative.ext.getVersion("firebase", "crashlytics")}"
|
||||
implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}"
|
||||
}
|
||||
|
||||
ReactNative.shared.applyPackageVersion()
|
||||
ReactNative.shared.applyDefaultExcludes()
|
||||
ReactNative.module.applyAndroidVersions()
|
||||
ReactNative.module.applyReactNativeDependency("api")
|
||||
6
packages/crashlytics/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
packages/crashlytics/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#Tue Oct 09 01:55:27 BST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||
160
packages/crashlytics/android/gradlew
vendored
Normal file
160
packages/crashlytics/android/gradlew
vendored
Normal file
@@ -0,0 +1,160 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
90
packages/crashlytics/android/gradlew.bat
vendored
Normal file
90
packages/crashlytics/android/gradlew.bat
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
5
packages/crashlytics/android/lint.xml
Normal file
5
packages/crashlytics/android/lint.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<lint>
|
||||
<!-- Disable the given check in this project -->
|
||||
<issue id="GradleCompatible" severity="ignore" />
|
||||
</lint>
|
||||
1
packages/crashlytics/android/settings.gradle
Normal file
1
packages/crashlytics/android/settings.gradle
Normal file
@@ -0,0 +1 @@
|
||||
rootProject.name = '@react-native-firebase/crashlytics'
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="io.invertase.firebase.crashlytics">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
||||
@@ -0,0 +1,40 @@
|
||||
package io.invertase.firebase.crashlytics;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.Promise;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.ReactMethod;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import io.invertase.firebase.common.ReactNativeFirebaseModule;
|
||||
|
||||
public class ReactNativeFirebaseCrashlyticsModule extends ReactNativeFirebaseModule {
|
||||
private static final String TAG = "Crashlytics";
|
||||
|
||||
ReactNativeFirebaseCrashlyticsModule(ReactApplicationContext reactContext) {
|
||||
super(reactContext, TAG);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package io.invertase.firebase.crashlytics;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.bridge.NativeModule;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.uimanager.ViewManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ReactNativeFirebaseCrashlyticsPackage implements ReactPackage {
|
||||
@Override
|
||||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
||||
List<NativeModule> modules = new ArrayList<>();
|
||||
modules.add(new ReactNativeFirebaseCrashlyticsModule(reactContext));
|
||||
return modules;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
27
packages/crashlytics/e2e/crashlytics.e2e.js
Normal file
27
packages/crashlytics/e2e/crashlytics.e2e.js
Normal file
@@ -0,0 +1,27 @@
|
||||
describe('crashlytics()', () => {
|
||||
describe('namespace', () => {
|
||||
it('accessible from firebase.app()', () => {
|
||||
const app = firebase.app();
|
||||
should.exist(app.crashlytics);
|
||||
app.crashlytics().app.should.equal(app);
|
||||
});
|
||||
|
||||
// removing as pending if module.options.hasMultiAppSupport = true
|
||||
xit('supports multiple apps', async () => {
|
||||
firebase.crashlytics().app.name.should.equal('[DEFAULT]');
|
||||
|
||||
firebase
|
||||
.crashlytics(firebase.app('secondaryFromNative'))
|
||||
.app.name.should.equal('secondaryFromNative');
|
||||
|
||||
firebase
|
||||
.app('secondaryFromNative')
|
||||
.crashlytics()
|
||||
.app.name.should.equal('secondaryFromNative');
|
||||
});
|
||||
});
|
||||
|
||||
describe('aMethod()', () => {
|
||||
// TODO
|
||||
});
|
||||
});
|
||||
20
packages/crashlytics/ios/RNFBCrashlytics.podspec
Normal file
20
packages/crashlytics/ios/RNFBCrashlytics.podspec
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'json'
|
||||
package = JSON.parse(File.read('../package.json'))
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "RNFBCrashlytics"
|
||||
s.version = package["version"]
|
||||
s.description = package["description"]
|
||||
s.summary = <<-DESC
|
||||
A well tested feature rich Firebase implementation for React Native, supporting iOS & Android.
|
||||
DESC
|
||||
s.homepage = "http://invertase.io/oss/react-native-firebase"
|
||||
s.license = package['license']
|
||||
s.authors = "Invertase Limited"
|
||||
s.source = { :git => "https://github.com/invertase/react-native-firebase.git", :tag => "v#{s.version}" }
|
||||
s.social_media_url = 'http://twitter.com/invertaseio'
|
||||
s.platform = :ios, "10.0"
|
||||
s.source_files = 'RNFBCrashlytics/**/*.{h,m}'
|
||||
s.dependency 'React'
|
||||
s.dependency 'Firebase/Core', '~> 5.15.0'
|
||||
end
|
||||
@@ -0,0 +1,349 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 48;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2744B98621F45429004F8E3F /* RNFBCrashlyticsModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744B98521F45429004F8E3F /* RNFBCrashlyticsModule.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2744B98021F45429004F8E3F /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2744B98221F45429004F8E3F /* libRNFBCrashlytics.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFBCrashlytics.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2744B98421F45429004F8E3F /* RNFBCrashlyticsModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBCrashlyticsModule.h; path = RNFBCrashlytics/RNFBCrashlyticsModule.h; sourceTree = SOURCE_ROOT; };
|
||||
2744B98521F45429004F8E3F /* RNFBCrashlyticsModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBCrashlyticsModule.m; path = RNFBCrashlytics/RNFBCrashlyticsModule.m; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2744B97F21F45429004F8E3F /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2744B97521F452B8004F8E3F /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2744B98221F45429004F8E3F /* libRNFBCrashlytics.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2744B98321F45429004F8E3F /* RNFBCrashlytics */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2744B9A121F48736004F8E3F /* converters */,
|
||||
2744B98C21F45C64004F8E3F /* common */,
|
||||
2744B98421F45429004F8E3F /* RNFBCrashlyticsModule.h */,
|
||||
2744B98521F45429004F8E3F /* RNFBCrashlyticsModule.m */,
|
||||
);
|
||||
path = RNFBCrashlytics;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3323F52AAFE26B7384BE4DE3 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2744B98321F45429004F8E3F /* RNFBCrashlytics */,
|
||||
2744B97521F452B8004F8E3F /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2744B98121F45429004F8E3F /* RNFBCrashlytics */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2744B98821F45429004F8E3F /* Build configuration list for PBXNativeTarget "RNFBCrashlytics" */;
|
||||
buildPhases = (
|
||||
2744B97E21F45429004F8E3F /* Sources */,
|
||||
2744B97F21F45429004F8E3F /* Frameworks */,
|
||||
2744B98021F45429004F8E3F /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = RNFBCrashlytics;
|
||||
productName = RNFBCrashlytics;
|
||||
productReference = 2744B98221F45429004F8E3F /* libRNFBCrashlytics.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
3323F95273A95DB34F55C6D7 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = RNFBCrashlytics;
|
||||
LastUpgradeCheck = 1010;
|
||||
ORGANIZATIONNAME = Invertase;
|
||||
TargetAttributes = {
|
||||
2744B98121F45429004F8E3F = {
|
||||
CreatedOnToolsVersion = 10.1;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBCrashlytics" */;
|
||||
compatibilityVersion = "Xcode 8.0";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 3323F52AAFE26B7384BE4DE3;
|
||||
productRefGroup = 2744B97521F452B8004F8E3F /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
2744B98121F45429004F8E3F /* RNFBCrashlytics */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2744B97E21F45429004F8E3F /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2744B98621F45429004F8E3F /* RNFBCrashlyticsModule.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2744B98921F45429004F8E3F /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2744B98A21F45429004F8E3F /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
3323F77D701E1896E6D239CF /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"${BUILT_PRODUCTS_DIR}/**",
|
||||
"${SRCROOT}/../../../ios/Firebase/**",
|
||||
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
||||
"$(SRCROOT)/../../../ios/Pods/FirebaseCrashlytics/Frameworks",
|
||||
"$(SRCROOT)/../../../tests/ios/Pods/FirebaseCrashlytics/Frameworks",
|
||||
);
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(REACT_SEARCH_PATH)/React/**",
|
||||
"$(SRCROOT)/../../react-native/React/**",
|
||||
"$(SRCROOT)/../../react-native-firebase/ios/**",
|
||||
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
||||
"${SRCROOT}/../../../ios/Firebase/**",
|
||||
"${SRCROOT}/../../../ios/Pods/Headers/Public/**",
|
||||
"${SRCROOT}/../../../tests/ios/Pods/Headers/Public/**",
|
||||
"$(SRCROOT)/../../../node_modules/react-native/React/**",
|
||||
"$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
|
||||
"$(SRCROOT)/../../../packages/app/ios/**",
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
MACH_O_TYPE = staticlib;
|
||||
OTHER_LDFLAGS = "$(inherited)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
3323F7E33E1559A2B9826720 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"${BUILT_PRODUCTS_DIR}/**",
|
||||
"${SRCROOT}/../../../ios/Firebase/**",
|
||||
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
||||
"$(SRCROOT)/../../../ios/Pods/FirebaseCrashlytics/Frameworks",
|
||||
);
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(REACT_SEARCH_PATH)/React/**",
|
||||
"$(SRCROOT)/../../react-native/React/**",
|
||||
"$(SRCROOT)/../../react-native-firebase/ios/**",
|
||||
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
||||
"${SRCROOT}/../../../ios/Firebase/**",
|
||||
"${SRCROOT}/../../../ios/Pods/Headers/Public/**",
|
||||
"${SRCROOT}/../../../tests/ios/Pods/Headers/Public/**",
|
||||
"$(SRCROOT)/../../../node_modules/react-native/React/**",
|
||||
"$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
|
||||
"$(SRCROOT)/../../../packages/app/ios/**",
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
MACH_O_TYPE = staticlib;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "$(inherited)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2744B98821F45429004F8E3F /* Build configuration list for PBXNativeTarget "RNFBCrashlytics" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2744B98921F45429004F8E3F /* Debug */,
|
||||
2744B98A21F45429004F8E3F /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBCrashlytics" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
3323F7E33E1559A2B9826720 /* Debug */,
|
||||
3323F77D701E1896E6D239CF /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 3323F95273A95DB34F55C6D7 /* Project object */;
|
||||
}
|
||||
7
packages/crashlytics/ios/RNFBCrashlytics.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
packages/crashlytics/ios/RNFBCrashlytics.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
</plist>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>FILEHEADER</key>
|
||||
<string>
|
||||
/**
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <React/RCTBridgeModule.h>
|
||||
|
||||
@interface RNFBCrashlyticsModule : NSObject <RCTBridgeModule>
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <React/RCTUtils.h>
|
||||
#import <Firebase/Firebase.h>
|
||||
|
||||
#import "RNFBCrashlyticsModule.h"
|
||||
#import "RNFBApp/RNFBSharedUtils.h"
|
||||
|
||||
|
||||
@implementation RNFBCrashlyticsModule
|
||||
#pragma mark -
|
||||
#pragma mark Module Setup
|
||||
|
||||
RCT_EXPORT_MODULE();
|
||||
|
||||
- (dispatch_queue_t)methodQueue {
|
||||
return dispatch_get_main_queue();
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Firebase Crashlytics Methods
|
||||
|
||||
@end
|
||||
90
packages/crashlytics/lib/index.d.ts
vendored
Normal file
90
packages/crashlytics/lib/index.d.ts
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
import {
|
||||
ReactNativeFirebaseModule,
|
||||
ReactNativeFirebaseNamespace,
|
||||
ReactNativeFirebaseModuleAndStatics,
|
||||
} from '@react-native-firebase/app-types';
|
||||
|
||||
/**
|
||||
* Crashlytics
|
||||
*
|
||||
* @firebase crashlytics
|
||||
*/
|
||||
export namespace Crashlytics {
|
||||
export interface Statics {}
|
||||
|
||||
export interface Module extends ReactNativeFirebaseModule {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@react-native-firebase/crashlytics' {
|
||||
import { ReactNativeFirebaseNamespace } from '@react-native-firebase/app-types';
|
||||
|
||||
const FirebaseNamespaceExport: {} & ReactNativeFirebaseNamespace;
|
||||
|
||||
/**
|
||||
* @example
|
||||
* ```js
|
||||
* import { firebase } from '@react-native-firebase/crashlytics';
|
||||
* firebase.crashlytics().X(...);
|
||||
* ```
|
||||
*/
|
||||
export const firebase = FirebaseNamespaceExport;
|
||||
|
||||
const CrashlyticsDefaultExport: ReactNativeFirebaseModuleAndStatics<
|
||||
Crashlytics.Module,
|
||||
Crashlytics.Statics
|
||||
>;
|
||||
/**
|
||||
* @example
|
||||
* ```js
|
||||
* import crashlytics from '@react-native-firebase/crashlytics';
|
||||
* crashlytics().X(...);
|
||||
* ```
|
||||
*/
|
||||
export default CrashlyticsDefaultExport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach namespace to `firebase.` and `FirebaseApp.`.
|
||||
*/
|
||||
declare module '@react-native-firebase/app-types' {
|
||||
interface ReactNativeFirebaseNamespace {
|
||||
/**
|
||||
* Crashlytics integrates across Firebase features and provides
|
||||
* you with unlimited reporting for up to 500 distinct events
|
||||
* that you can define using the Firebase SDK. Crashlytics reports
|
||||
* help you understand clearly how your users behave, which enables
|
||||
* you to make informed decisions regarding app marketing and
|
||||
* performance optimizations.
|
||||
*/
|
||||
crashlytics: ReactNativeFirebaseModuleAndStatics<
|
||||
Crashlytics.Module,
|
||||
Crashlytics.Statics
|
||||
>;
|
||||
}
|
||||
|
||||
interface FirebaseApp {
|
||||
/**
|
||||
* Crashlytics
|
||||
*/
|
||||
crashlytics(): Crashlytics.Module;
|
||||
}
|
||||
}
|
||||
55
packages/crashlytics/lib/index.js
Normal file
55
packages/crashlytics/lib/index.js
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
import {
|
||||
createModuleNamespace,
|
||||
FirebaseModule,
|
||||
getFirebaseRoot,
|
||||
} from '@react-native-firebase/app/lib/internal';
|
||||
|
||||
import version from './version';
|
||||
|
||||
const statics = {};
|
||||
|
||||
const namespace = 'crashlytics';
|
||||
|
||||
const nativeModuleName = 'RNFBCrashlyticsModule';
|
||||
|
||||
class FirebaseCrashlyticsModule extends FirebaseModule {
|
||||
|
||||
}
|
||||
|
||||
// import { SDK_VERSION } from '@react-native-firebase/crashlytics';
|
||||
export const SDK_VERSION = version;
|
||||
|
||||
// import crashlytics from '@react-native-firebase/crashlytics';
|
||||
// crashlytics().X(...);
|
||||
export default createModuleNamespace({
|
||||
statics,
|
||||
version,
|
||||
namespace,
|
||||
nativeModuleName,
|
||||
nativeEvents: false,
|
||||
hasMultiAppSupport: false,
|
||||
hasCustomUrlOrRegionSupport: false,
|
||||
ModuleClass: FirebaseCrashlyticsModule,
|
||||
});
|
||||
|
||||
// import crashlytics, { firebase } from '@react-native-firebase/crashlytics';
|
||||
// crashlytics().X(...);
|
||||
// firebase.crashlytics().X(...);
|
||||
export const firebase = getFirebaseRoot();
|
||||
70
packages/crashlytics/lib/index.js.flow
Normal file
70
packages/crashlytics/lib/index.js.flow
Normal file
@@ -0,0 +1,70 @@
|
||||
/* eslint-disable import/no-duplicates */
|
||||
/*
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
import type { ReactNativeFirebaseModule } from '@react-native-firebase/app-types/index.js.flow';
|
||||
|
||||
export interface Statics {}
|
||||
|
||||
export interface Module extends ReactNativeFirebaseModule {
|
||||
|
||||
}
|
||||
|
||||
declare module '@react-native-firebase/crashlytics' {
|
||||
import type {
|
||||
ReactNativeFirebaseNamespace,
|
||||
ReactNativeFirebaseModuleAndStatics,
|
||||
} from '@react-native-firebase/app-types/index.js.flow';
|
||||
/**
|
||||
* @example
|
||||
* ```js
|
||||
* import { firebase } from '@react-native-firebase/crashlytics';
|
||||
* firebase.crashlytics().X(...);
|
||||
* ```
|
||||
*/
|
||||
declare export var firebase: {} & ReactNativeFirebaseNamespace;
|
||||
|
||||
/**
|
||||
* @example
|
||||
* ```js
|
||||
* import crashlytics from '@react-native-firebase/crashlytics';
|
||||
* crashlytics().X(...);
|
||||
* ```
|
||||
*/
|
||||
declare export default ReactNativeFirebaseModuleAndStatics<Module, Statics>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach namespace to `firebase.` and `FirebaseApp.`.
|
||||
*/
|
||||
declare module '@react-native-firebase/app-types' {
|
||||
import type { ReactNativeFirebaseModuleAndStatics } from '@react-native-firebase/app-types/index.js.flow';
|
||||
|
||||
declare interface ReactNativeFirebaseNamespace {
|
||||
/**
|
||||
* Crashlytics
|
||||
*/
|
||||
crashlytics: ReactNativeFirebaseModuleAndStatics<Module, Statics>;
|
||||
}
|
||||
|
||||
declare interface FirebaseApp {
|
||||
/**
|
||||
* Crashlytics
|
||||
*/
|
||||
crashlytics(): Module;
|
||||
}
|
||||
}
|
||||
42
packages/crashlytics/package.json
Normal file
42
packages/crashlytics/package.json
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "@react-native-firebase/crashlytics",
|
||||
"version": "6.0.0-alpha.2",
|
||||
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
||||
"description": "React Native Firebase - Crashlytics",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "genversion --semi lib/version.js",
|
||||
"build:clean": "rimraf android/build && rimraf ios/build",
|
||||
"prepare": "yarn run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/invertase/react-native-firebase/tree/master/packages/crashlytics"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-native",
|
||||
"firebase",
|
||||
"crashlytics"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"@react-native-firebase/app": "6.0.0-alpha.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-firebase/app-types": "6.0.0-alpha.2",
|
||||
"@react-native-firebase/common": "6.0.0-alpha.2"
|
||||
},
|
||||
"rnpm": {
|
||||
"android": {
|
||||
"buildPatch": "implementation project(':@react-native-firebase_crashlytics')",
|
||||
"packageImportPath": "import io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsPackage;",
|
||||
"packageInstance": "new ReactNativeFirebaseCrashlyticsPackage()"
|
||||
}
|
||||
},
|
||||
"gitHead": "2787d4413eb70c61a687c4d6913add6a6a01f582",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
"@react-native-firebase/analytics": "^6.0.0-alpha.2",
|
||||
"@react-native-firebase/app": "^6.0.0-alpha.2",
|
||||
"@react-native-firebase/app-types": "^6.0.0-alpha.2",
|
||||
"@react-native-firebase/crashlytics": "^6.0.0-alpha.2",
|
||||
"@react-native-firebase/functions": "^6.0.0-alpha.2",
|
||||
"@react-native-firebase/iid": "^6.0.0-alpha.2",
|
||||
"@react-native-firebase/perf": "^6.0.0-alpha.2",
|
||||
|
||||
Reference in New Issue
Block a user