Git Product home page Git Product logo

Comments (9)

stoprocent avatar stoprocent commented on July 27, 2024

Hi @greencoppercompany

As in Core Location documentation requestStateForRegion: :

The region whose state you want to know. This object must be an instance of one of the standard region subclasses provided by Map Kit. You cannot use this method to determine the state of custom regions you define yourself.

So you cant just pass any region and wait for the state to be reported.

As far as I understand this has to be a region provided by system from a delegate call like didRange etc.

locationManager:didDetermineState:forRegion: is also called when region you are monitoring has a flag notifyEntryStateOnDisplay set to YES / true and user lights up the iPhone screen.

In Apple documentation:

When set to true, the location manager sends beacon notifications when the user turns on the display and the device is already inside the region. These notifications are sent even if your app is not running. In that situation, the system launches your app into the background so that it can handle the notifications. In both situations, the location manager calls the locationManager:didDetermineState:forRegion: method of its delegate object.

Empty list of monitored regions is in fact related to #8 and this is something I will fix and publish soon as a new release. I will keep you guys updated ASAP.

from kontakt-ios-sdk.

greencoppercompany avatar greencoppercompany commented on July 27, 2024

Thanks for feedback. In fact, there is a requestStateForRegion: function in your SDK that take a KTKBeaconRegion. What i'm doing is:

  • create KTKBeaconRegion A
  • startMonitoring:A
  • follow by a call to requestStateForRegion:A to detect case where users are already in the region and fire internally a fake didEnter

and I get not callback at all.

from kontakt-ios-sdk.

stoprocent avatar stoprocent commented on July 27, 2024

I know but requestStateForRegion: is just a forward to CLLocationManager so it behaves exactly as Core Location. I will have to probably remove it as it causing confusions :( ...

For your case its better to start monitoring and also do ranging in monitored region to detect if users are already in range. So just instead of requesting state start raning for few seconds.

from kontakt-ios-sdk.

stoprocent avatar stoprocent commented on July 27, 2024

@greencoppercompany regarding issue #8 please try updating SDK to version 1.0.6. It was released few minutes ago.

Let me know please and remove your app from the phone first to make sure caches are clean.

from kontakt-ios-sdk.

greencoppercompany avatar greencoppercompany commented on July 27, 2024

Hummm but requestStateForRegion: is supposed to give a status. I don't get why we get no callback, even if the call is a forward to Apple code. Can it be linked to the property notifyEntryStateOnDisplay not properly setup?

What value do you put in your SDK?

https://developer.apple.com/library/prerelease/ios/documentation/CoreLocation/Reference/CLBeaconRegion_class/index.html#//apple_ref/occ/instp/CLBeaconRegion/notifyEntryStateOnDisplay

from kontakt-ios-sdk.

stoprocent avatar stoprocent commented on July 27, 2024

Hi @greencoppercompany, you were right and I was wrong 👍
I did some more testing requesting a state and in fact it should report and it does.

Apple docs are stating that a region object passed to request state method must be initialized by the system. My unit testing was focused on requesting a state with notifyEntryStateOnDisplay flag.

notifyEntryStateOnDisplay flag by default is set to NO / false.

I was more focused on just monitoring and ranging. I did some regions fixes in version 1.0.6 released yesterday.

Have a look:
Screen

from kontakt-ios-sdk.

greencoppercompany avatar greencoppercompany commented on July 27, 2024

Cool! I did some tests and we now have the correct behaviour.
The idea behind that is to help us trigger action even if users are already inside a region when the app starts.

Thanks for your help!

from kontakt-ios-sdk.

stoprocent avatar stoprocent commented on July 27, 2024

@greencoppercompany no worries, thanks for spotting this. Can I close the issue?

from kontakt-ios-sdk.

greencoppercompany avatar greencoppercompany commented on July 27, 2024

Sure!

from kontakt-ios-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.