Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
MULTIPEER CONNECTIVITY
YO, WANNA TALK?
1
MULTIPEER CONNECTIVITY
PLAN
▸ Pourquoi?
▸ Comment?
▸ Quoi?
2
MULTIPEER CONNECTIVITY
POURQUOI?
▸ Mobilité accrue
▸ Hétérogénéité des accès plutôt que des méthodes
▸ Zéro configuration
3
MULTIPEER CONNECTIVITY
BT Advertisement / Discovery
Data Exchange
Get Ad-hoc WiFi Settings & connect Setup Ad-hoc WiFi Net...
MULTIPEER CONNECTIVITY
QUOI?
▸ Réseau
▸ MCAdvertiserAssistant
▸ MCNearbyServiceAdvertiser /
MCNearbyServiceBrowser
▸ Peers...
MULTIPEER CONNECTIVITY
CAVEATS
▸ Limitations réseau (évidemment) : portée, débit, etc
▸ Une session contient au plus 8 par...
MULTIPEER CONNECTIVITY
CRÉER / REJOINDRE UNE SESSION
▸ Service Type (NSString)
▸ Peer Display Name (NSString)
▸ MCNearbySe...
static NSString * const AppServiceType = @“chat-service";
NSString *dName = [[UIDevice currentDevice] name];
MCPeerID *loc...
MCNearbyServiceAdvertiser
*advertiser = [[MCNearbyServiceAdvertiser alloc]
initWithPeer:localPeerID
discoveryInfo:nil
serv...
- (void) advertiser:(MCNearbyServiceAdvertiser *)advertiser
didReceiveInvitationFromPeer:(MCPeerID *)peerID
withContext:(N...
MCNearbyServiceBrowser
*browser = [[MCNearbyServiceBrowser alloc]
initWithPeer:localPeerID
serviceType:AppServiceType];
br...
// optional GUI
MCBrowserViewController *browserViewController =
[[MCBrowserViewController alloc]
initWithBrowser:browser
...
MULTIPEER CONNECTIVITY
MCSESSION IS LIVE!
▸ Message == NSData
▸ Blobs
▸ NSSecureCoding Objects
▸ Contenu d’une ressource p...
MULTIPEER CONNECTIVITY
DEMO
14
MULTIPEER CONNECTIVITY
QUESTIONS?
15
You’ve finished this document.
Download and read it offline.
Upcoming SlideShare
Apple Search Optimization
Next
Upcoming SlideShare
Apple Search Optimization
Next
Download to read offline and view in fullscreen.

0

Share

MultiPeer Connectivity Framework

Download to read offline

MultiPeer Connectivity Framework par Nicolas Zinovieff. Technologie Apple permettant de faire de la discussion peer-to-peer entre devices.

Demo Github Project : https://github.com/krugazor/MCChat

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

MultiPeer Connectivity Framework

  1. 1. MULTIPEER CONNECTIVITY YO, WANNA TALK? 1
  2. 2. MULTIPEER CONNECTIVITY PLAN ▸ Pourquoi? ▸ Comment? ▸ Quoi? 2
  3. 3. MULTIPEER CONNECTIVITY POURQUOI? ▸ Mobilité accrue ▸ Hétérogénéité des accès plutôt que des méthodes ▸ Zéro configuration 3
  4. 4. MULTIPEER CONNECTIVITY BT Advertisement / Discovery Data Exchange Get Ad-hoc WiFi Settings & connect Setup Ad-hoc WiFi Network Create Session Join Session Session Data Exchange COMMENT? ▸ “Discovery” Bluetooth ▸ Débit et stabilité WiFi ▸ Zéroconf / Bonjour 4
  5. 5. MULTIPEER CONNECTIVITY QUOI? ▸ Réseau ▸ MCAdvertiserAssistant ▸ MCNearbyServiceAdvertiser / MCNearbyServiceBrowser ▸ Peers ▸ MCSession ▸ MCPeerID 5
  6. 6. MULTIPEER CONNECTIVITY CAVEATS ▸ Limitations réseau (évidemment) : portée, débit, etc ▸ Une session contient au plus 8 participants ▸ Peu de fonctions avancées ▸ Mac - iPhone - iPad - Watch - TV 6
  7. 7. MULTIPEER CONNECTIVITY CRÉER / REJOINDRE UNE SESSION ▸ Service Type (NSString) ▸ Peer Display Name (NSString) ▸ MCNearbyServiceAdvertiser -> MCSession ▸ MCNearbyServiceBrowser -> MCSession 7
  8. 8. static NSString * const AppServiceType = @“chat-service"; NSString *dName = [[UIDevice currentDevice] name]; MCPeerID *localPeerID = [[MCPeerID alloc] initWithDisplayName:dName]; Service Type & Local Peer MULTIPEER CONNECTIVITY 8
  9. 9. MCNearbyServiceAdvertiser *advertiser = [[MCNearbyServiceAdvertiser alloc] initWithPeer:localPeerID discoveryInfo:nil serviceType:AppServiceType];
 advertiser.delegate = self; [advertiser startAdvertisingPeer]; Advertising MULTIPEER CONNECTIVITY 9
  10. 10. - (void) advertiser:(MCNearbyServiceAdvertiser *)advertiser didReceiveInvitationFromPeer:(MCPeerID *)peerID withContext:(NSData *)context invitationHandler: (void(^)(BOOL accept, MCSession *session))invitationHandler { if(self.session == nil) {
 self.session = [[MCSession alloc] initWithPeer:localPeerID securityIdentity:nil encryptionPreference:MCEncryptionNone]; } invitationHandler(YES, self.session); } Advertising Attack of The Clones MULTIPEER CONNECTIVITY 10
  11. 11. MCNearbyServiceBrowser *browser = [[MCNearbyServiceBrowser alloc] initWithPeer:localPeerID serviceType:AppServiceType]; browser.delegate = self; Discovery MULTIPEER CONNECTIVITY 11
  12. 12. // optional GUI MCBrowserViewController *browserViewController = [[MCBrowserViewController alloc] initWithBrowser:browser session:session]; browserViewController.delegate = self; [self presentViewController:browserViewController animated:YES completion: ^{ [browser startBrowsingForPeers]; }]; Discovery Harder MULTIPEER CONNECTIVITY 12
  13. 13. MULTIPEER CONNECTIVITY MCSESSION IS LIVE! ▸ Message == NSData ▸ Blobs ▸ NSSecureCoding Objects ▸ Contenu d’une ressource par une NSURL (file ou http) ▸ NSInputStream/NSOutputStream (ouep) 13
  14. 14. MULTIPEER CONNECTIVITY DEMO 14
  15. 15. MULTIPEER CONNECTIVITY QUESTIONS? 15

MultiPeer Connectivity Framework par Nicolas Zinovieff. Technologie Apple permettant de faire de la discussion peer-to-peer entre devices. Demo Github Project : https://github.com/krugazor/MCChat

Views

Total views

4,917

On Slideshare

0

From embeds

0

Number of embeds

4,005

Actions

Downloads

4

Shares

0

Comments

0

Likes

0

×