multipeer-connectivity

Multipeer connectivity with one device having app running in background

你。 提交于 2019-12-04 16:32:01
I would like to connect 2 devices using multipeer connectivity framework where one of those devices is running the app in the background, just like Firechat does (I can't confirm this is working, I have installed it on an iPhone 5S and 4, but they just can't find each other - but I have read somewhere this works). What's the best way to achieve this? I'm using the following two methods from an example code: -(void)setupPeerAndSessionWithDisplayName:(NSString *)displayName{ _peerID = [[MCPeerID alloc] initWithDisplayName:displayName]; _session = [[MCSession alloc] initWithPeer:_peerID];

Multipeer Connectivity crash when inviting peer that stopped advertising

半腔热情 提交于 2019-12-04 13:10:57
I have the following scenario: Peer A is waiting for invitations in a custom UI (let's call it WaitingVC ). The MCNearbyServiceAdvertiser object is initialized at application start, and the advertising starts ( startAdvertisingPeer ) when the WaitingVC is presented. Peer B has the MCNearbyServiceBrowser up and running, also with custom UI (that is, not using the Apple provided MCBrowserViewController ). Peer B finds Peer A ( browser:foundPeer:withDiscoveryInfo: is called). Meanwhile Peer A chooses to close the WaitingVC . Advertising is stopped ( stopAdvertisingPeer ). There is a few seconds

Multipeer Connectivity Disconnect

﹥>﹥吖頭↗ 提交于 2019-12-04 11:01:00
问题 I'm having trouble with staying connected using the Multipeer Connectivity Framework in iOs7. Currently my app is programmatically handling the browsing and advertising using MCNearbyServiceAdvertiser and MCNearbyServiceBrowser. I have an alert view that asks the user if he is a browser or an advertiser. On the return from that view I instantiate either an MCNearbyServiceAdvertiser or Browser accordingly. #pragma - Alert Delegate -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:

Multipeer Connectivity framework for up to 45 devices

放肆的年华 提交于 2019-12-04 02:54:55
I hope to use the Multipeer Connectivity framework, and would appreciate any voices of experience on how best to proceed. I need a connection between a "coach" device and up to 45 "player" devices. They will all be in the same space, but no way to predict wifi availability or connection. The coach device needs to send an instruction (a small data packet) to all player devices each second. Each "player" needs to send a reading from a Bluetooth Heartrate monitor (very small data packet) back to the coach each second. Since the maximum peers per session is 8, would any of these ideas work to

Connect Browser & Advertiser without showing alert message in Multipeer connectivity

爷,独闯天下 提交于 2019-12-03 18:16:30
Currently i am exploring the multipeer connectivity framework.I have 2 option in my application Advertiser & Browser. So when user fire up the browser on one device, and the advertiser on another then they should be able to find each other. When the device appears in the browser, and the user taps on it, then the user with the advertising device will be presented with an alert allowing them to choose whether or not to make the connection. But i want when browser taps any particular advertiser it will automatically make connection without alert message. Note:- Currently i am using

multipeer connectivity test on iphone and a simulator simultaneously

微笑、不失礼 提交于 2019-12-03 11:32:53
Hello I was searching in all topics of the forum about how can i test an app which uses multipeer connectivity framework. Can someone tell me how can i test an app by using an iPhone device and a simulator simultaneously, player one for device and player two on the simulator and vice versa. I already test the app by using two simulators one per mac - user on a mac and its working but it is not convenient to continuously switch users to test an app. I tried all the alternatives, running once in simulator and one on device at the same time,make second target, nothing happened. Thanks in advance

Maintain a Multipeer Connectivity session in Background via BackgroundTask?

房东的猫 提交于 2019-12-03 10:04:09
问题 I am trying to maintain a MultipeerConnectivity "session" when the application enters temporarily in the background, so I thought about using a background task as I've seen few times here ... The problem is I have no idea how to "maintain" the session with the UIBackgroundTask, can someone please post a hint I don't care about the advertisers/browsers, it's okay to stop them, but I'd like the session to not disconnect as reconnecting is super buggy for the moment. 回答1: As per apple

Peer-to-peer network over wifi in iOS

放肆的年华 提交于 2019-12-03 08:40:46
问题 I've been at this for a few days now, and can't seem to find a solution. I want to create a peer to peer network over wifi on iOS. All open source code seems to be supporting running a server or being a client, but there's no code built to support being both - a peer. Is anybody aware of a way I can do this? 回答1: iOS 7 adds the Multipeer Connectivity Framework for exactly this purpose. 回答2: Have you thought of using Apple's GameKit framework? I've used it in the past for some simple

Creating a custom MCBrowserViewController

狂风中的少年 提交于 2019-12-03 08:31:59
Is there a way to create a UITableView housing the same information found in an MCBrowserViewController ? My current code only allows a standard view to be pushed that is not in the same design as my app: self.browserVC = [[MCBrowserViewController alloc] initWithServiceType:@"chat" session:self.mySession]; [self presentViewController:self.browserVC animated:YES completion:nil]; Any ideas? Thanks in advance! Set your View Controller as the delegate to MCNearbyServiceBrowser and MCSession (i.e. <MCNearbyServiceBrowserDelegate, MCSessionDelegate> ) Create a property for your

Maintain a Multipeer Connectivity session in Background via BackgroundTask?

安稳与你 提交于 2019-12-03 01:35:30
I am trying to maintain a MultipeerConnectivity "session" when the application enters temporarily in the background, so I thought about using a background task as I've seen few times here ... The problem is I have no idea how to "maintain" the session with the UIBackgroundTask, can someone please post a hint I don't care about the advertisers/browsers, it's okay to stop them, but I'd like the session to not disconnect as reconnecting is super buggy for the moment. Einho As per apple documentation "If the app moves into the background, the framework stops advertising and browsing and