IOS & Bluetooth

Hi,
with lime 7.8.0 my ios app crashes at the start with:

his app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSBluetoothAlwaysUsageDescription key with a string value explaining to the user how the app uses this data.

I’m not using bluetooth and i don’t want to use it :thinking:

Try something like this in your [APP]-Info.plist

<key>NSBluetoothAlwaysUsageDescription</key>
<string>$(PRODUCT_NAME) Bluetooth use</string>

That helps to prevent the crash, but the user is still asked if the app is allowed to use bluetooh. Which should not be the case for a game app :confused:

Well, if it happens it’s because your app is actually using bluetooth. Most probably it’s a third party library you’re pulling in

I will have a look, but i did not change any lib, it was working before and stopped working after updating lime and haxelib

Looks like it came in here: https://github.com/haxelime/lime/commit/43666e816d3fd5840dc0858aae420f940e30d4e9

Possible a fix after the SDL update? @singmajesty could you give us a hint?

But am i the only one with this problem? :thinking:

I’m still with Lime 7.7.0, so can’t say, if I have this problem.
Can you just switch back?

I’ve run into this too. I’m not using Bluetooth, but the iOS build injects the dependency anyway. It’s causing me trouble in app review. I’m going to try building with lime 7.7.0 instead, but I’m still really curious as to why the dependency was added in 7.8.0, and if it’ll stick around in future versions.

FYI, Apple is going to reject anything built with Lime 7.8.0:

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.

1 Like

Any updates with this issue or we should continue using lime 7.7.0?

This issue has also been reported on github, so you can follow it there to see when it’s resolved.

If you want to use Lime 7.8.0 today, you can fix this on your side pretty easily.

  1. Make sure you’re using Lime from git so you have all the native dependency sources.
  2. Change the SDL configuration to remove the feature that requires bluetooth.
    https://github.com/native-toolkit/sdl/pull/15/files
  3. haxelib run lime rebuild ios -release
  4. Remove the line in Lime’s include.xml that adds CoreBluetooth.framework as a dependency.
    https://github.com/Stencyl/lime/commit/71f0b04b1b40a07125802059a69a67ab8b64318d
2 Likes

Please test the latest version of Lime:

git pull
git submodule update
lime rebuild ios -clean

I wasn’t able to rebuild lime, got the following error:

Error: In file included from ./lib/sdl/src/joystick/iphoneos/SDL_sysjoystick.m:47:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk/System/Library/Frameworks/GameController.framework/Headers/GameController.h:51:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.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));

Any solution?

Yes, see the comments on the github issue I posted. You either need to build with an Xcode version older than 12, or change the hardcoded iOS target in the hxcpp toolchain files to 6 instead of 5.

iOS target definitions in hxcpp toolchain files:


Thanks a lot Justin!
I’m using xcode 12.2 and changing ios target from 5 to 6 did the trick for me.