Skip to content

Instantly share code, notes, and snippets.

@Suchiq
Last active November 9, 2019 18:13
Show Gist options
  • Save Suchiq/f234b8933e1fe4f1a76222ba6a8c848b to your computer and use it in GitHub Desktop.
Save Suchiq/f234b8933e1fe4f1a76222ba6a8c848b to your computer and use it in GitHub Desktop.
Send Payload Method
private void sendPayLoad(final String endPointId) {
Payload bytesPayload = Payload.fromBytes(String.valueOf(timestamp).getBytes());
Nearby.getConnectionsClient(BaseApplication.getInstance()
.getActivity()).sendPayload(endPointId, bytesPayload).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment