0

My app uses appStoreOverlay to show recommended app, but error occurs when submit to app store.

ITMS-90863: Apple silicon Macs support issue - The app uses symbols that are not present on Mac:
/System/Library/Frameworks/_StoreKit_SwiftUI.framework/_StoreKit_SwiftUI
_$s7SwiftUI4ViewP010_StoreKit_aB0F03appD7Overlay11isPresented13configurationQrAB7BindingVySbG_So22SKOverlayConfigurationCyctRQOMQ

I think SKOverlay.AppConfiguration is not present on silicon Mac. According to 'Building a Universal macOS Binary', I add some macro and the code run in iOS only, but error still exist. Any suggestions?

#if !targetEnvironment(macCatalyst) && os(iOS)
Button(action: { showRecommendedApp.toggle() }) { Text("App recommended".localized)  
    .appStoreOverlay(isPresented: $showRecommendedApp) {
        SKOverlay.AppConfiguration(appIdentifier: "12345", position: .bottom)
    }
#endif
foolbear
  • 726
  • 1
  • 7
  • 19

1 Answers1

1

M1 Macs can run iOS binaries directly, they don't need a Mac Catalyst build.

You can't use a #if to test for M1 at compile time since it is the same binary running on iOS and M1 Macs.

You can use a run time check of isiOSAppOnMac.

if !ProcessInfo.processInfo.isiOSAppOnMac {
    Button ...
}

You will still get the warning but you know that it will be handled correctly at runtime.

Paulw11
  • 108,386
  • 14
  • 159
  • 186
  • If the warning still exist, the app will not present in mac app store(price in connect), right? if yes, how to fix? – foolbear Feb 22 '21 at 06:17
  • I believe that the warning is just that - a warning that things may not work correctly on Mac. I don't believe that it prevents the app from appearing in the Mac app store – Paulw11 Feb 22 '21 at 21:56
  • I don't know, I don't have a silicon mac to test it. but it's the fact in the price section of connect site. – foolbear Feb 23 '21 at 04:48
  • Don't think this will work. ProcessInfo.processInfo.isiOSAppOnMac is runtime, but the program already crash when build/run on Xcode. Needs something to filter these off. – Lim Thye Chean May 11 '21 at 08:34