Skip to content

Conversation

gre4ixin
Copy link
Member

No description provided.

@gre4ixin gre4ixin merged commit 0ecd496 into main Oct 29, 2022

public init(locationManager: CLLocationManager, desiredAccuracy: LocationAccuracy) {
self.locationManager = locationManager
self.locationManager.delegate = locationDelegate

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the error "Variable 'self.locationDelegate' used before being initialized" on this line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for this, this init was created for tests, I did not notice an error when pushing, corrected :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Now it works just fine. And the solution to add the APPCLIP condition seems to work fine as well!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 😊

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I celebrated to early. Uploading to TestFlight now gives the same error as before. I guess the APPCLIP flag does not propagate down to the SPM frameworks :( Not sure how to solve it now. I guess I either have to clone and copy down the code for this framework and the FLAG will be respected, or just skip the framework for my AppClip target and loose all GPS functionality for my AppClip-target :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use cocoapods?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've given up on Cocoapods a long time ago. SPM only now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll think about how to solve your problem)

@tcobbs-bentley
Copy link

tcobbs-bentley commented Nov 2, 2022

@gre4ixin : This change leads to compile-time warnings for anyone using the library, since requestPermission(with:) itself calls the now deprecated requestAuthorizationAlways() and requestAuthorizationWhenInUse():

/<...>/SourcePackages/checkouts/AsyncLocationKit/Sources/AsyncLocationKit/AsyncLocationManager.swift:118:26: warning: 'requestAuthorizationAlways()' is deprecated: Use new function requestPermission(with:)
            return await requestAuthorizationAlways()
                         ^
/<...>/SourcePackages/checkouts/AsyncLocationKit/Sources/AsyncLocationKit/AsyncLocationManager.swift:121:26: warning: 'requestAuthorizationWhenInUse()' is deprecated: Use new function requestPermission(with:)
            return await requestAuthorizationWhenInUse()
                         ^

Note: Xcode is finicky about whether or not it shows warnings for Swift Packages that are used by an app. Sometimes it does (which is where the above two warnings came from), and sometimes it doesn't. I think this is an Xcode bug, but I'm not sure.

@gre4ixin
Copy link
Member Author

gre4ixin commented Nov 2, 2022

@tcobbs-bentley use 1.5.6 version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants