使用蓝牙在其他iOS设备上拍照

如果有iOS蓝牙经验的人可以告诉我如何使用蓝牙类在其他iOS设备上拍照,我将不胜感激。 这个应用程序允许用户登录/注册,然后采取和上传图片。 http://www.raywenderlich.com/13511/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-12我的目标是,点击用户照片在apps uiscrollview(显示所有上传的照片)中,激活下面的AVFoundation的snapStillImage方法。

 //this code takes a picture - (void)snapStillImage //this takes a picture via [self snapStillImage] in viewDidLoad { dispatch_async([self sessionQueue], ^{ // Update the orientation on the still image output video connection before capturing. [[[self stillImageOutput] connectionWithMediaType:AVMediaTypeVideo] setVideoOrientation:[[(AVCaptureVideoPreviewLayer *)[[self previewView] layer] connection] videoOrientation]]; // Flash set to Auto for Still Capture [ViewController5 setFlashMode:AVCaptureFlashModeAuto forDevice:[[self videoDeviceInput] device]]; // Capture a still image. [[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:[[self stillImageOutput] connectionWithMediaType:AVMediaTypeVideo] completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) { if (imageDataSampleBuffer) { NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer]; photo.image = [[UIImage alloc] initWithData:imageData]; [[[ALAssetsLibrary alloc] init] writeImageToSavedPhotosAlbum:[photo.image CGImage] orientation:(ALAssetOrientation)[photo.image imageOrientation] completionBlock:nil]; [self uploadPhoto]; } }]; }); } 

我想每个用户在登录时都需要成为中心/外围设备? 我有在iOS上设置BLE的经验,更不用说配备服务器function了。 任何想法或提示都会很棒。

您应该看看iOS7 + MultipeerConnectivity Framework ,它允许附近的设备相互通信。 这很容易通过这个框架从一个设备发送消息到(一个)其他设备,包装到NSData变量中。

这个框架很容易设置,但不要犹豫,看看GitHub搜索结果 。