@woosmap/react-native-plugin-geofencing 0.1.9 → 0.1.12-rc.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.
@@ -56,7 +56,7 @@ repositories {
56
56
  dependencies {
57
57
  //noinspection GradleDynamicVersion
58
58
  implementation "com.facebook.react:react-native:+" // From node_modules
59
- implementation("com.webgeoservices.woosmapgeofencing:woosmap-mobile-sdk:1.2.1")
59
+ implementation("com.webgeoservices.woosmapgeofencing:woosmap-mobile-sdk:1.2.+")
60
60
  implementation 'com.google.android.gms:play-services-maps:17.0.0'
61
61
  implementation 'androidx.room:room-runtime:2.2.4'
62
62
  annotationProcessor 'androidx.room:room-compiler:2.2.4'
@@ -108,7 +108,6 @@ class PluginGeofencing: RCTEventEmitter {
108
108
  WoosmapGeofenceService.setup(woosmapKey: privateKeyWoosmapAPI, configurationProfile: "")
109
109
  }
110
110
  if(isCallUnsuccessfull == false){
111
- sleep(1);// Take a some time as plugin initialize on main thread
112
111
  resolve(WoosmapGeofenceMessage.initialize)
113
112
  }
114
113
  }
@@ -166,17 +166,25 @@ import AirshipCore
166
166
  /// - woosmapKey: key use for woosmap service
167
167
  /// - configurationProfile: configuration profile
168
168
  @objc public static func setup(woosmapKey: String, configurationProfile: String) {
169
+ let group = DispatchGroup()
170
+ group.enter()
169
171
  DispatchQueue.main.async {
170
172
  _shared = WoosmapGeofenceService.init( woosmapKey, configurationProfile)
171
-
173
+ group.leave()
172
174
  }
175
+ group.wait()
176
+
173
177
  }
174
178
 
175
179
  /// Creating instance for woosGeofencing service
176
180
  @objc public static func setup() {
181
+ let group = DispatchGroup()
182
+ group.enter()
177
183
  DispatchQueue.main.async {
178
184
  _shared = WoosmapGeofenceService.init( "", "")
185
+ group.leave()
179
186
  }
187
+ group.wait()
180
188
  }
181
189
 
182
190
  /// Setting up woosmap key
@@ -187,9 +195,13 @@ import AirshipCore
187
195
  throw WoosGeofenceError(WoosmapGeofenceMessage.invalidWoosmapKey)
188
196
  } else {
189
197
  self.woosmapKey = key
198
+ let group = DispatchGroup()
199
+ group.enter()
190
200
  DispatchQueue.main.async {
191
201
  WoosmapGeofencing.shared.setWoosmapAPIKey(key: self.woosmapKey)
202
+ group.leave()
192
203
  }
204
+ group.wait()
193
205
  let defaults = UserDefaults.standard
194
206
  defaults.set(key, forKey: "WoosmapGeofenceService.woosmap")
195
207
  }
@@ -200,9 +212,13 @@ import AirshipCore
200
212
  /// - Throws: in case of wrong profile provided it return error invalidProfile
201
213
  public func startTracking(profile: String) throws {
202
214
  if let savedProfile = ConfigurationProfile(rawValue: profile) {
215
+ let group = DispatchGroup()
216
+ group.enter()
203
217
  DispatchQueue.main.async {
204
218
  WoosmapGeofencing.shared.startTracking(configurationProfile: savedProfile)
219
+ group.leave()
205
220
  }
221
+ group.wait()
206
222
  self.defaultProfile = profile
207
223
  let defaults = UserDefaults.standard
208
224
  defaults.set(profile, forKey: "WoosmapGeofenceService.profile")
@@ -570,11 +586,14 @@ import AirshipCore
570
586
  }
571
587
 
572
588
  public func startCustomTracking(mode: String, source:String, completion: @escaping (_ Value: Bool, _ Error: WoosGeofenceError?)->()){
589
+ let group = DispatchGroup()
590
+ group.enter()
573
591
  DispatchQueue.main.async {
574
592
  if(mode == "local"){
575
593
  let bundle = Bundle.main //Bundle(for: Self.self)
576
594
  if let url = bundle.url(forResource: source, withExtension: nil){
577
595
  let (status,errors) = WoosmapGeofencing.shared.startCustomTracking(url: url.absoluteString)
596
+
578
597
  if(status == false){
579
598
  completion(false,WoosGeofenceError(errors[0]))
580
599
  }
@@ -598,7 +617,9 @@ import AirshipCore
598
617
  else{
599
618
  completion(false,WoosGeofenceError(WoosmapGeofenceMessage.invalid_profilesourcetype))
600
619
  }
620
+ group.leave()
601
621
  }
622
+ group.wait()
602
623
  }
603
624
 
604
625
  public func startCustomTracking1(mode: String, source:String) throws{
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woosmap/react-native-plugin-geofencing",
3
- "version": "0.1.9",
3
+ "version": "0.1.12-rc.0",
4
4
  "description": "This react-native plugin extends the functionality offered by the Woosmap Geofencing Mobile SDKs. Find more about the Woosmap Geofencing SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -13,13 +13,7 @@
13
13
  "android",
14
14
  "ios",
15
15
  "cpp",
16
- "react-native-plugin-geofencing.podspec",
17
- "!lib/typescript/example",
18
- "!android/build",
19
- "!ios/build",
20
- "!**/__tests__",
21
- "!**/__fixtures__",
22
- "!**/__mocks__"
16
+ "react-native-plugin-geofencing.podspec"
23
17
  ],
24
18
  "scripts": {
25
19
  "test": "jest",
@@ -34,7 +28,8 @@
34
28
  "keywords": [
35
29
  "react-native",
36
30
  "ios",
37
- "android"
31
+ "android",
32
+ "woosmap"
38
33
  ],
39
34
  "repository": "https://github.com/Woosmap/woosmap-geofencing-react-native-plugin",
40
35
  "author": "WGS Indoor <28100769+sameerdhulap@users.noreply.github.com> (https://github.com/sameerdhulap)",
@@ -0,0 +1 @@
1
+ it.todo('write a test');