Skip to content

Commit

Permalink
Merge pull request #51 from ACM-student-chapter-UOM/bluetooth-ID
Browse files Browse the repository at this point in the history
Bluetooth-ID
  • Loading branch information
PrimeshShamilka authored May 27, 2020
2 parents 36a96de + 0097235 commit 2934db7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void onFailure(@NonNull Exception e) {
public void onCreteUser(String id){
Map<String, Object> data = new HashMap<>();
data.put("bluetooth id",id);
firebaseUser = FirebaseAuth.getInstance().getCurrentUser();

db.collection("users")
.document(firebaseUser.getUid())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.widget.Toast;

import com.example.acmcovidapplication.db.DatabaseHelper;
import com.example.acmcovidapplication.db.FirebaseHelper;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskExecutors;
Expand All @@ -26,6 +27,8 @@
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import static com.example.acmcovidapplication.Util.generateHash;


public class otp_entering extends AppCompatActivity {
private EditText code_1;
Expand All @@ -38,6 +41,7 @@ public class otp_entering extends AppCompatActivity {
private String verificationId;
private FirebaseAuth mAuth;
PhoneAuthProvider.ForceResendingToken token;
FirebaseHelper firebasehelper = new FirebaseHelper();

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -189,9 +193,10 @@ public void onComplete(@NonNull Task<AuthResult> task) {
Intent intent = new Intent(otp_entering.this, appPermission.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
String userId = Util.generateHash(phoneNumber,otp_entering.this);
String userId = generateHash(phoneNumber,otp_entering.this);
Context context = otp_entering.this;
DatabaseHelper.getInstance(otp_entering.this).insertUserId(userId);
firebasehelper.onCreteUser(generateHash(phoneNumber,otp_entering.this));
} else {
Toast.makeText(otp_entering.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();
}
Expand Down

0 comments on commit 2934db7

Please sign in to comment.