Any good documentation or articles out there about doing device-to-device data transfer?
Pretty non-technical, but their FAQ gives some information on the technology:
Q: How does Bump work?
A: There are two parts to Bump: the app running on your device and a smart matching algorithm running on our servers in the cloud. The app on your phone uses the phone's sensors to literally "feel" the bump, and it sends that info up to the cloud. The matching algorithm listens to the bumps from phones around the world and pairs up phones that felt the same bump. Then we just route information between the two phones in each pair.
Q: No way. What if somebody else bumps at the same time?
A: Way. We use various techniques to limit the pool of potential matches, including location information and characteristics of the bump event. If you are bumping in a particularly dense area (ex, at a conference), and we cannot resolve a unique match after a single bump, we'll just ask you to bump again. Our CTO has a PhD in Quantum Mechanics and can show the math behind that, but we suggest downloading Bump and trying it yourself!
Q: Why does Bump want to use my location?
A: We've got millions of users worldwide now. We use location information as one of the ways we limit the number of other phones we have to check to determine the correct match. Basically, if you are in Chicago, we use that info so we don't have to compare your bump with bumps coming in from Japan, Europe, New York, etc. For this reason, we require that location services be turned on and that users authorize the use of their location information. If you do not authorize use of location information, Bump won't work, sorry.
Q: Does Bump require that my Bluetooth is activated also?
A: Nope! Bump doesn't use Bluetooth to work at all; all you need is an Internet connection through wifi, 3G or Edge.
You may be confusing how Bump functions. My understanding is that accelerometer and geolocation data is used to identify candidate "bumps," or device pairs. The contact data, itself, is transferred over the Internet, not locally via Bluetooth or wifi.
Complete Example from https://github.com/bumptech/bump-api-ios
- (void) configureBump {
// userID is a string that you could use as the user's name, or an ID that is semantic within your environment
[BumpClient configureWithAPIKey:@"your_api_key" andUserID:[[UIDevice currentDevice] name]];
[[BumpClient sharedClient] setMatchBlock:^(BumpChannelID channel) {
NSLog(@"Matched with user: %@", [[BumpClient sharedClient] userIDForChannel:channel]);
[[BumpClient sharedClient] confirmMatch:YES onChannel:channel];
}];
[[BumpClient sharedClient] setChannelConfirmedBlock:^(BumpChannelID channel) {
NSLog(@"Channel with %@ confirmed.", [[BumpClient sharedClient] userIDForChannel:channel]);
[[BumpClient sharedClient] sendData:[[NSString stringWithFormat:@"Hello, world!"] dataUsingEncoding:NSUTF8StringEncoding]
toChannel:channel];
}];
[[BumpClient sharedClient] setDataReceivedBlock:^(BumpChannelID channel, NSData *data) {
NSLog(@"Data received from %@: %@",
[[BumpClient sharedClient] userIDForChannel:channel],
[NSString stringWithCString:[data bytes] encoding:NSUTF8StringEncoding]);
}];
// optional callback
[[BumpClient sharedClient] setConnectionStateChangedBlock:^(BOOL connected) {
if (connected) {
NSLog(@"Bump connected...");
} else {
NSLog(@"Bump disconnected...");
}
}];
// optional callback
[[BumpClient sharedClient] setBumpEventBlock:^(bump_event event) {
switch(event) {
case BUMP_EVENT_BUMP:
NSLog(@"Bump detected.");
break;
case BUMP_EVENT_NO_MATCH:
NSLog(@"No match.");
break;
}
}];
}
© 2022 - 2024 — McMap. All rights reserved.