Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit f65a8a5

Browse files
authored
Merge pull request #3 from northwesternmutual/update-react
fix: version updates for react-native and react-native-builder-bob
2 parents 191360d + a888af3 commit f65a8a5

33 files changed

+6790
-7316
lines changed

.husky/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn commitlint -E HUSKY_GIT_PARAMS

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint && yarn typescript

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,11 @@ npm run start
9393
3) Open Android emulator from the Terminal with the emulator command:
9494
```sh
9595
user@host ~ $ emulator -list-avds
96-
Pixel_2_API_28
97-
Pixel_3a_API_30_x86
96+
Pixel_4_API_30
9897

9998
#emulator -avd [EMULATOR_NAME] -qemu -allow-host-audio
10099

101-
user@host ~ $ emulator -avd Pixel_3a_API_30_x86 -qemu -allow-host-audio
100+
user@host ~ $ emulator -avd Pixel_4_API_30 -qemu -allow-host-audio
102101
```
103102

104103
4) Toggle (in a different terminal) the microphone ON

android/.project

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>android_</name>
3+
<name>android</name>
44
<comment>Project android_ created by Buildship.</comment>
55
<projects>
66
</projects>
77
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
813
<buildCommand>
914
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
1015
<arguments>
1116
</arguments>
1217
</buildCommand>
1318
</buildSpec>
1419
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
1521
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
1622
</natures>
23+
<filteredResources>
24+
<filter>
25+
<id>0</id>
26+
<name></name>
27+
<type>30</type>
28+
<matcher>
29+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
30+
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
31+
</matcher>
32+
</filter>
33+
</filteredResources>
1734
</projectDescription>

android/.settings/org.eclipse.buildship.core.prefs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
arguments=
22
auto.sync=false
33
build.scans.enabled=false
4-
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.0))
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
55
connection.project.dir=
66
eclipse.preferences.version=1
77
gradle.user.home=
8-
java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
8+
java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
99
jvm.arguments=
1010
offline.mode=false
1111
override.workspace.settings=true

android/build.gradle

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ buildscript {
44

55
repositories {
66
google()
7-
jcenter()
7+
mavenCentral()
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:4.1.1'
11+
classpath 'com.android.tools.build:gradle:4.2.2'
1212
// noinspection DifferentKotlinGradleVersion
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
@@ -27,9 +27,8 @@ def getExtOrIntegerDefault(name) {
2727

2828
android {
2929
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
30-
buildToolsVersion getExtOrDefault('buildToolsVersion')
3130
defaultConfig {
32-
minSdkVersion 16
31+
minSdkVersion 30
3332
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
3433
versionCode 1
3534
versionName "1.0"
@@ -52,7 +51,6 @@ android {
5251

5352
repositories {
5453
mavenCentral()
55-
jcenter()
5654
google()
5755

5856
def found = false

android/gradle.properties

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Transcribe_kotlinVersion=1.3.50
2-
Transcribe_compileSdkVersion=28
3-
Transcribe_buildToolsVersion=28.0.3
4-
Transcribe_targetSdkVersion=28
1+
Transcribe_kotlinVersion=1.4.10
2+
Transcribe_compileSdkVersion=30
3+
Transcribe_buildToolsVersion=30
4+
Transcribe_targetSdkVersion=30
5+
android.useAndroidX=true
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

android/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.reactnativetranscribe">
3+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
34

45
</manifest>

android/src/main/java/com/reactnativetranscribe/TranscribeModule.java

+20-5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
import com.facebook.react.modules.core.PermissionListener;
2121

2222
import androidx.annotation.NonNull;
23+
import androidx.core.app.ActivityCompat;
24+
import androidx.core.content.ContextCompat;
25+
2326
import javax.annotation.Nullable;
2427

2528
public class TranscribeModule extends ReactContextBaseJavaModule {
@@ -32,6 +35,8 @@ public class TranscribeModule extends ReactContextBaseJavaModule {
3235
private AudioRecord audioRecord;
3336
private boolean isRecording;
3437

38+
private static final int PERMISSION_REQUEST_CODE = 1;
39+
3540
int audioSource = MediaRecorder.AudioSource.MIC;
3641
int sampleRateInHz = 8000;
3742
int channelConfig = AudioFormat.CHANNEL_IN_MONO;
@@ -52,11 +57,21 @@ public String getName() {
5257
private void init(){
5358
Log.d(TAG,"init");
5459

55-
isRecording = false;
56-
audioRecord = new AudioRecord(audioSource, sampleRateInHz, channelConfig, audioFormat, bufferSize * 10);
60+
if (ContextCompat.checkSelfPermission(this.getCurrentActivity(),Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_DENIED) {
61+
Log.d("permission", "permission denied to RECORD_AUDIO - requesting it");
62+
String[] permissions = {Manifest.permission.RECORD_AUDIO};
63+
64+
ActivityCompat.requestPermissions(this.getCurrentActivity(), permissions, PERMISSION_REQUEST_CODE);
65+
66+
} else {
67+
// RECORD_AUDIO has been granted
5768

58-
if (audioRecord.getState() != AudioRecord.STATE_INITIALIZED) {
59-
Log.d(TAG, "Unable to initialize AudioRecord");
69+
isRecording = false;
70+
audioRecord = new AudioRecord(audioSource, sampleRateInHz, channelConfig, audioFormat, bufferSize * 10);
71+
72+
if (audioRecord.getState() != AudioRecord.STATE_INITIALIZED) {
73+
Log.d(TAG, "Unable to initialize AudioRecord");
74+
}
6075
}
6176
}
6277

@@ -78,7 +93,7 @@ private boolean isPermissionGranted() {
7893
Log.d(TAG,"isPermissionsGranted");
7994

8095
String permission = Manifest.permission.RECORD_AUDIO;
81-
int res = getReactApplicationContext().checkCallingPermission(permission);
96+
int res = getReactApplicationContext().checkCallingOrSelfPermission(permission);
8297
return res == PackageManager.PERMISSION_GRANTED;
8398
}
8499

commitlint.config.js

-3
This file was deleted.

example/android/.project

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>android</name>
3+
<name>TranscribeExample</name>
44
<comment>Project android created by Buildship.</comment>
55
<projects>
66
</projects>
@@ -14,4 +14,15 @@
1414
<natures>
1515
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
1616
</natures>
17+
<filteredResources>
18+
<filter>
19+
<id>0</id>
20+
<name></name>
21+
<type>30</type>
22+
<matcher>
23+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
24+
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25+
</matcher>
26+
</filter>
27+
</filteredResources>
1728
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
15
connection.project.dir=
26
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=true
12+
show.console.view=true
13+
show.executions.view=true

example/android/app/build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ import com.android.build.OutputFile
7676
*/
7777

7878
project.ext.react = [
79-
enableHermes: false, // clean and rebuild if changing
79+
enableHermes: false, // clean and rebuild if changing
80+
entryFile: 'index.tsx'
8081
]
8182

8283
apply from: "../../node_modules/react-native/react.gradle"

example/android/app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<uses-permission android:name="android.permission.RECORD_AUDIO" />
55

66
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
7-
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize">
7+
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true">
88
<intent-filter>
99
<action android:name="android.intent.action.MAIN" />
1010
<category android:name="android.intent.category.LAUNCHER" />

example/android/build.gradle

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "28.0.3"
6-
minSdkVersion = 16
7-
compileSdkVersion = 28
8-
targetSdkVersion = 28
5+
minSdkVersion = 30
6+
compileSdkVersion = 31
7+
targetSdkVersion = 31
98
}
109
repositories {
1110
google()
1211
jcenter()
1312
}
1413
dependencies {
15-
classpath('com.android.tools.build:gradle:4.1.1')
14+
classpath('com.android.tools.build:gradle:4.2.2')
1615

1716
// NOTE: Do not place your application dependencies here; they belong
1817
// in the individual module build.gradle files

example/android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919

2020
android.useAndroidX=true
2121
android.enableJetifier=true
22-
FLIPPER_VERSION=0.33.1
22+
FLIPPER_VERSION=0.140.0
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Dec 04 15:00:34 CST 2020
1+
#Tue Mar 29 19:48:17 CDT 2022
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

example/ios/Podfile

+8-55
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,21 @@
1-
platform :ios, '10.0'
1+
require_relative '../node_modules/react-native/scripts/react_native_pods'
22
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33

4-
def add_flipper_pods!
5-
version = '~> 0.33.1'
6-
pod 'FlipperKit', version, :configuration => 'Debug'
7-
pod 'FlipperKit/FlipperKitLayoutPlugin', version, :configuration => 'Debug'
8-
pod 'FlipperKit/SKIOSNetworkPlugin', version, :configuration => 'Debug'
9-
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', version, :configuration => 'Debug'
10-
pod 'FlipperKit/FlipperKitReactPlugin', version, :configuration => 'Debug'
11-
end
12-
# Post Install processing for Flipper
13-
def flipper_post_install(installer)
14-
installer.pods_project.targets.each do |target|
15-
if target.name == 'YogaKit'
16-
target.build_configurations.each do |config|
17-
config.build_settings['SWIFT_VERSION'] = '5.0'
18-
end
19-
end
20-
end
21-
end
4+
platform :ios, '12.0'
225

236
target 'TranscribeExample' do
24-
# Pods for TranscribeExample
25-
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
26-
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
27-
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
28-
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
29-
pod 'React', :path => '../node_modules/react-native/'
30-
pod 'React-Core', :path => '../node_modules/react-native/'
31-
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
32-
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
33-
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
34-
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
35-
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
36-
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
37-
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
38-
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
39-
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
40-
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
41-
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
42-
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
7+
config = use_native_modules!
438

44-
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
45-
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
46-
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
47-
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
48-
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
49-
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
50-
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
51-
52-
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
53-
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
54-
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
9+
use_react_native!(:path => config["reactNativePath"])
5510

5611
pod 'react-native-transcribe', :path => '../..'
5712

58-
use_native_modules!
59-
6013
# Enables Flipper.
6114
#
6215
# Note that if you have use_frameworks! enabled, Flipper will not work and
6316
# you should disable these next few lines.
64-
add_flipper_pods!
65-
post_install do |installer|
66-
flipper_post_install(installer)
67-
end
17+
# use_flipper!({ 'Flipper' => '0.80.0' })
18+
# post_install do |installer|
19+
# flipper_post_install(installer)
20+
# end
6821
end

0 commit comments

Comments
 (0)