Post

Replies

Boosts

Views

Activity

GameKit Unity Sample works in Editor but not Player
I've build the Apple Unity plugins and added them to my Unity project. I've also loaded up the Apple.GameKit 1.0.4 GameKit Demo Scene. When I run this scene in the Unity editor, I get the prompt to select my Game Center account, and the username appears in the Editor Game window UI. From here, the other on-screen buttons work as well, I can pull up the Game Center Achievements window or the Realtime Matchmaking UI. If I build this project for macOS, and run the resulting app on the Mac, it isn't working. On the game UI, the "Local Player Name" text never updates to show the username of my GameCenter account. None of the on screen buttons work, nothing happens when clicked. If I build from unity for macOS with debug on, I can attach a debugger while running the app. If I do this, and add breakpoints, it seems that the application hits the first line from the Start() function of GameKitSample.cs : _localPlayer = await GKLocalPlayer.Authenticate(); But execution never seems to get past this point. It also doesn't seem to throw any exception. It just gets stuck here and I can't use any Game Kit features in the sample scene. What is missing? The same code seems to interact with Game Center just fine while running from the Unity Editor.
0
0
850
Jul ’23
BLE Peripheral disconnects every 30 seconds
I am having an issue with CoreBluetooth on iOS. My app is serving as a central that connects to one physical bluetooth peripheral. I have no issues discovering, connecting, and reading data from the peripheral. The particular information I need is provided through a notification. I can begin recieving the info after setting the notify value:devicePeripheral.setNotifyValue(true, forCharacteristic: dataCharacteristic)I am also keeping a strong reference to my devicePeripheral after discovery and to the dataCharacteristic after the peripheral is connected and its characteristics have been discovered.After setting the notify value, I begin receiving the data at a frequent interval. For the app's purpose, I need to collect data from this notification for an extended period of time.The issue I am facing is that the peripheral is automatically disconnected exactly every 30 seconds, even while my notify value is set to true- so in the middle of reading data, I am suddenly forcibly disconnected exactly every 30 seconds. I have added code that upon disconnection, I rescan and reconnect, reset the notify value and carry on capturing data. The problem is that I need to capture data continuously without interruption, and that capture is being interrupted consistently every 30 seconds. This causes a gap of lost data.After exactly 30 seconds, "didDisconnectPeripheral" fires with the following error:Error Domain=CBErrorDomain Code=0 "Unknown error." UserInfo=0x174b6b90 {NSLocalizedDescription=Unknown error.}Can anyone offer any suggestions as to why this might be ocurring, and how I might resolve it?I have also developed an Android client that interacts with this same peripheral, and it does not suffer from the same issue- there is no 30 second disconnect on that platform, and I have no issues collecting data for an extended period of time. I have also tested connecting to my peripheral from OS X. I have not found the 30 second disconnect issue on OS X either- it appears that issue is isolated to iOS.I have tested with a iPhone 5 running iOS 8.4.1, and an iPhone 6S+ running iOS 9.2Thanks
7
0
9.5k
Jan ’16