Skip to content

Commit

Permalink
v2.0 rn basic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ksyeo1010 authored and laves committed Nov 22, 2023
1 parent ceb492d commit 79b4cb4
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/react-native-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ jobs:
- name: Pre-build dependencies
run: npm install yarn

# ************ REMOVE AFTER RELEASE *****************
- name: Build and package binding
working-directory: binding/react-native
run: yarn && yarn pkg

- name: Add to demo
run: yarn add ../../binding/react-native/pkg/picovoice-cheetah-react-native-2.0.0.tgz
# ***************************************************

- name: Install dependencies
run: yarn android-install

Expand Down Expand Up @@ -66,6 +75,15 @@ jobs:
- name: Pre-build dependencies
run: npm install yarn

# ************ REMOVE AFTER RELEASE *****************
- name: Build and package binding
working-directory: binding/react-native
run: yarn && yarn pkg

- name: Add to demo
run: yarn add ../../binding/react-native/pkg/picovoice-cheetah-react-native-2.0.0.tgz
# ***************************************************

- name: Install dependencies
run: yarn ios-install

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/react-native-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
./copy_test_resources.sh
- name: Cocoapods install
working-directory: binding/react-native/test-app/CheetahTestApp/ios
run: pod install
run: pod install --repo-update

- name: Inject AppID
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:' Tests.ts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/react-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class CheetahModule extends ReactContextBaseJavaModule {
public CheetahModule(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;

Cheetah.setSdk("react-native");
}

@NonNull
Expand Down
7 changes: 6 additions & 1 deletion binding/react-native/ios/Cheetah.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2022 Picovoice Inc.
// Copyright 2022-2023 Picovoice Inc.
//
// You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
// file accompanying this source.
Expand All @@ -15,6 +15,11 @@ import Cheetah
class PvCheetah: NSObject {
private var cheetahPool: [String: Cheetah] = [:]

override init() {
super.init()
Cheetah.setSdk(sdk: "react-native")
}

@objc(create:modelPath:endpointDuration:enableAutomaticPunctuation:resolver:rejecter:)
func create(
accessKey: String,
Expand Down
2 changes: 1 addition & 1 deletion binding/react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/cheetah-react-native",
"version": "1.1.1",
"version": "2.0.0",
"description": "Picovoice Cheetah React Native binding",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
1 change: 1 addition & 0 deletions binding/react-native/test-app/CheetahTestApp/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +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'

# Flags change depending on the env values.
flags = get_default_flags()
Expand Down

0 comments on commit 79b4cb4

Please sign in to comment.