diff --git a/android/build.gradle b/android/build.gradle index c3138f8..a4ed08b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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" diff --git a/android/src/main/java/com/reactnativefullscreennotificationincomingcall/FullScreenNotificationIncomingCallModule.java b/android/src/main/java/com/reactnativefullscreennotificationincomingcall/FullScreenNotificationIncomingCallModule.java index 84367be..3e4598b 100644 --- a/android/src/main/java/com/reactnativefullscreennotificationincomingcall/FullScreenNotificationIncomingCallModule.java +++ b/android/src/main/java/com/reactnativefullscreennotificationincomingcall/FullScreenNotificationIncomingCallModule.java @@ -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. + } + } diff --git a/example/.editorconfig b/example/.editorconfig new file mode 100644 index 0000000..52e7e94 --- /dev/null +++ b/example/.editorconfig @@ -0,0 +1,3 @@ +# Windows files +[*.bat] +end_of_line = crlf \ No newline at end of file diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 84e4364..a3e8bf3 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -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" @@ -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) } } @@ -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' } diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index fa26aa5..18223dd 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -4,5 +4,10 @@ - + + + diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index a7056a5..ddae175 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -8,6 +8,7 @@ + - diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml index 7910405..140510f 100644 --- a/example/android/app/src/main/res/values/styles.xml +++ b/example/android/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ - diff --git a/example/android/build.gradle b/example/android/build.gradle index e09ede4..11a8a86 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -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 @@ -33,7 +33,6 @@ allprojects { google() mavenCentral() - jcenter() maven { url 'https://www.jitpack.io' } } } diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 369dd63..4bd95f1 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -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 diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 8422670..7665b0f 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/example/android/gradlew.bat b/example/android/gradlew.bat index b742c99..33c8f84 100644 --- a/example/android/gradlew.bat +++ b/example/android/gradlew.bat @@ -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. @@ -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% @@ -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 diff --git a/example/package.json b/example/package.json index bd92616..cd1e792 100644 --- a/example/package.json +++ b/example/package.json @@ -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" } -} +} \ No newline at end of file