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.
@@ -1,182 +1,127 @@
1
- package com.gbvp.androidsignalstrength;
2
-
3
- import android.Manifest;
4
- import android.telephony.TelephonyManager;
5
-
6
- import com.getcapacitor.JSObject;
7
- import com.getcapacitor.PermissionState;
8
- import com.getcapacitor.Plugin;
9
- import com.getcapacitor.PluginCall;
10
- import com.getcapacitor.PluginMethod;
11
- import com.getcapacitor.annotation.CapacitorPlugin;
12
- import com.getcapacitor.annotation.Permission;
13
- import com.getcapacitor.annotation.PermissionCallback;
14
-
15
- import java.util.List;
16
-
17
- @CapacitorPlugin(
18
- name = "SignalStrength",
19
- permissions = {
20
- @Permission(alias = SignalStrengthPlugin.PHONE_STATE, strings = {Manifest.permission.READ_PHONE_STATE}),
21
- @Permission(alias = SignalStrengthPlugin.LOCATION, strings = {Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION}),
22
- @Permission(alias = SignalStrengthPlugin.COARSE_LOCATION, strings = { Manifest.permission.ACCESS_COARSE_LOCATION })
23
- }
24
- )
25
- public class SignalStrengthPlugin extends Plugin {
26
-
27
- public static final String PHONE_STATE = "phone_state";
28
- public static final String LOCATION = "location";
29
- public static final String COARSE_LOCATION = "coarse_Location";
30
- private SignalStrength implementation;
31
- private TelephonyManager tm;
32
-
33
- @Override
34
- public void load() {
35
- implementation = new SignalStrength(getContext());
36
- tm = implementation.getPhoneState();
37
- }
38
-
39
- @PluginMethod
40
- public void getdBm(final PluginCall call) {
41
- if (getPermissionState(SignalStrengthPlugin.PHONE_STATE) != PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.LOCATION) != PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.COARSE_LOCATION) != PermissionState.GRANTED) {
42
- String[] aliases = getAliases(call);
43
- requestPermissionForAliases(aliases, call, "requestPermissionsDBmCallback");
44
- } else {
45
- JSObject obj = implementation.getInfo(tm);
46
- call.resolve(getJSObjectForDBmInfo(obj.getInteger("dBmlevel")));
47
- }
48
- }
49
-
50
- @PluginMethod
51
- public void getPercentage(final PluginCall call) {
52
- if (getPermissionState(SignalStrengthPlugin.PHONE_STATE) != PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.LOCATION) != PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.COARSE_LOCATION) != PermissionState.GRANTED) {
53
- String[] aliases = getAliases(call);
54
- requestPermissionForAliases(aliases, call, "requestPermissionsPercentageCallback");
55
- } else {
56
- JSObject obj = implementation.getInfo(tm);
57
- String status = call.getString("connection");
58
- call.resolve(getJSObjectForPercentageInfo(status, obj));
59
- }
60
- }
61
-
62
- @PluginMethod
63
- public void getLevel(final PluginCall call) {
64
- if (getPermissionState(SignalStrengthPlugin.PHONE_STATE) != PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.LOCATION) != PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.COARSE_LOCATION) != PermissionState.GRANTED) {
65
- String[] aliases = getAliases(call);
66
- requestPermissionForAliases(aliases, call, "requestPermissionsLevelCallback");
67
- } else {
68
- JSObject obj = implementation.getInfo(tm);
69
- call.resolve(getJSObjectForLevelInfo(obj.getInteger("signalLevel")));
70
- }
71
- }
72
-
73
- @Override
74
- @PluginMethod
75
- public void checkPermissions(PluginCall call) {
76
- if (implementation.isPhoneStateEnabled() && implementation.isLocationServicesEnabled()) {
77
- super.checkPermissions(call);
78
- } else {
79
- call.reject("Permissions are not granted.");
80
- }
81
- }
82
-
83
- @Override
84
- @PluginMethod
85
- public void requestPermissions(PluginCall call) {
86
- if (implementation.isPhoneStateEnabled() && implementation.isLocationServicesEnabled()) {
87
- super.requestPermissions(call);
88
- } else {
89
- call.reject("Permissions are not granted.");
90
- }
91
- }
92
-
93
- @PermissionCallback
94
- private void requestPermissionsDBmCallback(PluginCall call) {
95
- if (getPermissionState(SignalStrengthPlugin.PHONE_STATE) == PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.LOCATION) == PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.COARSE_LOCATION) == PermissionState.GRANTED) {
96
- JSObject obj = implementation.getInfo(tm);
97
- call.resolve(getJSObjectForDBmInfo(obj.getInteger("dBmlevel")));
98
- } else {
99
- call.reject("Failed to retrieve signal strength.");
100
- }
101
- }
102
-
103
- @PermissionCallback
104
- private void requestPermissionsPercentageCallback(PluginCall call) {
105
- if (getPermissionState(SignalStrengthPlugin.PHONE_STATE) == PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.LOCATION) == PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.COARSE_LOCATION) == PermissionState.GRANTED) {
106
- JSObject obj = implementation.getInfo(tm);
107
- String status = call.getString("connection");
108
- call.resolve(getJSObjectForPercentageInfo(status, obj));
109
- } else {
110
- call.reject("Failed to retrieve signal strength.");
111
- }
112
- }
113
-
114
- @PermissionCallback
115
- private void requestPermissionsLevelCallback(PluginCall call) {
116
- if (getPermissionState(SignalStrengthPlugin.PHONE_STATE) == PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.LOCATION) == PermissionState.GRANTED && getPermissionState(SignalStrengthPlugin.COARSE_LOCATION) == PermissionState.GRANTED) {
117
- JSObject obj = implementation.getInfo(tm);
118
- call.resolve(getJSObjectForLevelInfo(obj.getInteger("signalLevel")));
119
- } else {
120
- call.reject("Failed to retrieve signal strength.");
121
- }
122
- }
123
-
124
- private JSObject getJSObjectForDBmInfo(int dBmlevel) {
125
- JSObject ret = new JSObject();
126
- ret.put("dBm", dBmlevel);
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
- import type { ConnectionType } from '@capacitor/network';
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
- info: PermissionState;
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';\nimport type { ConnectionType } from '@capacitor/network';\n\nexport interface SignalStrengthPlugin {\n getdBm(): Promise<DBm>;\n getPercentage(options: { connection: ConnectionType }): Promise<Percentage>;\n getLevel(): Promise<Level>;\n checkPermissions(): Promise<PermissionStatus>;\n requestPermissions(): Promise<PermissionStatus>;\n}\n\nexport interface DBm {\n dBm: number;\n}\n\nexport interface Percentage {\n percentage: string;\n}\n\nexport interface Level {\n level: number;\n}\n\nexport interface PermissionStatus {\n info: PermissionState;\n}\n"]}
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}"]}
@@ -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"]}
@@ -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"]}
@@ -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
+ }