Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Commit

Permalink
Do nothing on non-Android platforms and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
darryncampbell committed Sep 1, 2021
1 parent 408bc90 commit e5859f6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
63 changes: 33 additions & 30 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,39 @@
'use strict';

var { Platform, NativeModules } = require('react-native');
var RNDataWedgeIntents = NativeModules.DataWedgeIntents;

var DataWedgeIntents = {
// Specifying the DataWedge API constants in this module is deprecated. It is not feasible to stay current with the DW API.
ACTION_SOFTSCANTRIGGER: RNDataWedgeIntents.ACTION_SOFTSCANTRIGGER,
ACTION_SCANNERINPUTPLUGIN: RNDataWedgeIntents.ACTION_SCANNERINPUTPLUGIN,
ACTION_ENUMERATESCANNERS: RNDataWedgeIntents.ACTION_ENUMERATESCANNERS,
ACTION_SETDEFAULTPROFILE: RNDataWedgeIntents.ACTION_SETDEFAULTPROFILE,
ACTION_RESETDEFAULTPROFILE: RNDataWedgeIntents.ACTION_RESETDEFAULTPROFILE,
ACTION_SWITCHTOPROFILE: RNDataWedgeIntents.ACTION_SWITCHTOPROFILE,
START_SCANNING: RNDataWedgeIntents.START_SCANNING,
STOP_SCANNING: RNDataWedgeIntents.STOP_SCANNING,
TOGGLE_SCANNING: RNDataWedgeIntents.TOGGLE_SCANNING,
ENABLE_PLUGIN: RNDataWedgeIntents.ENABLE_PLUGIN,
DISABLE_PLUGIN: RNDataWedgeIntents.DISABLE_PLUGIN,
if (Platform.OS === 'android')
{
var RNDataWedgeIntents = NativeModules.DataWedgeIntents;

sendIntent(action, parameterValue) {
// THIS METHOD IS DEPRECATED, use SendBroadcastWithExtras
RNDataWedgeIntents.sendIntent(action, parameterValue);
},
sendBroadcastWithExtras(extrasObject) {
RNDataWedgeIntents.sendBroadcastWithExtras(extrasObject);
},
registerBroadcastReceiver(filter) {
RNDataWedgeIntents.registerBroadcastReceiver(filter);
},
registerReceiver(action, category) {
// THIS METHOD IS DEPRECATED, use registerBroadcastReceiver
RNDataWedgeIntents.registerReceiver(action, category);
},
};
var DataWedgeIntents = {
// Specifying the DataWedge API constants in this module is deprecated. It is not feasible to stay current with the DW API.
ACTION_SOFTSCANTRIGGER: RNDataWedgeIntents.ACTION_SOFTSCANTRIGGER,
ACTION_SCANNERINPUTPLUGIN: RNDataWedgeIntents.ACTION_SCANNERINPUTPLUGIN,
ACTION_ENUMERATESCANNERS: RNDataWedgeIntents.ACTION_ENUMERATESCANNERS,
ACTION_SETDEFAULTPROFILE: RNDataWedgeIntents.ACTION_SETDEFAULTPROFILE,
ACTION_RESETDEFAULTPROFILE: RNDataWedgeIntents.ACTION_RESETDEFAULTPROFILE,
ACTION_SWITCHTOPROFILE: RNDataWedgeIntents.ACTION_SWITCHTOPROFILE,
START_SCANNING: RNDataWedgeIntents.START_SCANNING,
STOP_SCANNING: RNDataWedgeIntents.STOP_SCANNING,
TOGGLE_SCANNING: RNDataWedgeIntents.TOGGLE_SCANNING,
ENABLE_PLUGIN: RNDataWedgeIntents.ENABLE_PLUGIN,
DISABLE_PLUGIN: RNDataWedgeIntents.DISABLE_PLUGIN,

module.exports = DataWedgeIntents;
sendIntent(action, parameterValue) {
// THIS METHOD IS DEPRECATED, use SendBroadcastWithExtras
RNDataWedgeIntents.sendIntent(action, parameterValue);
},
sendBroadcastWithExtras(extrasObject) {
RNDataWedgeIntents.sendBroadcastWithExtras(extrasObject);
},
registerBroadcastReceiver(filter) {
RNDataWedgeIntents.registerBroadcastReceiver(filter);
},
registerReceiver(action, category) {
// THIS METHOD IS DEPRECATED, use registerBroadcastReceiver
RNDataWedgeIntents.registerReceiver(action, category);
},
};
module.exports = DataWedgeIntents;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-datawedge-intents",
"version": "0.1.7",
"version": "0.1.8",
"description": "React Native Android module to interface with Zebra's DataWedge using Android Intents to control the barcode scanner and retrieve scanned data",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit e5859f6

Please sign in to comment.