capacitor-signal-strength 0.0.1 → 1.0.0
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/CapacitorSignalStrength.podspec +17 -17
- package/README.md +72 -133
- package/android/build.gradle +52 -58
- package/android/src/main/AndroidManifest.xml +4 -5
- package/android/src/main/java/com/gbvp/androidsignalstrength/SignalStrength.java +124 -131
- package/android/src/main/java/com/gbvp/androidsignalstrength/SignalStrengthPlugin.java +127 -182
- package/dist/esm/definitions.d.ts +13 -14
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/ios/Plugin/Info.plist +24 -24
- package/ios/Plugin/SignalStrength.swift +8 -8
- package/ios/Plugin/SignalStrengthPlugin.h +10 -10
- package/ios/Plugin/SignalStrengthPlugin.m +8 -8
- package/ios/Plugin/SignalStrengthPlugin.swift +18 -18
- package/package.json +76 -82
- package/dist/docs.json +0 -196
|
@@ -1,182 +1,127 @@
|
|
|
1
|
-
package com.gbvp.androidsignalstrength;
|
|
2
|
-
|
|
3
|
-
import android.Manifest;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import com.getcapacitor.
|
|
7
|
-
import com.getcapacitor.
|
|
8
|
-
import com.getcapacitor.
|
|
9
|
-
import com.getcapacitor.
|
|
10
|
-
import com.getcapacitor.
|
|
11
|
-
import com.getcapacitor.annotation.
|
|
12
|
-
import com.getcapacitor.annotation.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
private
|
|
32
|
-
|
|
33
|
-
@Override
|
|
34
|
-
public void load() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@PluginMethod
|
|
51
|
-
public void
|
|
52
|
-
if (getPermissionState(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
call
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
@
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
private
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return ret;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// SIGNAL STRENGTH INFO
|
|
132
|
-
/* **********************
|
|
133
|
-
MIN MAX
|
|
134
|
-
CDMA (2g)
|
|
135
|
-
dBm = -100 -75
|
|
136
|
-
asu = 0 97
|
|
137
|
-
LTE (4g)
|
|
138
|
-
dBm = -140 -44
|
|
139
|
-
asu = 0(99) 97
|
|
140
|
-
GSM (3g)
|
|
141
|
-
dBm = -120 -50
|
|
142
|
-
asu = 0(99) 31
|
|
143
|
-
WCDMA(3g)
|
|
144
|
-
dBm = -115 -50
|
|
145
|
-
asu = 0(99) 31
|
|
146
|
-
|
|
147
|
-
LINEAR = 100 * (1 - (((-dBmmax) - (-dBmlevel))/((-dBmmax) - (-dBmmin))));
|
|
148
|
-
NOT LINEAR = (2.0 * (dBmlevel + 100))/100
|
|
149
|
-
|
|
150
|
-
********************* */
|
|
151
|
-
private JSObject getJSObjectForPercentageInfo(String status, JSObject obj) {
|
|
152
|
-
JSObject ret = new JSObject();
|
|
153
|
-
String result;
|
|
154
|
-
|
|
155
|
-
if (status == "wifi") {
|
|
156
|
-
if (obj.getInteger("dBmlevel") <= -100) {
|
|
157
|
-
result = String.format("%.2f", 0);
|
|
158
|
-
} else if (obj.getInteger("dBmlevel") >= -50) {
|
|
159
|
-
result = String.format("%.2f", 1);
|
|
160
|
-
} else {
|
|
161
|
-
result = String.format("%.2f", (2.0 * (obj.getInteger("dBmlevel") + 100)) / 100);
|
|
162
|
-
}
|
|
163
|
-
} else {
|
|
164
|
-
result = String.format("%.2f", 1.0 * obj.getInteger("asulevel") / obj.getInteger("asulevelmax"));
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
ret.put("percentage", result);
|
|
168
|
-
return ret;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
private JSObject getJSObjectForLevelInfo(int signalLevel) {
|
|
172
|
-
JSObject ret = new JSObject();
|
|
173
|
-
ret.put("level", signalLevel);
|
|
174
|
-
|
|
175
|
-
return ret;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
private String[] getAliases(PluginCall call) {
|
|
179
|
-
String[] aliases = {SignalStrengthPlugin.PHONE_STATE, SignalStrengthPlugin.LOCATION, SignalStrengthPlugin.COARSE_LOCATION};
|
|
180
|
-
return aliases;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
1
|
+
package com.gbvp.androidsignalstrength;
|
|
2
|
+
|
|
3
|
+
import android.Manifest;
|
|
4
|
+
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
import com.getcapacitor.PermissionState;
|
|
7
|
+
import com.getcapacitor.Plugin;
|
|
8
|
+
import com.getcapacitor.PluginCall;
|
|
9
|
+
import com.getcapacitor.PluginMethod;
|
|
10
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
11
|
+
import com.getcapacitor.annotation.Permission;
|
|
12
|
+
import com.getcapacitor.annotation.PermissionCallback;
|
|
13
|
+
|
|
14
|
+
@CapacitorPlugin(
|
|
15
|
+
name = "SignalStrength",
|
|
16
|
+
permissions = {
|
|
17
|
+
@Permission(
|
|
18
|
+
alias = SignalStrengthPlugin.PHONE,
|
|
19
|
+
strings = {
|
|
20
|
+
Manifest.permission.READ_PHONE_STATE,
|
|
21
|
+
Manifest.permission.ACCESS_FINE_LOCATION,
|
|
22
|
+
Manifest.permission.ACCESS_COARSE_LOCATION
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
public class SignalStrengthPlugin extends Plugin {
|
|
28
|
+
|
|
29
|
+
static final String PHONE = "phone";
|
|
30
|
+
|
|
31
|
+
private SignalStrength provider;
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
public void load() {
|
|
35
|
+
provider = new SignalStrength(getContext());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@PluginMethod
|
|
39
|
+
public void checkPermissions(PluginCall call) {
|
|
40
|
+
JSObject result = new JSObject();
|
|
41
|
+
JSObject status = new JSObject();
|
|
42
|
+
|
|
43
|
+
PermissionState phoneState = getPermissionState(PHONE);
|
|
44
|
+
status.put("phone", phoneState.toString());
|
|
45
|
+
|
|
46
|
+
result.put("permissions", status);
|
|
47
|
+
call.resolve(result);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@PluginMethod
|
|
51
|
+
public void requestPermissions(PluginCall call) {
|
|
52
|
+
if (getPermissionState(PHONE) == PermissionState.GRANTED) {
|
|
53
|
+
checkPermissions(call);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
requestPermissionForAlias(PHONE, call, "permissionsCallback");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@PermissionCallback
|
|
62
|
+
private void permissionsCallback(PluginCall call) {
|
|
63
|
+
checkPermissions(call);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@PluginMethod
|
|
67
|
+
public void getdBm(PluginCall call) {
|
|
68
|
+
if (getPermissionState(PHONE) != PermissionState.GRANTED) {
|
|
69
|
+
requestPermissionForAlias(PHONE, call, "getdBmCallback");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
JSObject o = provider.getSignalInfo();
|
|
74
|
+
call.resolve(new JSObject().put("dBm", o.getInteger("dBm")));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@PermissionCallback
|
|
78
|
+
private void getdBmCallback(PluginCall call) {
|
|
79
|
+
getdBm(call);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@PluginMethod
|
|
84
|
+
public void getLevel(PluginCall call) {
|
|
85
|
+
if (getPermissionState(PHONE) != PermissionState.GRANTED) {
|
|
86
|
+
requestPermissionForAlias(PHONE, call, "getLevelCallback");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
JSObject o = provider.getSignalInfo();
|
|
91
|
+
call.resolve(new JSObject().put("level", o.getInteger("level")));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@PermissionCallback
|
|
95
|
+
private void getLevelCallback(PluginCall call) {
|
|
96
|
+
getLevel(call);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@PluginMethod
|
|
100
|
+
public void getPercentage(PluginCall call) {
|
|
101
|
+
if (getPermissionState(PHONE) != PermissionState.GRANTED) {
|
|
102
|
+
requestPermissionForAlias(PHONE, call, "getPercentageCallback");
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
JSObject o = provider.getSignalInfo();
|
|
107
|
+
String conn = call.getString("connection");
|
|
108
|
+
|
|
109
|
+
double percentage;
|
|
110
|
+
|
|
111
|
+
if ("wifi".equals(conn)) {
|
|
112
|
+
int dBm = o.getInteger("dBm");
|
|
113
|
+
if (dBm <= -100) percentage = 0;
|
|
114
|
+
else if (dBm >= -50) percentage = 1;
|
|
115
|
+
else percentage = (2.0 * (dBm + 100)) / 100;
|
|
116
|
+
} else {
|
|
117
|
+
percentage = (double) o.getInteger("asu") / o.getInteger("asuMax");
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
call.resolve(new JSObject().put("percentage", percentage));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@PermissionCallback
|
|
124
|
+
private void getPercentageCallback(PluginCall call) {
|
|
125
|
+
getPercentage(call);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import type { PermissionState } from '@capacitor/core';
|
|
2
|
-
|
|
3
|
-
export interface SignalStrengthPlugin {
|
|
4
|
-
getdBm(): Promise<DBm>;
|
|
5
|
-
getPercentage(options: {
|
|
6
|
-
connection: ConnectionType;
|
|
7
|
-
}): Promise<Percentage>;
|
|
8
|
-
getLevel(): Promise<Level>;
|
|
9
|
-
checkPermissions(): Promise<PermissionStatus>;
|
|
10
|
-
requestPermissions(): Promise<PermissionStatus>;
|
|
11
|
-
}
|
|
2
|
+
export declare type SignalStrengthPermissionType = 'phone';
|
|
12
3
|
export interface DBm {
|
|
13
4
|
dBm: number;
|
|
14
5
|
}
|
|
15
|
-
export interface Percentage {
|
|
16
|
-
percentage: string;
|
|
17
|
-
}
|
|
18
6
|
export interface Level {
|
|
19
7
|
level: number;
|
|
20
8
|
}
|
|
9
|
+
export interface Percentage {
|
|
10
|
+
percentage: number;
|
|
11
|
+
}
|
|
21
12
|
export interface PermissionStatus {
|
|
22
|
-
|
|
13
|
+
phone: PermissionState;
|
|
14
|
+
}
|
|
15
|
+
export declare type ConnectionType = 'wifi' | 'cellular' | 'none' | 'unknown';
|
|
16
|
+
export interface SignalStrengthPlugin {
|
|
17
|
+
getdBm(): Promise<DBm>;
|
|
18
|
+
getLevel(): Promise<Level>;
|
|
19
|
+
getPercentage(connection: ConnectionType): Promise<Percentage>;
|
|
20
|
+
checkPermissions(): Promise<PermissionStatus>;
|
|
21
|
+
requestPermissions(): Promise<PermissionStatus>;
|
|
23
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\r\n\r\nexport type SignalStrengthPermissionType = 'phone';\r\n\r\nexport interface DBm {\r\n dBm: number;\r\n}\r\n\r\nexport interface Level {\r\n level: number;\r\n}\r\n\r\nexport interface Percentage {\r\n percentage: number;\r\n}\r\n\r\nexport interface PermissionStatus {\r\n phone: PermissionState;\r\n}\r\n\r\nexport type ConnectionType = 'wifi' | 'cellular' | 'none' | 'unknown';\r\n\r\nexport interface SignalStrengthPlugin {\r\n /*\r\n * Get the signal strength as dBm.\r\n * Returns a value Number instead of an object.\r\n */\r\n getdBm(): Promise<DBm>;\r\n\r\n /*\r\n * Retrievean abstract level value for the overall signal quality.\r\n * Returns a value Number instead of an object.\r\n */\r\n getLevel(): Promise<Level>;\r\n\r\n /*\r\n * Get the signal strength as a percentage.\r\n * Returns a value Number instead of an object.\r\n */\r\n getPercentage(connection: ConnectionType): Promise<Percentage>;\r\n\r\n /*\r\n * Check the current permission status.\r\n * New in version 1.0.0\r\n */\r\n checkPermissions(): Promise<PermissionStatus>;\r\n\r\n /*\r\n * Request the necessary permissions.\r\n * New in version 1.0.0\r\n */\r\n requestPermissions(): Promise<PermissionStatus>;\r\n}"]}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,cAAc,GAAG,cAAc,CAAuB,gBAAgB,EAAE;IAC5E,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;CAChE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { SignalStrengthPlugin } from './definitions';\n\nconst SignalStrength = registerPlugin<SignalStrengthPlugin>('SignalStrength', {\n web: () => import('./web').then(m => new m.SignalStrengthWeb()),\n});\n\nexport * from './definitions';\nexport { SignalStrength };\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,cAAc,GAAG,cAAc,CAAuB,gBAAgB,EAAE;IAC5E,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;CAChE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\r\n\r\nimport type { SignalStrengthPlugin } from './definitions';\r\n\r\nconst SignalStrength = registerPlugin<SignalStrengthPlugin>('SignalStrength', {\r\n web: () => import('./web').then(m => new m.SignalStrengthWeb()),\r\n});\r\n\r\nexport * from './definitions';\r\nexport { SignalStrength };\r\n"]}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +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,iBACX,SAAQ,SAAS;IAGjB,MAAM;QACJ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,aAAa;QACX,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,QAAQ;QACN,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,gBAAgB;QACd,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,kBAAkB;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { PermissionStatus, SignalStrengthPlugin } from './definitions';\n\nexport class SignalStrengthWeb\n extends WebPlugin\n implements SignalStrengthPlugin\n{\n getdBm(): Promise<any> {\n throw new Error('Method not implemented.');\n }\n getPercentage(): Promise<any> {\n throw new Error('Method not implemented.');\n }\n getLevel(): Promise<any> {\n throw new Error('Method not implemented.');\n }\n checkPermissions(): Promise<PermissionStatus> {\n throw new Error('Method not implemented.');\n }\n requestPermissions(): Promise<PermissionStatus> {\n throw new Error('Method not implemented.');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,iBACX,SAAQ,SAAS;IAGjB,MAAM;QACJ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,aAAa;QACX,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,QAAQ;QACN,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,gBAAgB;QACd,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,kBAAkB;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\r\n\r\nimport type { PermissionStatus, SignalStrengthPlugin } from './definitions';\r\n\r\nexport class SignalStrengthWeb\r\n extends WebPlugin\r\n implements SignalStrengthPlugin\r\n{\r\n getdBm(): Promise<any> {\r\n throw new Error('Method not implemented.');\r\n }\r\n getPercentage(): Promise<any> {\r\n throw new Error('Method not implemented.');\r\n }\r\n getLevel(): Promise<any> {\r\n throw new Error('Method not implemented.');\r\n }\r\n checkPermissions(): Promise<PermissionStatus> {\r\n throw new Error('Method not implemented.');\r\n }\r\n requestPermissions(): Promise<PermissionStatus> {\r\n throw new Error('Method not implemented.');\r\n }\r\n}\r\n"]}
|
package/ios/Plugin/Info.plist
CHANGED
|
@@ -1,24 +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>
|
|
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>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
|
|
3
|
-
@objc public class SignalStrength: NSObject {
|
|
4
|
-
@objc public func echo(_ value: String) -> String {
|
|
5
|
-
print(value)
|
|
6
|
-
return value
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
@objc public class SignalStrength: NSObject {
|
|
4
|
+
@objc public func echo(_ value: String) -> String {
|
|
5
|
+
print(value)
|
|
6
|
+
return value
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -1,10 +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
|
-
|
|
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
|
+
|
|
@@ -1,8 +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(SignalStrengthPlugin, "SignalStrength",
|
|
7
|
-
CAP_PLUGIN_METHOD(echo, CAPPluginReturnPromise);
|
|
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(SignalStrengthPlugin, "SignalStrength",
|
|
7
|
+
CAP_PLUGIN_METHOD(echo, CAPPluginReturnPromise);
|
|
8
|
+
)
|
|
@@ -1,18 +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(SignalStrengthPlugin)
|
|
9
|
-
public class SignalStrengthPlugin: CAPPlugin {
|
|
10
|
-
private let implementation = SignalStrength()
|
|
11
|
-
|
|
12
|
-
@objc func echo(_ call: CAPPluginCall) {
|
|
13
|
-
let value = call.getString("value") ?? ""
|
|
14
|
-
call.resolve([
|
|
15
|
-
"value": implementation.echo(value)
|
|
16
|
-
])
|
|
17
|
-
}
|
|
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(SignalStrengthPlugin)
|
|
9
|
+
public class SignalStrengthPlugin: CAPPlugin {
|
|
10
|
+
private let implementation = SignalStrength()
|
|
11
|
+
|
|
12
|
+
@objc func echo(_ call: CAPPluginCall) {
|
|
13
|
+
let value = call.getString("value") ?? ""
|
|
14
|
+
call.resolve([
|
|
15
|
+
"value": implementation.echo(value)
|
|
16
|
+
])
|
|
17
|
+
}
|
|
18
|
+
}
|