@capgo/background-geolocation 8.0.31 → 8.0.33

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/dist/docs.json CHANGED
@@ -137,6 +137,225 @@
137
137
  ],
138
138
  "slug": "setplannedroute"
139
139
  },
140
+ {
141
+ "name": "setupGeofencing",
142
+ "signature": "(options: GeofenceSetupOptions) => Promise<void>",
143
+ "parameters": [
144
+ {
145
+ "name": "options",
146
+ "docs": "The geofence configuration options",
147
+ "type": "GeofenceSetupOptions"
148
+ }
149
+ ],
150
+ "returns": "Promise<void>",
151
+ "tags": [
152
+ {
153
+ "name": "param",
154
+ "text": "options The geofence configuration options"
155
+ },
156
+ {
157
+ "name": "returns",
158
+ "text": "A promise that resolves once geofencing is configured"
159
+ },
160
+ {
161
+ "name": "since",
162
+ "text": "8.0.30"
163
+ },
164
+ {
165
+ "name": "example",
166
+ "text": "await BackgroundGeolocation.setupGeofencing({\n url: \"https://api.example.com/geofences\",\n notifyOnEntry: true,\n notifyOnExit: true,\n payload: { userId: \"123\" }\n});"
167
+ }
168
+ ],
169
+ "docs": "Configures native geofence transition handling.\n\nCall this before adding geofences when you need native background POSTs\nor default entry/exit settings.",
170
+ "complexTypes": [
171
+ "GeofenceSetupOptions"
172
+ ],
173
+ "slug": "setupgeofencing"
174
+ },
175
+ {
176
+ "name": "addGeofence",
177
+ "signature": "(options: AddGeofenceOptions) => Promise<void>",
178
+ "parameters": [
179
+ {
180
+ "name": "options",
181
+ "docs": "The geofence region options",
182
+ "type": "AddGeofenceOptions"
183
+ }
184
+ ],
185
+ "returns": "Promise<void>",
186
+ "tags": [
187
+ {
188
+ "name": "param",
189
+ "text": "options The geofence region options"
190
+ },
191
+ {
192
+ "name": "returns",
193
+ "text": "A promise that resolves when native monitoring starts"
194
+ },
195
+ {
196
+ "name": "since",
197
+ "text": "8.0.30"
198
+ },
199
+ {
200
+ "name": "example",
201
+ "text": "await BackgroundGeolocation.addGeofence({\n identifier: \"office\",\n latitude: 40.7128,\n longitude: -74.006,\n radius: 150\n});"
202
+ }
203
+ ],
204
+ "docs": "Starts monitoring a circular native geofence.",
205
+ "complexTypes": [
206
+ "AddGeofenceOptions"
207
+ ],
208
+ "slug": "addgeofence"
209
+ },
210
+ {
211
+ "name": "removeGeofence",
212
+ "signature": "(options: RemoveGeofenceOptions) => Promise<void>",
213
+ "parameters": [
214
+ {
215
+ "name": "options",
216
+ "docs": "The geofence identifier",
217
+ "type": "RemoveGeofenceOptions"
218
+ }
219
+ ],
220
+ "returns": "Promise<void>",
221
+ "tags": [
222
+ {
223
+ "name": "param",
224
+ "text": "options The geofence identifier"
225
+ },
226
+ {
227
+ "name": "returns",
228
+ "text": "A promise that resolves when native monitoring stops"
229
+ },
230
+ {
231
+ "name": "since",
232
+ "text": "8.0.30"
233
+ },
234
+ {
235
+ "name": "example",
236
+ "text": "await BackgroundGeolocation.removeGeofence({ identifier: \"office\" });"
237
+ }
238
+ ],
239
+ "docs": "Stops monitoring one geofence.",
240
+ "complexTypes": [
241
+ "RemoveGeofenceOptions"
242
+ ],
243
+ "slug": "removegeofence"
244
+ },
245
+ {
246
+ "name": "removeAllGeofences",
247
+ "signature": "() => Promise<void>",
248
+ "parameters": [],
249
+ "returns": "Promise<void>",
250
+ "tags": [
251
+ {
252
+ "name": "returns",
253
+ "text": "A promise that resolves when all native geofences are removed"
254
+ },
255
+ {
256
+ "name": "since",
257
+ "text": "8.0.30"
258
+ },
259
+ {
260
+ "name": "example",
261
+ "text": "await BackgroundGeolocation.removeAllGeofences();"
262
+ }
263
+ ],
264
+ "docs": "Stops monitoring every geofence registered by this plugin.",
265
+ "complexTypes": [],
266
+ "slug": "removeallgeofences"
267
+ },
268
+ {
269
+ "name": "getMonitoredGeofences",
270
+ "signature": "() => Promise<MonitoredGeofencesResult>",
271
+ "parameters": [],
272
+ "returns": "Promise<MonitoredGeofencesResult>",
273
+ "tags": [
274
+ {
275
+ "name": "returns",
276
+ "text": "A promise with monitored geofence identifiers"
277
+ },
278
+ {
279
+ "name": "since",
280
+ "text": "8.0.30"
281
+ },
282
+ {
283
+ "name": "example",
284
+ "text": "const { regions } = await BackgroundGeolocation.getMonitoredGeofences();"
285
+ }
286
+ ],
287
+ "docs": "Lists the geofence identifiers currently monitored by this plugin.",
288
+ "complexTypes": [
289
+ "MonitoredGeofencesResult"
290
+ ],
291
+ "slug": "getmonitoredgeofences"
292
+ },
293
+ {
294
+ "name": "addListener",
295
+ "signature": "(eventName: 'geofenceTransition', listenerFunc: (event: GeofenceTransitionEvent) => void) => Promise<PluginListenerHandle>",
296
+ "parameters": [
297
+ {
298
+ "name": "eventName",
299
+ "docs": "",
300
+ "type": "'geofenceTransition'"
301
+ },
302
+ {
303
+ "name": "listenerFunc",
304
+ "docs": "",
305
+ "type": "(event: GeofenceTransitionEvent) => void"
306
+ }
307
+ ],
308
+ "returns": "Promise<PluginListenerHandle>",
309
+ "tags": [
310
+ {
311
+ "name": "since",
312
+ "text": "8.0.30"
313
+ },
314
+ {
315
+ "name": "example",
316
+ "text": "const handle = await BackgroundGeolocation.addListener(\n \"geofenceTransition\",\n (event) => console.log(event.identifier, event.transition)\n);"
317
+ }
318
+ ],
319
+ "docs": "Listens for geofence enter/exit transitions while the WebView is alive.\n\nNative `url` delivery configured through `setupGeofencing` is used for\nbackground-safe delivery.",
320
+ "complexTypes": [
321
+ "PluginListenerHandle",
322
+ "GeofenceTransitionEvent"
323
+ ],
324
+ "slug": "addlistenergeofencetransition-"
325
+ },
326
+ {
327
+ "name": "addListener",
328
+ "signature": "(eventName: 'geofenceError', listenerFunc: (event: GeofenceErrorEvent) => void) => Promise<PluginListenerHandle>",
329
+ "parameters": [
330
+ {
331
+ "name": "eventName",
332
+ "docs": "",
333
+ "type": "'geofenceError'"
334
+ },
335
+ {
336
+ "name": "listenerFunc",
337
+ "docs": "",
338
+ "type": "(event: GeofenceErrorEvent) => void"
339
+ }
340
+ ],
341
+ "returns": "Promise<PluginListenerHandle>",
342
+ "tags": [
343
+ {
344
+ "name": "since",
345
+ "text": "8.0.30"
346
+ },
347
+ {
348
+ "name": "example",
349
+ "text": "const handle = await BackgroundGeolocation.addListener(\n \"geofenceError\",\n (event) => console.error(event.identifier, event.message)\n);"
350
+ }
351
+ ],
352
+ "docs": "Listens for native geofence monitoring errors while the WebView is alive.",
353
+ "complexTypes": [
354
+ "PluginListenerHandle",
355
+ "GeofenceErrorEvent"
356
+ ],
357
+ "slug": "addlistenergeofenceerror-"
358
+ },
140
359
  {
141
360
  "name": "getPluginVersion",
142
361
  "signature": "() => Promise<{ version: string; }>",
@@ -518,9 +737,526 @@
518
737
  "type": "number"
519
738
  }
520
739
  ]
521
- }
522
- ],
523
- "enums": [],
524
- "typeAliases": [],
740
+ },
741
+ {
742
+ "name": "GeofenceSetupOptions",
743
+ "slug": "geofencesetupoptions",
744
+ "docs": "Options for configuring native geofence transition handling.\n\nWhen `url` is provided, native iOS and Android code sends a JSON `POST`\nwhenever a monitored region is entered or exited. This keeps geofence\nhandling useful when the WebView is suspended.",
745
+ "tags": [
746
+ {
747
+ "text": "8.0.30",
748
+ "name": "since"
749
+ }
750
+ ],
751
+ "methods": [],
752
+ "properties": [
753
+ {
754
+ "name": "url",
755
+ "tags": [
756
+ {
757
+ "text": "8.0.30",
758
+ "name": "since"
759
+ },
760
+ {
761
+ "text": "\"https://api.example.com/geofences\"",
762
+ "name": "example"
763
+ }
764
+ ],
765
+ "docs": "Endpoint that receives geofence transition payloads.",
766
+ "complexTypes": [],
767
+ "type": "string | undefined"
768
+ },
769
+ {
770
+ "name": "notifyOnEntry",
771
+ "tags": [
772
+ {
773
+ "text": "8.0.30",
774
+ "name": "since"
775
+ },
776
+ {
777
+ "text": "true",
778
+ "name": "default"
779
+ },
780
+ {
781
+ "text": "true",
782
+ "name": "example"
783
+ }
784
+ ],
785
+ "docs": "Whether entry transitions should be monitored.",
786
+ "complexTypes": [],
787
+ "type": "boolean | undefined"
788
+ },
789
+ {
790
+ "name": "notifyOnExit",
791
+ "tags": [
792
+ {
793
+ "text": "8.0.30",
794
+ "name": "since"
795
+ },
796
+ {
797
+ "text": "true",
798
+ "name": "default"
799
+ },
800
+ {
801
+ "text": "true",
802
+ "name": "example"
803
+ }
804
+ ],
805
+ "docs": "Whether exit transitions should be monitored.",
806
+ "complexTypes": [],
807
+ "type": "boolean | undefined"
808
+ },
809
+ {
810
+ "name": "payload",
811
+ "tags": [
812
+ {
813
+ "text": "8.0.30",
814
+ "name": "since"
815
+ },
816
+ {
817
+ "text": "{ \"userId\": \"123\" }",
818
+ "name": "example"
819
+ }
820
+ ],
821
+ "docs": "Base JSON payload merged into every native transition POST and listener event.",
822
+ "complexTypes": [
823
+ "Record"
824
+ ],
825
+ "type": "Record<string, unknown>"
826
+ },
827
+ {
828
+ "name": "requestPermissions",
829
+ "tags": [
830
+ {
831
+ "text": "8.0.30",
832
+ "name": "since"
833
+ },
834
+ {
835
+ "text": "true",
836
+ "name": "default"
837
+ },
838
+ {
839
+ "text": "true",
840
+ "name": "example"
841
+ }
842
+ ],
843
+ "docs": "Whether the plugin should request the native location permission needed for geofencing.\n\niOS geofencing needs Always location authorization. Android background geofencing\nneeds foreground location and, on Android 10+, background location permission.",
844
+ "complexTypes": [],
845
+ "type": "boolean | undefined"
846
+ }
847
+ ]
848
+ },
849
+ {
850
+ "name": "AddGeofenceOptions",
851
+ "slug": "addgeofenceoptions",
852
+ "docs": "A circular geofence region.",
853
+ "tags": [
854
+ {
855
+ "text": "8.0.30",
856
+ "name": "since"
857
+ }
858
+ ],
859
+ "methods": [],
860
+ "properties": [
861
+ {
862
+ "name": "latitude",
863
+ "tags": [
864
+ {
865
+ "text": "8.0.30",
866
+ "name": "since"
867
+ },
868
+ {
869
+ "text": "40.7128",
870
+ "name": "example"
871
+ }
872
+ ],
873
+ "docs": "Latitude in degrees for the region center.",
874
+ "complexTypes": [],
875
+ "type": "number"
876
+ },
877
+ {
878
+ "name": "longitude",
879
+ "tags": [
880
+ {
881
+ "text": "8.0.30",
882
+ "name": "since"
883
+ },
884
+ {
885
+ "text": "-74.006",
886
+ "name": "example"
887
+ }
888
+ ],
889
+ "docs": "Longitude in degrees for the region center.",
890
+ "complexTypes": [],
891
+ "type": "number"
892
+ },
893
+ {
894
+ "name": "radius",
895
+ "tags": [
896
+ {
897
+ "text": "8.0.30",
898
+ "name": "since"
899
+ },
900
+ {
901
+ "text": "50",
902
+ "name": "default"
903
+ },
904
+ {
905
+ "text": "150",
906
+ "name": "example"
907
+ }
908
+ ],
909
+ "docs": "Region radius in meters.",
910
+ "complexTypes": [],
911
+ "type": "number | undefined"
912
+ },
913
+ {
914
+ "name": "identifier",
915
+ "tags": [
916
+ {
917
+ "text": "8.0.30",
918
+ "name": "since"
919
+ },
920
+ {
921
+ "text": "\"office\"",
922
+ "name": "example"
923
+ }
924
+ ],
925
+ "docs": "Stable identifier for the geofence.",
926
+ "complexTypes": [],
927
+ "type": "string"
928
+ },
929
+ {
930
+ "name": "notifyOnEntry",
931
+ "tags": [
932
+ {
933
+ "text": "8.0.30",
934
+ "name": "since"
935
+ }
936
+ ],
937
+ "docs": "Overrides the setup-level entry setting for this region.",
938
+ "complexTypes": [],
939
+ "type": "boolean | undefined"
940
+ },
941
+ {
942
+ "name": "notifyOnExit",
943
+ "tags": [
944
+ {
945
+ "text": "8.0.30",
946
+ "name": "since"
947
+ }
948
+ ],
949
+ "docs": "Overrides the setup-level exit setting for this region.",
950
+ "complexTypes": [],
951
+ "type": "boolean | undefined"
952
+ },
953
+ {
954
+ "name": "payload",
955
+ "tags": [
956
+ {
957
+ "text": "8.0.30",
958
+ "name": "since"
959
+ },
960
+ {
961
+ "text": "{ \"storeId\": \"nyc-1\" }",
962
+ "name": "example"
963
+ }
964
+ ],
965
+ "docs": "Region-specific payload merged over the setup payload.",
966
+ "complexTypes": [
967
+ "Record"
968
+ ],
969
+ "type": "Record<string, unknown>"
970
+ }
971
+ ]
972
+ },
973
+ {
974
+ "name": "RemoveGeofenceOptions",
975
+ "slug": "removegeofenceoptions",
976
+ "docs": "Options for removing a monitored geofence.",
977
+ "tags": [
978
+ {
979
+ "text": "8.0.30",
980
+ "name": "since"
981
+ }
982
+ ],
983
+ "methods": [],
984
+ "properties": [
985
+ {
986
+ "name": "identifier",
987
+ "tags": [
988
+ {
989
+ "text": "8.0.30",
990
+ "name": "since"
991
+ },
992
+ {
993
+ "text": "\"office\"",
994
+ "name": "example"
995
+ }
996
+ ],
997
+ "docs": "Identifier passed to `addGeofence`.",
998
+ "complexTypes": [],
999
+ "type": "string"
1000
+ }
1001
+ ]
1002
+ },
1003
+ {
1004
+ "name": "MonitoredGeofencesResult",
1005
+ "slug": "monitoredgeofencesresult",
1006
+ "docs": "Result returned when listing monitored geofences.",
1007
+ "tags": [
1008
+ {
1009
+ "text": "8.0.30",
1010
+ "name": "since"
1011
+ }
1012
+ ],
1013
+ "methods": [],
1014
+ "properties": [
1015
+ {
1016
+ "name": "regions",
1017
+ "tags": [
1018
+ {
1019
+ "text": "8.0.30",
1020
+ "name": "since"
1021
+ },
1022
+ {
1023
+ "text": "[\"office\", \"warehouse\"]",
1024
+ "name": "example"
1025
+ }
1026
+ ],
1027
+ "docs": "Identifiers for all geofences currently monitored by this plugin.",
1028
+ "complexTypes": [],
1029
+ "type": "string[]"
1030
+ }
1031
+ ]
1032
+ },
1033
+ {
1034
+ "name": "PluginListenerHandle",
1035
+ "slug": "pluginlistenerhandle",
1036
+ "docs": "",
1037
+ "tags": [],
1038
+ "methods": [],
1039
+ "properties": [
1040
+ {
1041
+ "name": "remove",
1042
+ "tags": [],
1043
+ "docs": "",
1044
+ "complexTypes": [],
1045
+ "type": "() => Promise<void>"
1046
+ }
1047
+ ]
1048
+ },
1049
+ {
1050
+ "name": "GeofenceTransitionEvent",
1051
+ "slug": "geofencetransitionevent",
1052
+ "docs": "Event emitted when a monitored geofence is entered or exited.\n\nThe same data is also sent to the configured `url`, when one is set.",
1053
+ "tags": [
1054
+ {
1055
+ "text": "8.0.30",
1056
+ "name": "since"
1057
+ }
1058
+ ],
1059
+ "methods": [],
1060
+ "properties": [
1061
+ {
1062
+ "name": "identifier",
1063
+ "tags": [
1064
+ {
1065
+ "text": "8.0.30",
1066
+ "name": "since"
1067
+ },
1068
+ {
1069
+ "text": "\"office\"",
1070
+ "name": "example"
1071
+ }
1072
+ ],
1073
+ "docs": "Identifier of the geofence that changed state.",
1074
+ "complexTypes": [],
1075
+ "type": "string"
1076
+ },
1077
+ {
1078
+ "name": "transition",
1079
+ "tags": [
1080
+ {
1081
+ "text": "8.0.30",
1082
+ "name": "since"
1083
+ },
1084
+ {
1085
+ "text": "\"enter\"",
1086
+ "name": "example"
1087
+ }
1088
+ ],
1089
+ "docs": "Transition name.",
1090
+ "complexTypes": [],
1091
+ "type": "'enter' | 'exit'"
1092
+ },
1093
+ {
1094
+ "name": "enter",
1095
+ "tags": [
1096
+ {
1097
+ "text": "8.0.30",
1098
+ "name": "since"
1099
+ },
1100
+ {
1101
+ "text": "true",
1102
+ "name": "example"
1103
+ }
1104
+ ],
1105
+ "docs": "`true` for entry transitions, `false` for exit transitions.",
1106
+ "complexTypes": [],
1107
+ "type": "boolean"
1108
+ },
1109
+ {
1110
+ "name": "latitude",
1111
+ "tags": [
1112
+ {
1113
+ "text": "8.0.30",
1114
+ "name": "since"
1115
+ },
1116
+ {
1117
+ "text": "40.7128",
1118
+ "name": "example"
1119
+ }
1120
+ ],
1121
+ "docs": "Latitude in degrees for the monitored region center, when available.",
1122
+ "complexTypes": [],
1123
+ "type": "number | undefined"
1124
+ },
1125
+ {
1126
+ "name": "longitude",
1127
+ "tags": [
1128
+ {
1129
+ "text": "8.0.30",
1130
+ "name": "since"
1131
+ },
1132
+ {
1133
+ "text": "-74.006",
1134
+ "name": "example"
1135
+ }
1136
+ ],
1137
+ "docs": "Longitude in degrees for the monitored region center, when available.",
1138
+ "complexTypes": [],
1139
+ "type": "number | undefined"
1140
+ },
1141
+ {
1142
+ "name": "radius",
1143
+ "tags": [
1144
+ {
1145
+ "text": "8.0.30",
1146
+ "name": "since"
1147
+ },
1148
+ {
1149
+ "text": "150",
1150
+ "name": "example"
1151
+ }
1152
+ ],
1153
+ "docs": "Region radius in meters, when available.",
1154
+ "complexTypes": [],
1155
+ "type": "number | undefined"
1156
+ },
1157
+ {
1158
+ "name": "payload",
1159
+ "tags": [
1160
+ {
1161
+ "text": "8.0.30",
1162
+ "name": "since"
1163
+ }
1164
+ ],
1165
+ "docs": "Merged setup and region payload.",
1166
+ "complexTypes": [
1167
+ "Record"
1168
+ ],
1169
+ "type": "Record<string, unknown>"
1170
+ }
1171
+ ]
1172
+ },
1173
+ {
1174
+ "name": "GeofenceErrorEvent",
1175
+ "slug": "geofenceerrorevent",
1176
+ "docs": "Event emitted when native geofence monitoring fails.",
1177
+ "tags": [
1178
+ {
1179
+ "text": "8.0.30",
1180
+ "name": "since"
1181
+ }
1182
+ ],
1183
+ "methods": [],
1184
+ "properties": [
1185
+ {
1186
+ "name": "identifier",
1187
+ "tags": [
1188
+ {
1189
+ "text": "8.0.30",
1190
+ "name": "since"
1191
+ },
1192
+ {
1193
+ "text": "\"office\"",
1194
+ "name": "example"
1195
+ }
1196
+ ],
1197
+ "docs": "Identifier of the geofence that failed, when native APIs provide it.",
1198
+ "complexTypes": [],
1199
+ "type": "string | undefined"
1200
+ },
1201
+ {
1202
+ "name": "code",
1203
+ "tags": [
1204
+ {
1205
+ "text": "8.0.30",
1206
+ "name": "since"
1207
+ },
1208
+ {
1209
+ "text": "5",
1210
+ "name": "example"
1211
+ }
1212
+ ],
1213
+ "docs": "Native platform error code.",
1214
+ "complexTypes": [],
1215
+ "type": "number | undefined"
1216
+ },
1217
+ {
1218
+ "name": "message",
1219
+ "tags": [
1220
+ {
1221
+ "text": "8.0.30",
1222
+ "name": "since"
1223
+ }
1224
+ ],
1225
+ "docs": "Native platform error message.",
1226
+ "complexTypes": [],
1227
+ "type": "string"
1228
+ },
1229
+ {
1230
+ "name": "domain",
1231
+ "tags": [
1232
+ {
1233
+ "text": "8.0.30",
1234
+ "name": "since"
1235
+ }
1236
+ ],
1237
+ "docs": "Native error domain, when available.",
1238
+ "complexTypes": [],
1239
+ "type": "string | undefined"
1240
+ }
1241
+ ]
1242
+ }
1243
+ ],
1244
+ "enums": [],
1245
+ "typeAliases": [
1246
+ {
1247
+ "name": "Record",
1248
+ "slug": "record",
1249
+ "docs": "Construct a type with a set of properties K of type T",
1250
+ "types": [
1251
+ {
1252
+ "text": "{\r\n [P in K]: T;\r\n}",
1253
+ "complexTypes": [
1254
+ "K",
1255
+ "T"
1256
+ ]
1257
+ }
1258
+ ]
1259
+ }
1260
+ ],
525
1261
  "pluginConfigs": []
526
1262
  }