Skip to content

Commit

Permalink
Production version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
imtushardave committed Dec 7, 2020
1 parent a1e18a4 commit 5ac523f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.google.firebase.crashlytics'

android {
compileSdkVersion 29

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.android.material.snackbar.Snackbar;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
Expand All @@ -42,6 +43,7 @@ public class LoginActivity extends AppCompatActivity {
//Firebase Auth
private FirebaseAuth mAuth;
private GoogleSignInClient mGoogleSignInClient;
private FirebaseAnalytics mFirebaseAnalytics;

//Progress Dialog
private ProgressDialog progressDialog;
Expand All @@ -64,6 +66,8 @@ protected void onCreate(Bundle savedInstanceState) {
// Initialize Firebase Auth
mAuth = FirebaseAuth.getInstance();

mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);

setupGoogleSignInClient();

}
Expand Down Expand Up @@ -213,6 +217,10 @@ public void onSuccess(String token) {

FirebaseCloudMessagingService.addTokenToFirebase(token);

Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.METHOD, "google-sign-in");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.LOGIN, bundle);

Intent i = new Intent(LoginActivity.this, HomeActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ public void onCallback(boolean done) {

if(done){

Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.METHOD, "google-sign-in");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SIGN_UP, bundle);

mFirebaseAnalytics.setUserProperty("college_name", prefs.getCollegeName());
Intent i = new Intent(RegistrationActivity.this, HomeActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ private void init() {

rvBlockedChats = findViewById(R.id.rvBlockedChats);

btBack.setVisibility(View.GONE);

btBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.techknightsrtu.crosstalks.BuildConfig;
import com.techknightsrtu.crosstalks.R;
import com.techknightsrtu.crosstalks.app.SplashActivity;
Expand All @@ -37,6 +38,8 @@ public class ProfileActivity extends AppCompatActivity {

private boolean isUpdateAvailable = false;

private FirebaseAnalytics mFirebaseAnalytics;

// Widgets
private ImageView ivBack, ivUserAvatar;
private ImageView ivUpdateIndicator;
Expand All @@ -57,6 +60,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);

mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);

init();

// For Loading Ads
Expand Down Expand Up @@ -122,6 +127,11 @@ public void onClick(View view) {
String shareMessage= "\nBored in this Quarantine ??? Let's have some fun, Download CrossTalks and chat with your mates anonymously. \n\n";
shareMessage = shareMessage + "https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID +"\n\n";
shareIntent.putExtra(Intent.EXTRA_TEXT, shareMessage);

Bundle bundle = new Bundle();
bundle.putString("Invite", "done");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SHARE, bundle);

startActivity(Intent.createChooser(shareIntent, "Invite your friends"));
} catch(Exception e) {
//e.toString();
Expand Down

0 comments on commit 5ac523f

Please sign in to comment.