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

Lime 7.8.0 introduces Bluetooth dependencies on iOS that will cause app rejections #1429

Open
Continuities opened this issue Aug 30, 2020 · 7 comments

Comments

@Continuities
Copy link

Commit 43666e8 introduces a Bluetooth dependency on iOS that Apple really doesn't like. I don't use Bluetooth, but Apple rejected an app built with Lime 7.8.0 with the following statement:

We found that your app uses GameKit public APIs to change Bluetooth device settings.

GameKit APIs are provided to assist in the creation of social games. Using these APIs for other purposes, such as changing Bluetooth settings on a device, is not prescribed by Apple and is therefore not in compliance with the Apple Developer Program License Agreement, as required by the App Store Review Guidelines.

In particular, section 3.3.1 of the Apple Developer Program License Agreement specifies:

"Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs."

If there are no alternatives for providing the functionality your app requires, you can use Feedback Assistant to submit an enhancement request.

@player-03
Copy link
Contributor

I have approximately zero experience with Bluetooth and haven't interacted with Apple in years, but I wonder if the problem isn't specifically 43666e8, but rather something to do with native-toolkit. I say this because the Lime repo doesn't seem to directly interact with Bluetooth, whereas native-toolkit/sdl does.

From a quick glance at Apple's documentation, CoreBluetooth (which is referenced in 43666e8) doesn't appear to be related to GameKit, so it seems unlikely to be the cause of this error. In fact, neither Lime nor native-toolkit/sdl seem to reference GameKit at all.

My main problem here is that Apple's rejection notice is frustratingly useless. Are they talking about CoreBluetooth or something else? What functions are being called that shouldn't be? Where do we even begin to search for the problem?

Try getting in touch with their support team to find out more.

@Continuities
Copy link
Author

Continuities commented Aug 31, 2020 via email

@justin-espedal
Copy link
Contributor

This doesn't affect just publishing. In the right circumstances, it will even cause testing of the app to crash.

played with iOS 12-: works fine
played with iOS 13+:
	built with iOS 12 SDK (Xcode 10) or less: device will ask for permission to use bluetooth, app will keep playing after permission is determined regardless of whether it was granted
	built with iOS 13 SDK (Xcode 11) or greater:
		usage string is included: same as above, I'm guessing? device should ask for permission and everything should be ok
		no usage string is included:
			existing permission set on device: everything is ok
			no existing permission set on device: will immediately crash with privacy violation

In other words, just testing a new app using Xcode 11 and an iOS 13 or greater device will immediately crash.

The fix is pretty simple though. Just change one line in SDL (I've made a PR), and then remove the bluetooth dependency from lime.

native-toolkit/libsdl#15

@jgranick
Copy link
Member

jgranick commented Sep 29, 2020

Try out this commit and see if its working now

(make sure you git pull && git submodule update && lime rebuild ios -clean)

ba6fafe

@flashup
Copy link

flashup commented Oct 4, 2020

Hello, I faced the similar problem.

Compiling iOS project showed me following error on lime 7.8.0:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_CBCentralManager", referenced from:
      objc-class-ref in liblime.a(88920733_hid.o)
  "_OBJC_CLASS_$_CBUUID", referenced from:
      objc-class-ref in liblime.a(88920733_hid.o)
  "_CBAdvertisementDataLocalNameKey", referenced from:
      -[HIDBLEManager centralManager:didDiscoverPeripheral:advertisementData:RSSI:] in liblime.a(88920733_hid.o)
ld: symbol(s) not found for architecture arm64

I switched to the develop branch of lime and tried to recompile lime libs for iOS platform:
lime rebuild . ios -clean -v

And there is the error about a joystick:

Error: Error while running command
xcrun --sdk iphonesimulator14.0 clang++ -Ilib/sdl/include/ -Ilib/sdl/src/hidapi/hidapi/ -Ilib/sdl/include/configs/default/ -DHAVE_LIBC -D__IPHONEOS__ -fobjc-arc -c -O2 -fmessage-length=0 -pipe -Wno-trigraphs -fno-stack-protector -Wno-overflow -fpascal-strings -fasm-blocks -Wreturn-type -Wno-unused-variable -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk -miphoneos-version-min=5.0 -DIPHONE=IPHONE -DIPHONESIM=IPHONESIM -Wno-parentheses -Wno-null-dereference -Wno-unused-value -Wno-bool-conversion -DHXCPP_M64 -I/usr/local/lib/haxe/lib/hxcpp/4,1,15/include -fexceptions -fstrict-aliasing -x objective-c ./lib/sdl/src/joystick/iphoneos/SDL_sysjoystick.m -o/usr/local/lib/haxe/lib/lime/git/project/obj/iphonesim-c11/1a20c7a7_SDL_sysjoystick.o

In file included from ./lib/sdl/src/joystick/iphoneos/SDL_sysjoystick.m:47:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/GameController.framework/Headers/GameController.h:51:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDevice.h:30:1: error: property with 'retain (or strong)' attribute must be of object type
@property (nonatomic, strong) dispatch_queue_t handlerQueue API_AVAILABLE(macos(10.9), ios(7.0), tvos(7.0));
^
1 error generated.

@justin-espedal
Copy link
Contributor

I looked into flashup's error.

The import of GameController.h is from SDL. The code compiles fine with older versions of Xcode, but with Xcode 12, it breaks. This is because Xcode 12 includes the iOS 14 SDKs, which include GCDevice.h with the problematic line:

@property (nonatomic, strong) dispatch_queue_t [ ... ]

Apparently, dispatch_queue_t is only an NSObject beginning in iOS 6 (source).

HXCPP's iOS toolchains both specify the iOS deployment target to a hardcoded value of 5.0 (shows up as -miphoneos-version-min=5.0), hence the error.

Of course lime's native binaries can just be rebuilt with an earlier iOS SDK, and it'll still work on the newer iOS devices. This will need to be fixed eventually, but it's unrelated to the bluetooth issue here.

@CanIGetaPR
Copy link

Could we add a compiler flag that turns bluetooth support on and off for ios targets?

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

6 participants