mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 22:50:20 +08:00
initial package setup
This commit is contained in:
65
packages/admob/.npmignore
Normal file
65
packages/admob/.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/admob/LICENSE
Normal file
32
packages/admob/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/
|
||||
62
packages/admob/README.md
Normal file
62
packages/admob/README.md
Normal file
@@ -0,0 +1,62 @@
|
||||
<p align="center">
|
||||
<a href="https://invertase.io/oss/react-native-firebase">
|
||||
<img width="160px" src="https://i.imgur.com/JIyBtKW.png"><br/>
|
||||
</a>
|
||||
<h2 align="center">React Native Firebase - Admob</h2>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://api.rnfirebase.io/coverage/admob/detail"><img src="https://api.rnfirebase.io/coverage/admob/badge?style=flat-square" alt="Coverage"></a>
|
||||
<a href="https://www.npmjs.com/package/@react-native-firebase/admob"><img src="https://img.shields.io/npm/dm/@react-native-firebase/admob.svg?style=flat-square" alt="NPM downloads"></a>
|
||||
<a href="https://www.npmjs.com/package/@react-native-firebase/admob"><img src="https://img.shields.io/npm/v/@react-native-firebase/admob.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="https://lerna.js.org/"><img src="https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg?style=flat-square" alt="Maintained with Lerna"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://invertase.link/discord"><img src="https://img.shields.io/discord/295953187817521152.svg?style=flat-square&colorA=7289da&label=Chat%20on%20Discord" alt="Chat on Discord"></a>
|
||||
<a href="https://twitter.com/rnfirebase"><img src="https://img.shields.io/twitter/follow/rnfirebase.svg?style=flat-square&colorA=1da1f2&colorB=&label=Follow%20on%20Twitter" alt="Follow on Twitter"></a>
|
||||
</p>
|
||||
|
||||
----
|
||||
|
||||
> This is for the upcoming v6.0.0 release of React Native Firebase, please use the [react-native-firebase](https://www.npmjs.com/package/react-native-firebase) package instead, unless you're early adopting/testing the new packages - in which case please use the `latest` tagged patch-only release for this package.
|
||||
|
||||
Admob description.
|
||||
|
||||
[> Learn More](https://firebase.google.com/products/admob/)
|
||||
|
||||
## Installation
|
||||
|
||||
Requires `@react-native-firebase/app` to be installed.
|
||||
|
||||
```bash
|
||||
yarn add @react-native-firebase/admob
|
||||
react-native link @react-native-firebase/admob
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
- [Guides](#TODO)
|
||||
- [Installation](#TODO)
|
||||
- [Reference](#TODO)
|
||||
|
||||
## License
|
||||
|
||||
- See [LICENSE](/LICENSE)
|
||||
|
||||
----
|
||||
|
||||
<p>
|
||||
<img align="left" width="75px" src="https://static.invertase.io/assets/invertase-logo-small.png">
|
||||
<p align="left">
|
||||
Built and maintained with 💛 by <a href="https://invertase.io">Invertase</a>.
|
||||
</p>
|
||||
<p align="left">
|
||||
<a href="https://invertase.io/hire-us">💼 Hire Us</a> |
|
||||
<a href="https://opencollective.com/react-native-firebase">☕️ Sponsor Us</a> |
|
||||
<a href="https://opencollective.com/jobs">💻 Work With Us</a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
----
|
||||
22
packages/admob/RNFBAdmob.podspec
Normal file
22
packages/admob/RNFBAdmob.podspec
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'json'
|
||||
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "RNFBAdmob"
|
||||
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.ios.deployment_target = "9.0"
|
||||
s.source_files = 'ios/**/*.{h,m}'
|
||||
s.dependency 'React'
|
||||
s.dependency 'Firebase/Core', '~> 5.20.2'
|
||||
s.dependency 'RNFBApp'
|
||||
s.static_framework = true
|
||||
end
|
||||
10
packages/admob/android/.editorconfig
Normal file
10
packages/admob/android/.editorconfig
Normal file
@@ -0,0 +1,10 @@
|
||||
# editorconfig
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
62
packages/admob/android/build.gradle
Normal file
62
packages/admob/android/build.gradle
Normal file
@@ -0,0 +1,62 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.4.2'
|
||||
}
|
||||
}
|
||||
|
||||
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"
|
||||
],
|
||||
|
||||
firebase : [
|
||||
bom: "21.1.0"
|
||||
],
|
||||
],
|
||||
])
|
||||
}
|
||||
|
||||
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 platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
|
||||
implementation "com.google.firebase:firebase-admob"
|
||||
}
|
||||
|
||||
ReactNative.shared.applyPackageVersion()
|
||||
ReactNative.shared.applyDefaultExcludes()
|
||||
ReactNative.module.applyAndroidVersions()
|
||||
ReactNative.module.applyReactNativeDependency("api")
|
||||
6
packages/admob/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
packages/admob/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-5.4.1-all.zip
|
||||
160
packages/admob/android/gradlew
vendored
Normal file
160
packages/admob/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/admob/android/gradlew.bat
vendored
Normal file
90
packages/admob/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/admob/android/lint.xml
Normal file
5
packages/admob/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/admob/android/settings.gradle
Normal file
1
packages/admob/android/settings.gradle
Normal file
@@ -0,0 +1 @@
|
||||
rootProject.name = '@react-native-firebase_admob'
|
||||
8
packages/admob/android/src/main/AndroidManifest.xml
Normal file
8
packages/admob/android/src/main/AndroidManifest.xml
Normal file
@@ -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.admob">
|
||||
|
||||
<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.admob;
|
||||
|
||||
/*
|
||||
* 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 ReactNativeFirebaseAdmobModule extends ReactNativeFirebaseModule {
|
||||
private static final String TAG = "Admob";
|
||||
|
||||
ReactNativeFirebaseAdmobModule(ReactApplicationContext reactContext) {
|
||||
super(reactContext, TAG);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package io.invertase.firebase.admob;
|
||||
|
||||
/*
|
||||
* 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 ReactNativeFirebaseAdmobPackage implements ReactPackage {
|
||||
@Override
|
||||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
||||
List<NativeModule> modules = new ArrayList<>();
|
||||
modules.add(new ReactNativeFirebaseAdmobModule(reactContext));
|
||||
return modules;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
44
packages/admob/e2e/admob.e2e.js
Normal file
44
packages/admob/e2e/admob.e2e.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
describe('admob()', () => {
|
||||
describe('namespace', () => {
|
||||
it('accessible from firebase.app()', () => {
|
||||
const app = firebase.app();
|
||||
should.exist(app.admob);
|
||||
app.admob().app.should.equal(app);
|
||||
});
|
||||
|
||||
// removing as pending if module.options.hasMultiAppSupport = true
|
||||
xit('supports multiple apps', async () => {
|
||||
firebase.admob().app.name.should.equal('[DEFAULT]');
|
||||
|
||||
firebase
|
||||
.admob(firebase.app('secondaryFromNative'))
|
||||
.app.name.should.equal('secondaryFromNative');
|
||||
|
||||
firebase
|
||||
.app('secondaryFromNative')
|
||||
.admob()
|
||||
.app.name.should.equal('secondaryFromNative');
|
||||
});
|
||||
});
|
||||
|
||||
describe('aMethod()', () => {
|
||||
// TODO
|
||||
});
|
||||
});
|
||||
22
packages/admob/ios/RNFBAdmob.podspec
Normal file
22
packages/admob/ios/RNFBAdmob.podspec
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'json'
|
||||
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "RNFBAdmob"
|
||||
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.ios.deployment_target = "9.0"
|
||||
s.source_files = 'RNFBAdmob/**/*.{h,m}'
|
||||
s.dependency 'React'
|
||||
s.dependency 'Firebase/Core', '~> 5.20.2'
|
||||
s.dependency 'RNFBApp'
|
||||
s.static_framework = true
|
||||
end
|
||||
349
packages/admob/ios/RNFBAdmob.xcodeproj/project.pbxproj
Normal file
349
packages/admob/ios/RNFBAdmob.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,349 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 48;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2744B98621F45429004F8E3F /* RNFBAdmobModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744B98521F45429004F8E3F /* RNFBAdmobModule.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 /* libRNFBAdmob.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFBAdmob.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2744B98421F45429004F8E3F /* RNFBAdmobModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBAdmobModule.h; path = RNFBAdmob/RNFBAdmobModule.h; sourceTree = SOURCE_ROOT; };
|
||||
2744B98521F45429004F8E3F /* RNFBAdmobModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBAdmobModule.m; path = RNFBAdmob/RNFBAdmobModule.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 /* libRNFBAdmob.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2744B98321F45429004F8E3F /* RNFBAdmob */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2744B9A121F48736004F8E3F /* converters */,
|
||||
2744B98C21F45C64004F8E3F /* common */,
|
||||
2744B98421F45429004F8E3F /* RNFBAdmobModule.h */,
|
||||
2744B98521F45429004F8E3F /* RNFBAdmobModule.m */,
|
||||
);
|
||||
path = RNFBAdmob;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3323F52AAFE26B7384BE4DE3 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2744B98321F45429004F8E3F /* RNFBAdmob */,
|
||||
2744B97521F452B8004F8E3F /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2744B98121F45429004F8E3F /* RNFBAdmob */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2744B98821F45429004F8E3F /* Build configuration list for PBXNativeTarget "RNFBAdmob" */;
|
||||
buildPhases = (
|
||||
2744B97E21F45429004F8E3F /* Sources */,
|
||||
2744B97F21F45429004F8E3F /* Frameworks */,
|
||||
2744B98021F45429004F8E3F /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = RNFBAdmob;
|
||||
productName = RNFBAdmob;
|
||||
productReference = 2744B98221F45429004F8E3F /* libRNFBAdmob.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
3323F95273A95DB34F55C6D7 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = RNFBAdmob;
|
||||
LastUpgradeCheck = 1010;
|
||||
ORGANIZATIONNAME = Invertase;
|
||||
TargetAttributes = {
|
||||
2744B98121F45429004F8E3F = {
|
||||
CreatedOnToolsVersion = 10.1;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBAdmob" */;
|
||||
compatibilityVersion = "Xcode 8.0";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 3323F52AAFE26B7384BE4DE3;
|
||||
productRefGroup = 2744B97521F452B8004F8E3F /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
2744B98121F45429004F8E3F /* RNFBAdmob */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2744B97E21F45429004F8E3F /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2744B98621F45429004F8E3F /* RNFBAdmobModule.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/FirebaseAdmob/Frameworks",
|
||||
"$(SRCROOT)/../../../tests/ios/Pods/FirebaseAdmob/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/FirebaseAdmob/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 "RNFBAdmob" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2744B98921F45429004F8E3F /* Debug */,
|
||||
2744B98A21F45429004F8E3F /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBAdmob" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
3323F7E33E1559A2B9826720 /* Debug */,
|
||||
3323F77D701E1896E6D239CF /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 3323F95273A95DB34F55C6D7 /* Project object */;
|
||||
}
|
||||
7
packages/admob/ios/RNFBAdmob.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
packages/admob/ios/RNFBAdmob.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>
|
||||
24
packages/admob/ios/RNFBAdmob/RNFBAdmobModule.h
Normal file
24
packages/admob/ios/RNFBAdmob/RNFBAdmobModule.h
Normal file
@@ -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 RNFBAdmobModule : NSObject <RCTBridgeModule>
|
||||
|
||||
@end
|
||||
38
packages/admob/ios/RNFBAdmob/RNFBAdmobModule.m
Normal file
38
packages/admob/ios/RNFBAdmob/RNFBAdmobModule.m
Normal file
@@ -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 "RNFBAdmobModule.h"
|
||||
#import "RNFBApp/RNFBSharedUtils.h"
|
||||
|
||||
|
||||
@implementation RNFBAdmobModule
|
||||
#pragma mark -
|
||||
#pragma mark Module Setup
|
||||
|
||||
RCT_EXPORT_MODULE();
|
||||
|
||||
- (dispatch_queue_t)methodQueue {
|
||||
return dispatch_get_main_queue();
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Firebase Admob Methods
|
||||
|
||||
@end
|
||||
129
packages/admob/lib/index.d.ts
vendored
Normal file
129
packages/admob/lib/index.d.ts
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* 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 { ReactNativeFirebase } from '@react-native-firebase/app';
|
||||
|
||||
/**
|
||||
* Firebase Admob package for React Native.
|
||||
*
|
||||
* #### Example 1
|
||||
*
|
||||
* Access the firebase export from the `admob` package:
|
||||
*
|
||||
* ```js
|
||||
* import { firebase } from '@react-native-firebase/admob';
|
||||
*
|
||||
* // firebase.admob().X
|
||||
* ```
|
||||
*
|
||||
* #### Example 2
|
||||
*
|
||||
* Using the default export from the `admob` package:
|
||||
*
|
||||
* ```js
|
||||
* import admob from '@react-native-firebase/admob';
|
||||
*
|
||||
* // admob().X
|
||||
* ```
|
||||
*
|
||||
* #### Example 3
|
||||
*
|
||||
* Using the default export from the `app` package:
|
||||
*
|
||||
* ```js
|
||||
* import firebase from '@react-native-firebase/app';
|
||||
* import '@react-native-firebase/admob';
|
||||
*
|
||||
* // firebase.admob().X
|
||||
* ```
|
||||
*
|
||||
* @firebase admob
|
||||
*/
|
||||
export namespace Admob {
|
||||
import FirebaseModule = ReactNativeFirebase.FirebaseModule;
|
||||
|
||||
export interface Statics {
|
||||
// firebase.admob.* static props go here
|
||||
}
|
||||
|
||||
/**
|
||||
* // TODO CHOOSE THIS ---------------------------------------
|
||||
*
|
||||
* The Firebase Admob service interface.
|
||||
*
|
||||
* > This module is available for the default app only.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* Get the Admob service for the default app:
|
||||
*
|
||||
* ```js
|
||||
* const defaultAppAdmob = firebase.admob();
|
||||
* ```
|
||||
*
|
||||
* // TODO OR THIS -------------------------------------------
|
||||
*
|
||||
* The Firebase Admob service is available for the default app or a given app.
|
||||
*
|
||||
* #### Example 1
|
||||
*
|
||||
* Get the admob instance for the **default app**:
|
||||
*
|
||||
* ```js
|
||||
* const admobForDefaultApp = firebase.admob();
|
||||
* ```
|
||||
*
|
||||
* #### Example 2
|
||||
*
|
||||
* Get the admob instance for a **secondary app**:
|
||||
*˚
|
||||
* ```js
|
||||
* const otherApp = firebase.app('otherApp');
|
||||
* const admobForOtherApp = firebase.admob(otherApp);
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
export class Module extends FirebaseModule {
|
||||
// firebase.admob().* methods & props go here
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@react-native-firebase/admob' {
|
||||
import ReactNativeFirebaseModule = ReactNativeFirebase.Module;
|
||||
import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp;
|
||||
|
||||
const firebaseNamedExport: {} & ReactNativeFirebaseModule;
|
||||
export const firebase = firebaseNamedExport;
|
||||
|
||||
const module: FirebaseModuleWithStaticsAndApp<Admob.Module, Admob.Statics>;
|
||||
export default module;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach namespace to `firebase.` and `FirebaseApp.`.
|
||||
*/
|
||||
declare module '@react-native-firebase/app' {
|
||||
namespace ReactNativeFirebase {
|
||||
import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp;
|
||||
interface Module {
|
||||
admob: FirebaseModuleWithStaticsAndApp<Admob.Module, Admob.Statics>;
|
||||
}
|
||||
interface FirebaseApp {
|
||||
admob(): Admob.Module;
|
||||
}
|
||||
}
|
||||
}
|
||||
55
packages/admob/lib/index.js
Normal file
55
packages/admob/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 = 'admob';
|
||||
|
||||
const nativeModuleName = 'RNFBAdmobModule';
|
||||
|
||||
class FirebaseAdmobModule extends FirebaseModule {
|
||||
|
||||
}
|
||||
|
||||
// import { SDK_VERSION } from '@react-native-firebase/admob';
|
||||
export const SDK_VERSION = version;
|
||||
|
||||
// import admob from '@react-native-firebase/admob';
|
||||
// admob().X(...);
|
||||
export default createModuleNamespace({
|
||||
statics,
|
||||
version,
|
||||
namespace,
|
||||
nativeModuleName,
|
||||
nativeEvents: false,
|
||||
hasMultiAppSupport: false,
|
||||
hasCustomUrlOrRegionSupport: false,
|
||||
ModuleClass: FirebaseAdmobModule,
|
||||
});
|
||||
|
||||
// import admob, { firebase } from '@react-native-firebase/admob';
|
||||
// admob().X(...);
|
||||
// firebase.admob().X(...);
|
||||
export const firebase = getFirebaseRoot();
|
||||
70
packages/admob/lib/index.js.flow
Normal file
70
packages/admob/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/admob' {
|
||||
import type {
|
||||
ReactNativeFirebaseNamespace,
|
||||
ReactNativeFirebaseModuleAndStatics,
|
||||
} from '@react-native-firebase/app-types/index.js.flow';
|
||||
/**
|
||||
* @example
|
||||
* ```js
|
||||
* import { firebase } from '@react-native-firebase/admob';
|
||||
* firebase.admob().X(...);
|
||||
* ```
|
||||
*/
|
||||
declare export var firebase: {} & ReactNativeFirebaseNamespace;
|
||||
|
||||
/**
|
||||
* @example
|
||||
* ```js
|
||||
* import admob from '@react-native-firebase/admob';
|
||||
* admob().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 {
|
||||
/**
|
||||
* Admob
|
||||
*/
|
||||
admob: ReactNativeFirebaseModuleAndStatics<Module, Statics>;
|
||||
}
|
||||
|
||||
declare interface FirebaseApp {
|
||||
/**
|
||||
* Admob
|
||||
*/
|
||||
admob(): Module;
|
||||
}
|
||||
}
|
||||
35
packages/admob/package.json
Normal file
35
packages/admob/package.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@react-native-firebase/admob",
|
||||
"version": "0.1.3",
|
||||
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
||||
"description": "React Native Firebase - Admob",
|
||||
"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/admob"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-native",
|
||||
"firebase",
|
||||
"admob"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"@react-native-firebase/app": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-firebase/app-types": "0.1.3",
|
||||
"@react-native-firebase/common": "0.1.3"
|
||||
},
|
||||
"gitHead": "2787d4413eb70c61a687c4d6913add6a6a01f582",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
26
packages/admob/type-test.ts
Normal file
26
packages/admob/type-test.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import firebase from '@react-native-firebase/app';
|
||||
import defaultExport, { firebase as firebaseFromModule } from '@react-native-firebase/Admob';
|
||||
|
||||
// checks module exists at root
|
||||
console.log(firebase.Admob().app.name);
|
||||
|
||||
// checks module exists at app level
|
||||
console.log(firebase.app().Admob().app.name);
|
||||
|
||||
// checks statics exist
|
||||
console.log(firebase.Admob.SDK_VERSION);
|
||||
|
||||
// checks statics exist on defaultExport
|
||||
console.log(defaultExport.SDK_VERSION);
|
||||
|
||||
// checks root exists
|
||||
console.log(firebase.SDK_VERSION);
|
||||
|
||||
// checks firebase named export exists on module
|
||||
console.log(firebaseFromModule.SDK_VERSION);
|
||||
|
||||
// checks multi-app support exists
|
||||
console.log(firebase.Admob(firebase.app()).app.name);
|
||||
|
||||
// checks default export supports app arg
|
||||
console.log(defaultExport(firebase.app()).app.name);
|
||||
@@ -21,6 +21,7 @@ import { AppRegistry, Image, NativeModules, StyleSheet, Text, View } from 'react
|
||||
import jet from 'jet/platform/react-native';
|
||||
import NativeEventEmitter from '@react-native-firebase/app/lib/internal/RNFBNativeEventEmitter';
|
||||
|
||||
import '@react-native-firebase/admob';
|
||||
import '@react-native-firebase/firestore';
|
||||
import '@react-native-firebase/auth';
|
||||
import '@react-native-firebase/database';
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(`Android AVD: ${config.configurations['android.emu.debug'].name}`);
|
||||
|
||||
const PACKAGES = [
|
||||
'app',
|
||||
'admob',
|
||||
'dynamic-links',
|
||||
'iid',
|
||||
'perf',
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"prepare": "patch-package"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-firebase/admob": "0.1.3",
|
||||
"@react-native-firebase/analytics": "0.1.3",
|
||||
"@react-native-firebase/app": "0.1.3",
|
||||
"@react-native-firebase/app-types": "0.1.3",
|
||||
|
||||
Reference in New Issue
Block a user