tutorial programming app ios bluetooth core-bluetooth

programming - Toma fotos en otros dispositivos con iOS usando bluetooth



xcode bluetooth explorer (1)

Agradecería que alguien con experiencia en iOS con Bluetooth pudiera mostrarme cómo tomar fotos en otros dispositivos iOS usando clases bluetooth. Esta aplicación permite a los usuarios iniciar sesión / registrarse y luego tomar y subir fotos. http://www.raywenderlich.com/13511/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-12 Mi objetivo es hacer clic en una foto de usuario en la aplicación uiscrollview (que muestra todas las fotos cargadas), active el método snapStillImage de AVFoundation a continuación.

//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]; } }]; }); }

¿Imagino que cada usuario necesitaría convertirse en central / periférico al iniciar sesión? Tengo 0 experiencia con la configuración de BLE en iOS y menos equipado con funciones de servidor. Cualquier idea o sugerencia sería increíble.


Debería echarle un vistazo al iOS7 + MultipeerConnectivity Framework , que permite que los dispositivos cercanos se comuniquen entre ellos. Esto es fácil de enviar mensajes desde un dispositivo a (otro) dispositivo (s) a través de este marco, envuelto en una variable NSData .

Este marco es realmente fácil de configurar, pero no dude en echar un vistazo a los resultados de búsqueda de GitHub .