UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Project 22 - Detect-a-Beacon Code not running.

Forums > 100 Days of Swift

Something has changed in iOS 13 & 14 that is causing this not to work. I never get "Always" for granting access. I only get "Allow Once", "Allow While Using App" and "Don't Allow".

In didChangeAuthorization the if status == .authorizedAlways never gets called. Changing to .authorizedWhenInUse failed too. And it looks as if 'didChangeAuthorization status' has been retired and replaced with locationManagerDidChangeAuthorization.

Has anyone gotten this to work with 13 or 14?

Thanks!

3      

Hey there!

After choosing "Allow While Using App", during a short period Apple will be keeping track of the app usage, and eventually will prompt the user with the following: “Keep Only While Using” or “Change to Always Allow.”

Nevertheless, even with the initial choosing of "Allow While Using App", your app should have no problems executing the beacon scanning.

You can try looking into my code - https://github.com/DorianZet/100-Days-Of-Swift/tree/master/22-Project22 - and see if there are any differences that make your code not working properly. I know mine does, so it should be a fairly good reference.

3      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.