I'm using GKSession (part of Game Kit) to connect multiple iOS devices together (over bluetooth and/or wifi), send data, etc which all works fine and I'm happy with it.
I was thinking though, it would be cool to have a Mac OS X app that could connect to the iOS devices as well, share data and so on.
GKSession sadly doesn't seem to be part of Game Kit for Mac OS X (10.8+ obviously). I was wondering is anybody knows of a way to do this or has any ideas.
Thanks again.
GameKit for Mac OSX uses game center over wifi to connect Macs, iPod Touches, iPads, and iPhones to each other through apple's game center servers.
Consult the GameKit Framework reference for Mac OSX for more on how to implement the classes
Related
I'm working on Ray Wenderlich's "How to make a Simple Playing Card Game with Multiplayer and Bluetooth."
That game can use Wifi when Bluetooth is unavailable.
If I open an iOS simulator on a computer and another iOS simulator on a different computer, will the iOS simulators be able to communicate over wifi?
I believe the answer is yes, since each iOS simulator can send/receive data over wifi. However, I wanted to check before I find another computer and install XCode on it.
I have turned my mac book pro into iBeacon using the project https://github.com/mttrb/BeaconOSX but unable to list the Mac device in iPhone using PheripheralManager / CBCentralManager after scan.
Could you please help me understand why the Mac Book is not listed?
Edit: I am using MacBook Pro with 10.9.1 Mac OS, my bluetooth version listed under system preference is LMP Version is 0x6
Thanks.
I would try known working programs on both the iOS and OSX Mavericks sides. On the iOS side, try our free Locate for iBeacon app as #sage444 suggests. If that does not detect your transmitter, try our MacBeacon app. It is $10, but we guarantee it will work with a BLE capable Mavericks computer or we will give you a refund.
One final thought, make sure you have the proper ProximityUUID from the BeaconOSX program in your region in your iOS program, or you will not see the beacon.
I think you should run Mavericks and have fresh mac book with BLE support, then get proper app to iPhone - search in app store for iBeacon
I'm working on an idea which requires my Mac to send some data to my iOS device. I know CoreBluetooth framework is not there for Mac OS and only for iOS, so is there any way that I can get my Mac to pose a peripheral ?
I've done some Googling around - haven't got a straight answer :(
The CoreBluetooth.Framework is there for OSX. It's embedded inside of the IOBluetooth.framework. Download the sample mac apps from the Apple Dev Site. The one difference is that the OSX version of the CoreBluetooth.Framework does not contain the CBPeripheralManager class. You should just have your iOS device act as the peripheral and the Mac as the central. The iOS device can act as both at the same time and data can be sent both ways.
If you are comfortable with writing JavaScript, you can use bleno. It is a node.js module for implementing BLE (Bluetooth Low Energy) peripherals, and it support Mac OS X 10.9 or later, Linux and Windows.
You can find an example for implementing a Battery Service in peripheral mode in their github repository:
https://github.com/sandeepmistry/bleno/tree/master/examples/battery-service
For a project, I have to send informations such as strings or ints from an iOS app (on iPhone 5) to a Mac OS X app (on a MacBook Pro), while both the iPhone and the MacBook Pro are in place without Wifi. The obvious solution is using Bluetooth. So the question is: Can I do that, and how?
You should use the CoreBluetooth framework.
For Mac: you'll need either a Macbook Air or Mac-mini
For iOS: you'll need an iPhone 4s, iPhone 5, iPad 3, iPad 4, or new iPod touch.
--A short overview:
You'll need to host both the CBCentralManager and the CBPeripheralManager on one device, and then host just the CBPeripheralManager on the other device.
The CBCentralManager is responsible for connecting and maintaining connections to external devices.
The CBPeripheralManager is responsible for writing and reading from those connections.
You can either send a write/read request or you can advertise a custom CBService that contains a CBCharacteristic with your string/int value.
Look at the header files and docs because there are tons of methods you need to adopt. There's also really good WWDC2012 videos that illustrate these methods in depth.
(However, if you want to use just a Macbook Pro, you'll need to use the standard IOBluetoothFramework on Mac and external accessory framework on iOS )
This project should help you with the iOS side of sharing strings over Bluetooth: SimpleShare
It lets you easily send and receive arrays of strings from your iOS device over Bluetooth LE. You'd just need to manage the CBCentralManager on the Mac.
My objective here is to create a connection between a device running iOS to a device running Mac OS X, via bluetooth. I know that I might be able to use CoreBluetooth for this but I don't understand how since I don't see a method to setup a service on the iOS device and broadcast it as an available service for a device running Mac OS X. In other words, I simply want to setup a connection to get the iOS device to send data to the Mac OS X device. Also, how would I go about to specify how to setup properties of the service. I've tried researching this stuff but most of the documentation makes little sense to me. The data transfer is small so bluetooth is good enough for the job. I'm trying to avoid Bonjour for this, and the Game center framework for P2P since OS X can't handle that (I think).
In iOS6 the iPhone 4S, 5 and New iPad can work both as Peripheral and as Central in Bluetooth Smart / Low Energy mode.
Try downloading "LightBlue" APP from APP Store. It let's you put the iPhone4S or 5 into Peripheral mode with random Services which you can then read from the Mac (if you have a newer one with BT Low Energy, I use the Retina for that but also the new iMac and Mac Mini got BT Low Energy).
You are correct that Core Bluetooth only give access to Bluetooth Low Energy which doesn't allow for the MFI chip.
Just ran across this today... and just wanted to give another answer to anyone needing to communicate to a non-Bluetooth LE device from your Mac.
The way to go is with IOBluetooth, and IOBluetoothUI.
They are both frameworks for the Mac, and they allow you to communicate with both old bluetooth, and Bluetooth LE 4.0, I believe. Also, I'm pretty positive you can act as a Central and Peripheral Device using this framework.