iOS Question Multiple notifications on GEOFENCE

Christian García S.

Active Member
Licensed User
Hello,

I have implemented two types of monitoring in my IOS app, the circular region and the region for beacons using this tutorial: https://www.b4x.com/android/forum/threads/geofence-monitoring-a-region.81464/# post-654118

I receive a lot of PUSH (at the same time for the same location) when the user lock and unlock the phone or for another reason (Circular region), can I change the configuration in monitoring only for sending one notification by day or something??

upload_2019-4-9_17-51-4-png.79221



Thanks
 

Attachments

  • MonitorRegion.zip
    4.6 KB · Views: 246

Christian García S.

Active Member
Licensed User
This is the code, I am using in LocManager_StateChanged when change state is 1:

B4X:
Sub LocManager_RegionEnter(Region As NativeObject)
    Log("Entro region")
'    Globals.Push("RegionEnter",GetType(Region),0)
End Sub

Sub LocManager_RegionExit(Region As NativeObject)
    Log("Salio region")
'    Globals.Push("RegionExit",GetType(Region),0)
End Sub

Sub LocManager_StateChanged(State As Int, Region As Object)
    '0 = unknown, 1 = inside, 2 = outside
    Log("Region: " & GetType(Region) & ", State: " & State & ", " & $"$Time{DateTime.Now}"$)
   
    If State = 1 And GetType(Region) = "CLBeaconRegion" Then
        Globals.Push("BeaconRegion",Globals.mensajeRegionBeacon,0)
    End If
   
    If    State = 1 And GetType(Region) = "CLCircularRegion" Then
'        Globals.Push("CircularRegion",Globals.mensajeRegionCircular,0)
        Dim no As NativeObject = Region
        GetGeofenceCampaign(no.GetField("identifier").AsString)
    End If
End Sub
 
Last edited:
Upvote 0
Top