Skip to content

Commit

Permalink
Merge pull request #8 from linhvovan29546/RN-0.65.1
Browse files Browse the repository at this point in the history
Upgrade example ReactNative to 0.65.1, Fix warning "Warning new Nativ…
  • Loading branch information
linhvovan29546 authored Oct 31, 2022
2 parents 8869719 + de47e3f commit ca87604
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 40 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def safeExtGet(prop, fallback) {
android {
compileSdkVersion safeExtGet('FullScreenNotificationIncomingCall_compileSdkVersion', 31)
defaultConfig {
minSdkVersion safeExtGet('FullScreenNotificationIncomingCall_minSdkVersion', 16)
minSdkVersion safeExtGet('FullScreenNotificationIncomingCall_minSdkVersion', 21)
targetSdkVersion safeExtGet('FullScreenNotificationIncomingCall_targetSdkVersion', 31)
versionCode 1
versionName "1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,14 @@ private Context getAppContext() {
return reactContext.getApplicationContext();
}

@ReactMethod
public void addListener(String eventName) {
// Keep: Required for RN built in Event Emitter Calls.
}

@ReactMethod
public void removeListeners(Integer count) {
// Keep: Required for RN built in Event Emitter Calls.
}

}
3 changes: 3 additions & 0 deletions example/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Windows files
[*.bat]
end_of_line = crlf
13 changes: 7 additions & 6 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ def jscFlavor = 'org.webkit:android-jsc:+'
def enableHermes = project.ext.react.get("enableHermes", false);

android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// compileOptions {
// sourceCompatibility JavaVersion.VERSION_1_8
// targetCompatibility JavaVersion.VERSION_1_8
// }

defaultConfig {
applicationId "com.example.reactnativefullscreennotificationincomingcall"
Expand Down Expand Up @@ -171,7 +172,7 @@ android {
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}

}
Expand Down Expand Up @@ -210,7 +211,7 @@ dependencies {
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
from configurations.implementation
into 'libs'
}

Expand Down
7 changes: 6 additions & 1 deletion example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
2 changes: 1 addition & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />

<application
android:name=".MainApplication"
android:label="@string/app_name"
Expand Down Expand Up @@ -41,7 +42,6 @@
android:stopWithTask="false"
android:exported="true" />

<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>

</manifest>
2 changes: 1 addition & 1 deletion example/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:textColor">#000000</item>
</style>
Expand Down
7 changes: 3 additions & 4 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

buildscript {
ext {
minSdkVersion = 16
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "20.1.5948944"
}
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
classpath("com.android.tools.build:gradle:4.2.1")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -33,7 +33,6 @@ allprojects {

google()
mavenCentral()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
5 changes: 3 additions & 2 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

systemProp.org.gradle.internal.http.connectionTimeout=180000
systemProp.org.gradle.internal.http.socketTimeout=180000
android.useAndroidX=true
android.enableJetifier=true
FLIPPER_VERSION=0.54.0
FLIPPER_VERSION=0.93.0
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
21 changes: 2 additions & 19 deletions example/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,28 +64,11 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_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=%*

: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
Expand Down
8 changes: 4 additions & 4 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"start": "react-native start"
},
"dependencies": {
"react": "16.13.1",
"react-native": "0.63.4"
"react": "17.0.2",
"react-native": "0.65.1"
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/runtime": "^7.12.5",
"babel-plugin-module-resolver": "^4.0.0",
"metro-react-native-babel-preset": "^0.64.0"
"metro-react-native-babel-preset": "^0.66.0"
}
}
}

0 comments on commit ca87604

Please sign in to comment.