capacitor-rfid-plugin-ox 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorRfidPluginOx.podspec +17 -0
- package/README.md +49 -0
- package/android/build.gradle +59 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/uz/ox/plugins/rfid/BaseApplication.java +19 -0
- package/android/src/main/java/uz/ox/plugins/rfid/RFID.java +10 -0
- package/android/src/main/java/uz/ox/plugins/rfid/RFIDPlugin.java +55 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +41 -0
- package/dist/esm/definitions.d.ts +10 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +12 -0
- package/dist/esm/web.js +12 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +28 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +31 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/RFID.swift +8 -0
- package/ios/Plugin/RFIDPlugin.h +10 -0
- package/ios/Plugin/RFIDPlugin.m +8 -0
- package/ios/Plugin/RFIDPlugin.swift +18 -0
- package/package.json +78 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'CapacitorRfidPluginOx'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.license = package['license']
|
|
10
|
+
s.homepage = package['repository']['url']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
+
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
+
s.ios.deployment_target = '13.0'
|
|
15
|
+
s.dependency 'Capacitor'
|
|
16
|
+
s.swift_version = '5.1'
|
|
17
|
+
end
|
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# capacitor-rfid-plugin-ox
|
|
2
|
+
|
|
3
|
+
rfid reader (not ready to use)
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install capacitor-rfid-plugin-ox
|
|
9
|
+
npx cap sync
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## API
|
|
13
|
+
|
|
14
|
+
<docgen-index>
|
|
15
|
+
|
|
16
|
+
* [`inventory()`](#inventory)
|
|
17
|
+
* [`echo(...)`](#echo)
|
|
18
|
+
|
|
19
|
+
</docgen-index>
|
|
20
|
+
|
|
21
|
+
<docgen-api>
|
|
22
|
+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
23
|
+
|
|
24
|
+
### inventory()
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
inventory() => Promise<{ value: string; }>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Returns:** <code>Promise<{ value: string; }></code>
|
|
31
|
+
|
|
32
|
+
--------------------
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### echo(...)
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
echo(options: { value: string; }) => Promise<{ value: string; }>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Param | Type |
|
|
42
|
+
| ------------- | ------------------------------- |
|
|
43
|
+
| **`options`** | <code>{ value: string; }</code> |
|
|
44
|
+
|
|
45
|
+
**Returns:** <code>Promise<{ value: string; }></code>
|
|
46
|
+
|
|
47
|
+
--------------------
|
|
48
|
+
|
|
49
|
+
</docgen-api>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
ext {
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
buildscript {
|
|
9
|
+
repositories {
|
|
10
|
+
google()
|
|
11
|
+
mavenCentral()
|
|
12
|
+
}
|
|
13
|
+
dependencies {
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.0.0'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
apply plugin: 'com.android.library'
|
|
19
|
+
|
|
20
|
+
android {
|
|
21
|
+
namespace "uz.ox.plugins.rfid"
|
|
22
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
|
|
23
|
+
defaultConfig {
|
|
24
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
|
|
26
|
+
versionCode 1
|
|
27
|
+
versionName "1.0"
|
|
28
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
29
|
+
}
|
|
30
|
+
buildTypes {
|
|
31
|
+
release {
|
|
32
|
+
minifyEnabled false
|
|
33
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
lintOptions {
|
|
37
|
+
abortOnError false
|
|
38
|
+
}
|
|
39
|
+
compileOptions {
|
|
40
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
41
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
repositories {
|
|
46
|
+
google()
|
|
47
|
+
mavenCentral()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
dependencies {
|
|
52
|
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
53
|
+
implementation project(':capacitor-android')
|
|
54
|
+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
55
|
+
implementation files("libs/USDKLibrary-v2.3.0214.aar")
|
|
56
|
+
testImplementation "junit:junit:$junitVersion"
|
|
57
|
+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
58
|
+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
59
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package uz.ox.plugins.rfid;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
|
|
6
|
+
public class BaseApplication extends Application {
|
|
7
|
+
private static Context mContext;
|
|
8
|
+
|
|
9
|
+
@Override
|
|
10
|
+
public void onCreate() {
|
|
11
|
+
super.onCreate();
|
|
12
|
+
mContext = this;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public static Context getContext() {
|
|
16
|
+
return mContext;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
package uz.ox.plugins.rfid;
|
|
2
|
+
|
|
3
|
+
import android.util.Log;
|
|
4
|
+
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
import com.getcapacitor.Plugin;
|
|
7
|
+
import com.getcapacitor.PluginCall;
|
|
8
|
+
import com.getcapacitor.PluginMethod;
|
|
9
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
10
|
+
import com.ubx.usdk.USDKManager;
|
|
11
|
+
import com.ubx.usdk.rfid.RfidManager;
|
|
12
|
+
|
|
13
|
+
@CapacitorPlugin(name = "RFID")
|
|
14
|
+
public class RFIDPlugin extends Plugin {
|
|
15
|
+
|
|
16
|
+
private RFID implementation = new RFID();
|
|
17
|
+
|
|
18
|
+
public static final String TAG = "usdk";
|
|
19
|
+
|
|
20
|
+
public RfidManager mRfidManager;
|
|
21
|
+
|
|
22
|
+
@Override
|
|
23
|
+
public void load() {
|
|
24
|
+
this.initRfid();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private void initRfid() {
|
|
28
|
+
// 在异步回调中拿到RFID实例
|
|
29
|
+
USDKManager.getInstance().init(BaseApplication.getContext(), new USDKManager.InitListener() {
|
|
30
|
+
@Override
|
|
31
|
+
public void onStatus(USDKManager.STATUS status) {
|
|
32
|
+
if (status == USDKManager.STATUS.SUCCESS) {
|
|
33
|
+
Log.d(TAG, "initRfid() success.");
|
|
34
|
+
mRfidManager = USDKManager.getInstance().getRfidManager();
|
|
35
|
+
} else {
|
|
36
|
+
Log.d(TAG, "initRfid fail.");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@PluginMethod
|
|
43
|
+
public void inventory(PluginCall call) {
|
|
44
|
+
Log.d(TAG, String.valueOf(mRfidManager.getRange()));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@PluginMethod
|
|
48
|
+
public void echo(PluginCall call) {
|
|
49
|
+
String value = call.getString("value");
|
|
50
|
+
|
|
51
|
+
JSObject ret = new JSObject();
|
|
52
|
+
ret.put("value", implementation.echo(value));
|
|
53
|
+
call.resolve(ret);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
File without changes
|
package/dist/docs.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "RFIDPlugin",
|
|
4
|
+
"slug": "rfidplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "inventory",
|
|
10
|
+
"signature": "() => Promise<{ value: string; }>",
|
|
11
|
+
"parameters": [],
|
|
12
|
+
"returns": "Promise<{ value: string; }>",
|
|
13
|
+
"tags": [],
|
|
14
|
+
"docs": "",
|
|
15
|
+
"complexTypes": [],
|
|
16
|
+
"slug": "inventory"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "echo",
|
|
20
|
+
"signature": "(options: { value: string; }) => Promise<{ value: string; }>",
|
|
21
|
+
"parameters": [
|
|
22
|
+
{
|
|
23
|
+
"name": "options",
|
|
24
|
+
"docs": "",
|
|
25
|
+
"type": "{ value: string; }"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"returns": "Promise<{ value: string; }>",
|
|
29
|
+
"tags": [],
|
|
30
|
+
"docs": "",
|
|
31
|
+
"complexTypes": [],
|
|
32
|
+
"slug": "echo"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"properties": []
|
|
36
|
+
},
|
|
37
|
+
"interfaces": [],
|
|
38
|
+
"enums": [],
|
|
39
|
+
"typeAliases": [],
|
|
40
|
+
"pluginConfigs": []
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface RFIDPlugin {\n inventory(): Promise<{ value: string }>;\n echo(options: { value: string }): Promise<{ value: string }>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,IAAI,GAAG,cAAc,CAAa,MAAM,EAAE;IAC9C,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;CACtD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { RFIDPlugin } from './definitions';\n\nconst RFID = registerPlugin<RFIDPlugin>('RFID', {\n web: () => import('./web').then(m => new m.RFIDWeb()),\n});\n\nexport * from './definitions';\nexport { RFID };\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { RFIDPlugin } from './definitions';
|
|
3
|
+
export declare class RFIDWeb extends WebPlugin implements RFIDPlugin {
|
|
4
|
+
inventory(): Promise<{
|
|
5
|
+
value: string;
|
|
6
|
+
}>;
|
|
7
|
+
echo(options: {
|
|
8
|
+
value: string;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
value: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
export class RFIDWeb extends WebPlugin {
|
|
3
|
+
async inventory() {
|
|
4
|
+
console.log('inventory');
|
|
5
|
+
return { value: 'salom' };
|
|
6
|
+
}
|
|
7
|
+
async echo(options) {
|
|
8
|
+
console.log('ECHO', options);
|
|
9
|
+
return options;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC,KAAK,CAAC,SAAS;QACb,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC;IAC1B,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { RFIDPlugin } from './definitions';\n\nexport class RFIDWeb extends WebPlugin implements RFIDPlugin {\n async inventory(): Promise<{ value: string }> {\n console.log('inventory');\n return {value: 'salom'};\n }\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@capacitor/core');
|
|
6
|
+
|
|
7
|
+
const RFID = core.registerPlugin('RFID', {
|
|
8
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.RFIDWeb()),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
class RFIDWeb extends core.WebPlugin {
|
|
12
|
+
async inventory() {
|
|
13
|
+
console.log('inventory');
|
|
14
|
+
return { value: 'salom' };
|
|
15
|
+
}
|
|
16
|
+
async echo(options) {
|
|
17
|
+
console.log('ECHO', options);
|
|
18
|
+
return options;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
23
|
+
__proto__: null,
|
|
24
|
+
RFIDWeb: RFIDWeb
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
exports.RFID = RFID;
|
|
28
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst RFID = registerPlugin('RFID', {\n web: () => import('./web').then(m => new m.RFIDWeb()),\n});\nexport * from './definitions';\nexport { RFID };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class RFIDWeb extends WebPlugin {\n async inventory() {\n console.log('inventory');\n return { value: 'salom' };\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC;;ACFM,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjC,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAClC,KAAK;AACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var capacitorRFID = (function (exports, core) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const RFID = core.registerPlugin('RFID', {
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.RFIDWeb()),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
class RFIDWeb extends core.WebPlugin {
|
|
9
|
+
async inventory() {
|
|
10
|
+
console.log('inventory');
|
|
11
|
+
return { value: 'salom' };
|
|
12
|
+
}
|
|
13
|
+
async echo(options) {
|
|
14
|
+
console.log('ECHO', options);
|
|
15
|
+
return options;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
20
|
+
__proto__: null,
|
|
21
|
+
RFIDWeb: RFIDWeb
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
exports.RFID = RFID;
|
|
25
|
+
|
|
26
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
27
|
+
|
|
28
|
+
return exports;
|
|
29
|
+
|
|
30
|
+
})({}, capacitorExports);
|
|
31
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst RFID = registerPlugin('RFID', {\n web: () => import('./web').then(m => new m.RFIDWeb()),\n});\nexport * from './definitions';\nexport { RFID };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class RFIDWeb extends WebPlugin {\n async inventory() {\n console.log('inventory');\n return { value: 'salom' };\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;;ICFM,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjC,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAClC,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>FMWK</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.0</string>
|
|
19
|
+
<key>CFBundleVersion</key>
|
|
20
|
+
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
+
<key>NSPrincipalClass</key>
|
|
22
|
+
<string></string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
//! Project version number for Plugin.
|
|
4
|
+
FOUNDATION_EXPORT double PluginVersionNumber;
|
|
5
|
+
|
|
6
|
+
//! Project version string for Plugin.
|
|
7
|
+
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
|
8
|
+
|
|
9
|
+
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
|
10
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import <Capacitor/Capacitor.h>
|
|
3
|
+
|
|
4
|
+
// Define the plugin using the CAP_PLUGIN Macro, and
|
|
5
|
+
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
|
+
CAP_PLUGIN(RFIDPlugin, "RFID",
|
|
7
|
+
CAP_PLUGIN_METHOD(echo, CAPPluginReturnPromise);
|
|
8
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Please read the Capacitor iOS Plugin Development Guide
|
|
6
|
+
* here: https://capacitorjs.com/docs/plugins/ios
|
|
7
|
+
*/
|
|
8
|
+
@objc(RFIDPlugin)
|
|
9
|
+
public class RFIDPlugin: CAPPlugin {
|
|
10
|
+
private let implementation = RFID()
|
|
11
|
+
|
|
12
|
+
@objc func echo(_ call: CAPPluginCall) {
|
|
13
|
+
let value = call.getString("value") ?? ""
|
|
14
|
+
call.resolve([
|
|
15
|
+
"value": implementation.echo(value)
|
|
16
|
+
])
|
|
17
|
+
}
|
|
18
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "capacitor-rfid-plugin-ox",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "rfid reader (not ready to use)",
|
|
5
|
+
"main": "dist/plugin.cjs.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/esm/index.d.ts",
|
|
8
|
+
"unpkg": "dist/plugin.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"android/src/main/",
|
|
11
|
+
"android/build.gradle",
|
|
12
|
+
"dist/",
|
|
13
|
+
"ios/Plugin/",
|
|
14
|
+
"CapacitorRfidPluginOx.podspec"
|
|
15
|
+
],
|
|
16
|
+
"author": "ox-system",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/Akramjon2658/capacitor-rfid-plugin-ox.git.git"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/Akramjon2658/capacitor-rfid-plugin-ox.git/issues"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"capacitor",
|
|
27
|
+
"plugin",
|
|
28
|
+
"native"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
32
|
+
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
|
|
33
|
+
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
34
|
+
"verify:web": "npm run build",
|
|
35
|
+
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
36
|
+
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
37
|
+
"eslint": "eslint . --ext ts",
|
|
38
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
39
|
+
"swiftlint": "node-swiftlint",
|
|
40
|
+
"docgen": "docgen --api RFIDPlugin --output-readme README.md --output-json dist/docs.json",
|
|
41
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
|
|
42
|
+
"clean": "rimraf ./dist",
|
|
43
|
+
"watch": "tsc --watch",
|
|
44
|
+
"prepublishOnly": "npm run build"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@capacitor/android": "^5.0.0",
|
|
48
|
+
"@capacitor/core": "^5.0.0",
|
|
49
|
+
"@capacitor/docgen": "^0.0.18",
|
|
50
|
+
"@capacitor/ios": "^5.0.0",
|
|
51
|
+
"@ionic/eslint-config": "^0.3.0",
|
|
52
|
+
"@ionic/prettier-config": "^1.0.1",
|
|
53
|
+
"@ionic/swiftlint-config": "^1.1.2",
|
|
54
|
+
"eslint": "^7.11.0",
|
|
55
|
+
"prettier": "~2.3.0",
|
|
56
|
+
"prettier-plugin-java": "~1.0.2",
|
|
57
|
+
"rimraf": "^3.0.2",
|
|
58
|
+
"rollup": "^2.32.0",
|
|
59
|
+
"swiftlint": "^1.0.1",
|
|
60
|
+
"typescript": "~4.1.5"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"@capacitor/core": "^5.0.0"
|
|
64
|
+
},
|
|
65
|
+
"prettier": "@ionic/prettier-config",
|
|
66
|
+
"swiftlint": "@ionic/swiftlint-config",
|
|
67
|
+
"eslintConfig": {
|
|
68
|
+
"extends": "@ionic/eslint-config/recommended"
|
|
69
|
+
},
|
|
70
|
+
"capacitor": {
|
|
71
|
+
"ios": {
|
|
72
|
+
"src": "ios"
|
|
73
|
+
},
|
|
74
|
+
"android": {
|
|
75
|
+
"src": "android"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|