Comments (9)
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.
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.
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.
@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.
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?
from kontakt-ios-sdk.
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.
from kontakt-ios-sdk.
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.
@greencoppercompany no worries, thanks for spotting this. Can I close the issue?
from kontakt-ios-sdk.
Sure!
from kontakt-ios-sdk.
Related Issues (20)
- didEnter not fired HOT 6
- didRangeBeacons wrongly detecting beacons
- Burst Mode not working for Beacon Pros
- Monitoring region not working in example app
- Xamarin Bindings
- KTKEddystoneManager centralState is always "unknown" (0) HOT 1
- KontaktIO iOS SDK
- Issue writing beacon with SDK grather than 1.5.1
- Can't monitor Eddystone regions with only a namespaceId HOT 1
- Is there any way to create KTKDevice instance other than using kontakt.io api? HOT 1
- find available Packets
- Update Example to Swift 4 or newer
- not working in iPhone X (os 13.3)
- Changelog not updated
- How to get current battery level of beacon using this SDK on ios?
- KTKDeviceManager delegate method always return empty array
- didChangeLocationAuthorizationStatus delegate does not fire before permission is given
- XCFramework HOT 1
- App stopped receiving any notifications
- pod install error: During installing the S3 bucket returns HTTP 403 error HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kontakt-ios-sdk.