capacitor-mapboxnav 0.0.1 → 0.0.2

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.
@@ -62,7 +62,7 @@ repositories {
62
62
  // This should always be `mapbox` (not your username).
63
63
  username = "mapbox"
64
64
  // Use the secret token you stored in gradle.properties as the password
65
- password = project.hasProperty("MAPBOX_DOWNLOADS_TOKEN") ? project.property("MAPBOX_DOWNLOADS_TOKEN") : ""
65
+ password = project.findProperty("MAPBOX_DOWNLOADS_TOKEN") ?: System.getenv("MAPBOX_DOWNLOADS_TOKEN") ?: ""
66
66
  }
67
67
  }
68
68
  }
@@ -27,8 +27,14 @@ public class capacitormapboxnavPlugin extends Plugin {
27
27
  call.reject("AccessToken is required");
28
28
  return;
29
29
  }
30
- implementation.initialize(getContext(), accessToken);
31
- call.resolve();
30
+ getActivity().runOnUiThread(() -> {
31
+ try {
32
+ implementation.initialize(getContext(), accessToken);
33
+ call.resolve();
34
+ } catch (Exception e) {
35
+ call.reject("Initialization failed: " + e.getMessage());
36
+ }
37
+ });
32
38
  }
33
39
 
34
40
  @PluginMethod
@@ -52,7 +58,13 @@ public class capacitormapboxnavPlugin extends Plugin {
52
58
  return;
53
59
  }
54
60
 
55
- implementation.startNavigation(getActivity(), originLat, originLng, destLat, destLng, simulateRoute);
56
- call.resolve();
61
+ getActivity().runOnUiThread(() -> {
62
+ try {
63
+ implementation.startNavigation(getActivity(), originLat, originLng, destLat, destLng, simulateRoute);
64
+ call.resolve();
65
+ } catch (Exception e) {
66
+ call.reject("Failed to start navigation: " + e.getMessage());
67
+ }
68
+ });
57
69
  }
58
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-mapboxnav",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "capacitor mapbox navigation ndk",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",