iOS Question Multiple notifications on GEOFENCE

Discussion in 'iOS Questions' started by Christian García S., Apr 11, 2019.

  1. Christian García S.

    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??

    [​IMG]


    Thanks
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    How are the push messages related to geofencing? How are you sending the push messages?
     
  3. Christian García S.

    Christian García S. Active Member Licensed User

    This is the code, I am using in LocManager_StateChanged when change state is 1:

    Code:
    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: Apr 11, 2019
  4. Erel

    Erel Administrator Staff Member Licensed User

    I still don't understand whether you are talking about real push messages or local notifications.

    You can do whatever you like in your code. Store the time of the last message in a file or KVS2 and check it before you show a new message.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice