Select to view content in your preferred language

Geofencing on Public webmap in Field Maps

1019
5
Jump to solution
06-08-2023 10:48 AM
RossFindlayCOC
Regular Contributor

Hey Field Maps folks: I am investigating Field Maps as a candidate for geofencing on maps shared to the public. My prototype is to send a notification to the user when they are passing through one neighbourhood to another in our city. I configured the geofence with the Designer, it was super easy, this is really great. I downloaded the app on both Android and iOS. The Android experience has been seamless while the iOS experience has been rather poor.

I went to the webmap with anon Access.

https://fieldmaps.arcgis.app/?itemID=49a6141a05f64c4bb100b576a6b9894f&referenceContext=open&anonymou...

 

I was initially asked to enable the location services

RossFindlayCOC_0-1686246124394.png

Then it asked me to access my activity.

RossFindlayCOC_1-1686246154950.png

 

And finally Notifications

RossFindlayCOC_2-1686246173619.png

 I allowed all this and the app opened providing a notification

RossFindlayCOC_3-1686246231924.png

 

The issue came when I closed the app. I could no longer get notifications, and despite messing with all the settings on my iPhone that I am aware of the tool won't send me notifications. Android is a different experience entirely working every time I open and close reliably. Any reason iPhone would act this way?

Any advice is welcome.

 

0 Kudos
1 Solution

Accepted Solutions
ColinLawrence
Esri Regular Contributor

@RossFindlayCOC I tried your link from the original post and I can see the behavior you are talking about. Android is handling this correctly but something is going wrong on iOS. I can look into this more. If you want a way to track this more officially I would suggest logging a bug with tech support.

Regards,
Colin

View solution in original post

5 Replies
ColinLawrence
Esri Regular Contributor

@RossFindlayCOC Are you backgrounding the app on iOS or closing it all the way? If the app is completely closed iOS would only restart your location services after it detects a "significant location change" which can be high variable depending on your environment. Once this detection happens, Field Maps would restart in the background and continue monitoring your location (and you should receive geofence notifications when applicable). I would also double check your location permissions under Field Maps in the iOS settings and try setting it to "Always". 

This shouldnt be impacting it but have you tested removing the URL portion of your workflow - ie browsing directly to the map and seeing if you can repro?

Regards,
Colin
0 Kudos
RossFindlayCOC
Regular Contributor

thanks for the reply  I am closing things and stopping the app as you stated  looked at the log and it looks like there is some token issue stopping the Location Alerts  the layer in the map is a hosted feature view that is shared to the public so I am not sure why there is a token issue. Log listed below 

 


2023-06-09, 10:38:06 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:38:06 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:38:06 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:38:05 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:38:05 AM [OFFLINE] Current user's map folder: Guest@https:--www.arcgis.com
2023-06-09, 10:38:00 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:38:00 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:38:00 AM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-09, 10:36:53 AM [LOADING] Layer (Alert Locations) failed to load with error: Error Domain=NSCocoaErrorDomain Code=3072 "User canceled error" UserInfo={AGSCredentialErrorKey=token: (null)
tokenURL: https://www.arcgis.com/sharing/rest/generateToken
tokenExpiration: (null)
, NSLocalizedDescription=User canceled error, NSUnderlyingError=0x28085d3b0 {Error Domain=com.esri.arcgis.runtime.services.error Code=499 "Token Required" UserInfo={NSURL=https://www.arcgis.com/sharing/rest/generateToken, NSLocalizedDescription=Token Required}}}
2023-06-09, 10:36:13 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:36:13 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:36:13 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:36:11 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:36:11 AM [OFFLINE] Current user's map folder: Guest@https:--www.arcgis.com
2023-06-09, 10:35:05 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:35:05 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:35:05 AM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-09, 10:32:28 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:32:28 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:32:28 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:32:26 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:32:26 AM [OFFLINE] Current user's map folder: Guest@https:--www.arcgis.com
2023-06-09, 10:32:24 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:32:24 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:32:24 AM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-09, 10:32:19 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:32:19 AM [GPS] GPS DATA SOURCE: restarting with app in foreground
2023-06-09, 10:32:17 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:32:17 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:32:17 AM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-09, 10:30:20 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:30:20 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:30:20 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:30:19 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:30:19 AM [OFFLINE] Current user's map folder: Guest@https:--www.arcgis.com
2023-06-09, 10:29:56 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:29:56 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:29:56 AM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-09, 10:29:45 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:29:45 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:29:45 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:29:44 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:29:44 AM [OFFLINE] Current user's map folder: Guest@https:--www.arcgis.com
2023-06-09, 10:29:39 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:29:39 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:29:39 AM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-09, 10:29:20 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:29:20 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:29:20 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:29:19 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:29:19 AM [OFFLINE] Current user's map folder: Guest@https:--www.arcgis.com
2023-06-09, 10:27:58 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:27:58 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:27:58 AM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-09, 10:27:40 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:27:40 AM [GPS] GPS DATA SOURCE: stopped
2023-06-09, 10:27:40 AM [GPS] GPS DATA SOURCE: doStop
2023-06-09, 10:27:38 AM [GPS] GPS DATA SOURCE: starting
2023-06-09, 10:27:38 AM [OFFLINE] Current user's map folder: Guest@https:--www.arcgis.com
2023-06-08, 3:23:14 PM [GPS] GPS DATA SOURCE: stopped
2023-06-08, 3:23:14 PM [GPS] GPS DATA SOURCE: doStop
2023-06-08, 3:23:14 PM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-08, 3:22:48 PM [GPS] GPS DATA SOURCE: starting
2023-06-08, 3:22:48 PM [GPS] GPS DATA SOURCE: restarting with app in foreground
2023-06-08, 3:22:43 PM [GPS] GPS DATA SOURCE: stopped
2023-06-08, 3:22:43 PM [GPS] GPS DATA SOURCE: doStop
2023-06-08, 3:22:43 PM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-08, 3:21:45 PM [GPS] GPS DATA SOURCE: starting
2023-06-08, 3:21:45 PM [GPS] GPS DATA SOURCE: stopped
2023-06-08, 3:21:45 PM [GPS] GPS DATA SOURCE: doStop
2023-06-08, 3:21:03 PM [GPS] GPS DATA SOURCE: starting
2023-06-08, 3:21:03 PM [OFFLINE] Current user's map folder: Guest@https:--www.arcgis.com
2023-06-08, 3:20:55 PM [GPS] GPS DATA SOURCE: stopped
2023-06-08, 3:20:55 PM [GPS] GPS DATA SOURCE: doStop
2023-06-08, 3:20:55 PM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-08, 3:20:55 PM [GPS] GPS DATA SOURCE: starting
2023-06-08, 3:20:55 PM [GPS] GPS DATA SOURCE: restarting with app in foreground
2023-06-08, 3:20:55 PM [GPS] GPS DATA SOURCE: stopped
2023-06-08, 3:20:55 PM [GPS] GPS DATA SOURCE: doStop
2023-06-08, 3:20:55 PM [GPS] GPS DATA SOURCE: stopping with app in background
2023-06-08, 3:20:22 PM [GPS] GPS DATA SOURCE: starting
2023-06-08, 3:20:15 PM [OFFLINE] Current user's map folder: Guest@https:--www.arcgis.com

0 Kudos
ColinLawrence
Esri Regular Contributor

That is odd, I have not seen that token error before in this context. 


The issue came when I closed the app. 

Just to clarify, everything is working when in the foreground? You dont receive any sort of permission prompt (outside of the motion, GPS, notification system prompts)?


Regards,
Colin
0 Kudos
RossFindlayCOC
Regular Contributor

Was prompted the first time I went into the iOS but never again, even after closing. Once returning after closing I never received any sort of prompt but also didn’t recieve any sort of alert. On Android every time I reopen I am prompted, which I assume is the expected behaviour. 

0 Kudos
ColinLawrence
Esri Regular Contributor

@RossFindlayCOC I tried your link from the original post and I can see the behavior you are talking about. Android is handling this correctly but something is going wrong on iOS. I can look into this more. If you want a way to track this more officially I would suggest logging a bug with tech support.

Regards,
Colin