Skip to content

Commit

Permalink
rn
Browse files Browse the repository at this point in the history
  • Loading branch information
laves committed Nov 22, 2023
1 parent 79b4cb4 commit e1c094e
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 490 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/react-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
run: yarn install

- name: Build
run: yarn
run: yarn prepare
5 changes: 4 additions & 1 deletion binding/react-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ android {
repositories {
mavenCentral()
google()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1302'
}

def found = false
def defaultDir = null
Expand Down Expand Up @@ -118,5 +121,5 @@ repositories {
dependencies {
// noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
implementation 'ai.picovoice:cheetah-android:1.1.2'
implementation 'ai.picovoice:cheetah-android:2.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* CheetahModule Class.
*/
public class CheetahModule extends ReactContextBaseJavaModule {

private final ReactApplicationContext reactContext;
private final Map<String, Cheetah> cheetahPool = new HashMap<>();

Expand Down
4 changes: 2 additions & 2 deletions binding/react-native/cheetah-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.authors = package["author"]

s.platforms = { :ios => "11.0" }
s.platforms = { :ios => "13.0" }
s.source = { :git => "https://github.com/Picovoice/cheetah.git", :tag => "#{s.version}" }

s.source_files = "ios/*.{h,m,mm,swift}"

s.dependency "React"
s.dependency "Cheetah-iOS", '~> 1.1.0'
s.dependency "Cheetah-iOS", '~> 2.0.0'
end
1 change: 0 additions & 1 deletion binding/react-native/test-app/CheetahTestApp/.ruby-version

This file was deleted.

6 changes: 0 additions & 6 deletions binding/react-native/test-app/CheetahTestApp/Gemfile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ buildscript {
repositories {
google()
mavenCentral()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1302'
}
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
Expand All @@ -36,6 +39,9 @@ allprojects {

allprojects {
repositories {
maven {
url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1302'
}
maven {
url("$rootDir/../node_modules/detox/Detox-android")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
"$(inherited)",
);
INFOPLIST_FILE = CheetahTestAppTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -466,7 +466,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = CheetahTestAppTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -584,7 +584,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down Expand Up @@ -649,7 +649,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down
4 changes: 2 additions & 2 deletions binding/react-native/test-app/CheetahTestApp/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, min_ios_version_supported
platform :ios, '13.0'
prepare_react_native_project!

flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
Expand All @@ -14,7 +14,7 @@ end

target 'CheetahTestApp' do
config = use_native_modules!
pod 'Cheetah-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/cheetah/v2.0/binding/ios/Cheetah-iOS.podspec'
pod 'Cheetah-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec'

# Flags change depending on the env values.
flags = get_default_flags()
Expand Down
2 changes: 1 addition & 1 deletion demo/react-native/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class App extends Component<Props, State> {
handleError(err: any) {
let errorMessage: string;
if (err instanceof CheetahErrors.CheetahInvalidArgumentError) {
errorMessage = `${err.message}\nPlease make sure accessKey ${this._accessKey} is a valid access key.`;
errorMessage = `${err.message}`;
} else if (err instanceof CheetahErrors.CheetahActivationError) {
errorMessage = 'AccessKey activation error';
} else if (err instanceof CheetahErrors.CheetahActivationLimitError) {
Expand Down
6 changes: 6 additions & 0 deletions demo/react-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ buildscript {
repositories {
google()
jcenter()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1302'
}
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.3")
Expand All @@ -32,6 +35,9 @@ allprojects {

google()
jcenter()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1302'
}
maven { url 'https://www.jitpack.io' }
}
}
8 changes: 4 additions & 4 deletions demo/react-native/ios/CheetahDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
DEVELOPMENT_TEAM = 65723695GD;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = CheetahDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
Expand All @@ -320,7 +320,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 65723695GD;
INFOPLIST_FILE = CheetahDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -382,7 +382,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
Expand Down Expand Up @@ -434,7 +434,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
Expand Down
3 changes: 2 additions & 1 deletion demo/react-native/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
platform :ios, '13.0'

target 'CheetahDemo' do
config = use_native_modules!
pod 'Cheetah-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec'
use_react_native!(:path => config["reactNativePath"])
end
Loading

0 comments on commit e1c094e

Please sign in to comment.