@grouplinknetwork/group-link-ionic-plugin 1.0.7-beta.1 → 1.0.7-beta.3

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.
@@ -0,0 +1,19 @@
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 = 'GrouplinknetworkGroupLinkIonicPlugin'
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
+
14
+ s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
15
+
16
+ s.ios.deployment_target = '13.0'
17
+ s.dependency 'Capacitor'
18
+ s.swift_version = '5.1'
19
+ end
@@ -123,13 +123,35 @@ public class GroupLinkPlugin extends Plugin {
123
123
  }
124
124
  }
125
125
 
126
+ // @PermissionCallback
127
+ // private void permissionCallback(PluginCall call) {
128
+ // permissionIsGranted("bluetooth", call);
129
+ // permissionIsGranted("foreground_service", call);
130
+ // permissionIsGranted("location", call);
131
+ // permissionIsGranted("wifi_state", call);
132
+ // permissionIsGranted("notification", call);
133
+ // }
134
+
126
135
  @PermissionCallback
127
136
  private void permissionCallback(PluginCall call) {
128
- permissionIsGranted("bluetooth", call);
129
- permissionIsGranted("foreground_service", call);
130
- permissionIsGranted("location", call);
131
- permissionIsGranted("wifi_state", call);
132
- permissionIsGranted("notification", call);
137
+ try {
138
+ boolean granted = true;
139
+
140
+ if (getPermissionState("bluetooth") != PermissionState.GRANTED) granted = false;
141
+ if (getPermissionState("foreground_service") != PermissionState.GRANTED) granted = false;
142
+ if (getPermissionState("location") != PermissionState.GRANTED) granted = false;
143
+ if (getPermissionState("wifi_state") != PermissionState.GRANTED) granted = false;
144
+ if (getPermissionState("notification") != PermissionState.GRANTED) granted = false;
145
+
146
+ if (granted) {
147
+ call.resolve();
148
+ } else {
149
+ call.reject("Permission denied");
150
+ }
151
+
152
+ } catch (Exception error) {
153
+ handleError(error, call);
154
+ }
133
155
  }
134
156
 
135
157
  @PluginMethod
@@ -144,16 +166,16 @@ public class GroupLinkPlugin extends Plugin {
144
166
  }
145
167
  }
146
168
 
147
- private void permissionIsGranted(String alias, PluginCall call) {
148
- try {
149
- if (getPermissionState(alias) == PermissionState.GRANTED) {
150
- } else {
151
- call.reject("Permission denied");
152
- }
153
- } catch (Exception error) {
154
- handleError(error, call);
155
- }
156
- }
169
+ // private void permissionIsGranted(String alias, PluginCall call) {
170
+ // try {
171
+ // if (getPermissionState(alias) == PermissionState.GRANTED) {
172
+ // } else {
173
+ // call.reject("Permission denied");
174
+ // }
175
+ // } catch (Exception error) {
176
+ // handleError(error, call);
177
+ // }
178
+ // }
157
179
 
158
180
  private void handleError(Exception error, PluginCall call) {
159
181
  Context context = this.getActivity().getApplicationContext();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grouplinknetwork/group-link-ionic-plugin",
3
- "version": "1.0.7-beta.1",
3
+ "version": "1.0.7-beta.3",
4
4
  "description": "plugin for implementing the company's native sdk group link",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -12,6 +12,7 @@
12
12
  "dist/",
13
13
  "ios/Plugin",
14
14
  "Package.swift",
15
+ "GroupLinkPlugin.podspec",
15
16
  "CapacitorPlugin.json"
16
17
  ],
17
18
  "author": "Group Link",
@@ -72,8 +73,7 @@
72
73
  },
73
74
  "capacitor": {
74
75
  "ios": {
75
- "src": "ios",
76
- "podspec": false
76
+ "src": "ios"
77
77
  },
78
78
  "android": {
79
79
  "src": "android"