Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppClip doesn't support requestAlwaysAuthorization for Location #34

Open
Vicky-CTO opened this issue Aug 24, 2021 · 3 comments
Open

AppClip doesn't support requestAlwaysAuthorization for Location #34

Vicky-CTO opened this issue Aug 24, 2021 · 3 comments

Comments

@Vicky-CTO
Copy link

Issue

Appstore rejects the AppClip with Promisekit due to it's usage of requestAlwaysAuthorization in AuthorizationCatcher.

ITMS-90842: Invalid SDK usage - App clip 'AppClip.app' uses the SDK selector 'requestAlwaysAuthorization', which is not supported. Ensure your app clip is using supported SDK features.

Steps to Reproduce

Xcode: 12.5
Minimu iOS Version Supported: 12+
PromiseKit: 6.15.3
Cocoapods: 1.10.1

  1. Create an appclip target using the following steps.
  2. Add the AppClip target to Podfile and let it use the PromiseKit.
  3. Build and submit the app with AppClip to AppStore.
  4. You will receive the email with above issue ITMS-90842: Invalid SDK usage.

Recommended Fix

In initialiser of AuthorizationCatcher, update ask(type:) to use APPCLIP macro which needs to be defined for AppClip targets.

            switch type {
            case .always:
            #if os(tvOS) || APPCLIP
                fallthrough
            #else
                requestAlwaysAuthorization()
            #endif
            case .whenInUse:
                requestWhenInUseAuthorization()
            }
@Vicky-IAG
Copy link

Vicky-IAG commented Sep 27, 2021

@mxcl Apple doesn't provide one yet but their suggested approach is to use Active Compilation Condition build setting (for example, APPCLIP). Refer Use Active Compilation Conditions

My suggestion is to let the developers declare it in podfile for AppClip target in podfile.

post_install do |installer_representation|
  installer_representation.project.targets.each do |target|
    if target.name == "PromiseKit/CoreLocation"
      target.build_configurations.each do |config|
          config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] ||= ['$(inherited)', 'APPCLIP=1']
      end
    end
  end
end

@zeusent
Copy link

zeusent commented Dec 13, 2022

Any news about this being fixed?

@mxcl
Copy link
Member

mxcl commented Dec 14, 2022

The fix is waiting on someone like you @zeusent! Seems easy enough, but I am so out the loop in iOS dev I really cannot do it.

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

No branches or pull requests

4 participants