Skip to content

Commit

Permalink
Merge branch 'master' of github.com:anchetaWern/BLE-Pusher-Attendance
Browse files Browse the repository at this point in the history
  • Loading branch information
anchetaWern committed Oct 11, 2017
2 parents 275358c + 3495eae commit 8caa80c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/index.android.js
Expand Up @@ -114,9 +114,9 @@ export default class pusherBLEAttendance extends Component {

var channel = pusher.subscribe('attendance-channel');
channel.bind('attendance-event', (data) => {
if(data.length > 1){
if(data.is_attendees){
this.setState({
attendees: data
attendees: data.attendees
});
}else{
ToastAndroid.show(`${data.full_name} just entered the room!`, ToastAndroid.LONG);
Expand Down
7 changes: 6 additions & 1 deletion server/attendance.js
Expand Up @@ -72,7 +72,12 @@ bleno.on('advertisingStart', function(error){
}
});


bleno.on('accept', function(clientAddress){
console.log('client address: ', clientAddress);
pusher.trigger('attendance-channel', 'attendance-event', attendees);
var data = {
is_attendees: true,
attendees: attendees
};
pusher.trigger('attendance-channel', 'attendance-event', data);
});

0 comments on commit 8caa80c

Please sign in to comment.