Skip to content

Commit 66fca94

Browse files
Merge pull request #9 from SocketMobile/version-1.4.32
updated logic for v1.4.32
2 parents 2f2529a + 0a56f08 commit 66fca94

File tree

6 files changed

+30
-17
lines changed

6 files changed

+30
-17
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# react-native-capture 1.4.23
1+
# react-native-capture 1.4.32
22

33
This react native module allows a React Native application to use and control Socket Mobile wireless barcode scanners, NFC Reader/Writer, and Camera (iOS only) to capture and deliver data capture to such application.
44

@@ -198,7 +198,26 @@ const App = () => {
198198
};
199199
```
200200

201-
## Upgrading to iOS SDK Version 1.6.39
201+
## Referencing Socket Mobile's Android SDK
202+
203+
In version `>1.4.23`, we are removing the `android/libs` folder and it's contents. This is because we are now referencing the Socket Mobile Android SDK via the release repo. The developer will need to add two things. First, in their `build.gradle` file, add the below code, in the `repositories` section.
204+
205+
```
206+
maven {
207+
url "https://bin.socketmobile.com/repo/releases"
208+
}
209+
```
210+
211+
Next, in their `app/gradle.build` file, they will need to add the below code.
212+
213+
```
214+
packagingOptions {
215+
pickFirst '/lib/arm64-v8a/libc++_shared.so'
216+
pickFirst '/lib/armeabi-v7a/libc++_shared.so'
217+
}
218+
```
219+
220+
## Upgrading to iOS SDK Version 1.8.34
202221

203222
I needed to deintegrate pods and then re-install them using `pod install --repo-update`. Doing a regular `pod install` gave me the error the below error.
204223

android/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ repositories {
6868

6969
dependencies {
7070
//noinspection GradleDynamicVersion
71-
implementation fileTree(dir: "libs", include: ["*.aar", "*.jar"])
71+
// implementation fileTree(dir: "libs", include: ["*.aar", "*.jar"])
7272
implementation 'com.facebook.react:react-native:+' // From node_modules
7373
implementation 'com.google.zxing:core:3.5.1'
74+
implementation 'com.socketmobile:capture-socketcam:1.7.39'
7475
}
7576

7677
def configureReactNativePom(def pom) {

android/src/main/java/com/socketmobile/CaptureModule.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.socketmobile.capture.client.ConnectionState;
2020
import com.socketmobile.capture.CaptureError;
2121
import com.socketmobile.capture.troy.ExtensionScope;
22+
import com.socketmobile.CaptureService;
2223

2324
import static android.content.Intent.FLAG_RECEIVER_FOREGROUND;
2425

@@ -107,9 +108,4 @@ public void onError(CaptureError error) {
107108
}
108109
};
109110

110-
Intent getStartIntent() {
111-
return new Intent(ACTION)
112-
.setFlags(FLAG_RECEIVER_FOREGROUND)
113-
.setComponent(new ComponentName(SERVICE_APP_ID, BROADCAST_RECEIVER));
114-
}
115111
}

index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ const NFCDeviceTypes = [
4949
];
5050

5151
const { NativeCaptureModule } = NativeModules;
52-
let eventEmitter = new NativeEventEmitter(NativeCaptureModule);
5352

54-
const subscription = eventEmitter.addListener("onCaptureEvent", onCaptureEvent);
53+
let eventEmitter = new NativeEventEmitter(NativeCaptureModule);
5554

5655
const onCaptureEvent = (e) => {
5756
// maybe need to access handle here but this one doesn't get called in Android.
@@ -65,8 +64,9 @@ const onCaptureEvent = (e) => {
6564
}
6665
};
6766

67+
const subscription = eventEmitter.addListener("onCaptureEvent", onCaptureEvent);
68+
6869
NativeCaptureModule.open = (host, notification) => {
69-
eventEmitter.addListener("onCaptureEvent", onCaptureEvent);
7070
NativeCaptureModule.onNotification = notification;
7171
return NativeCaptureModule.openTransport(host).then(
7272
(result) => result.transport
@@ -85,7 +85,6 @@ NativeCaptureModule.send = (handle, jsonRpc) => {
8585
};
8686

8787
NativeCaptureModule.close = (handle) => {
88-
console.log("index close");
8988
subscription.remove();
9089
return NativeCaptureModule.closeTransport(handle);
9190
};
@@ -112,8 +111,6 @@ class CaptureRn extends Capture {
112111
const promise = new Promise((resolve, reject) => {
113112
let interval;
114113
const openRetry = () => {
115-
// options comes back undefined
116-
// need to access handle here?
117114
clearInterval(interval);
118115
super
119116
.open(appInfo, callback, options)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-capture",
33
"title": "React Native Capture",
4-
"version": "1.4.23",
4+
"version": "1.4.32",
55
"description": "Socket Mobile CaptureSDK for React Native",
66
"main": "index.js",
77
"files": [

react-native-capture.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Pod::Spec.new do |s|
1313
# optional - use expanded license entry instead:
1414
# s.license = { :type => "MIT", :file => "LICENSE" }
1515
s.authors = { "Socket Mobile" => "[email protected]" }
16-
s.platforms = { :ios => "11.0" }
16+
s.platforms = { :ios => "12.0" }
1717
s.source = { :git => "https://github.com/SocketMobile/react-native-capture.git", :tag => "#{s.version}" }
1818

1919
s.source_files = "ios/**/*.{h,c,m,swift}"
2020
s.requires_arc = true
2121

2222
s.dependency "React-Core"
2323
# ...
24-
s.dependency "CaptureSDK", "~>1.6.39"
24+
s.dependency 'CaptureSDK', '~>1.8.34'
2525
end
2626

0 commit comments

Comments
 (0)