Skip to content

Commit

Permalink
working_fine
Browse files Browse the repository at this point in the history
  • Loading branch information
banditAmit committed Oct 16, 2023
1 parent 8546617 commit a9bcea3
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions app/src/main/java/com/BugBazaar/ui/NavigationDrawer_Dashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;

import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
Expand All @@ -25,6 +26,8 @@
import com.BugBazaar.ui.cart.CartItem;
import com.BugBazaar.ui.cart.NotificationHelper;
import com.BugBazaar.ui.myorders.OrderHistoryActivity;
import com.BugBazaar.utils.AppInitializationManager;
import com.BugBazaar.utils.CustomDialog;
import com.google.android.material.navigation.NavigationView;

import java.util.ArrayList;
Expand All @@ -43,21 +46,14 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_navigation_drawer_dashboard);

Intent getLink = getIntent();
Uri data = getLink.getData();
if (AppInitializationManager.isFirstRun(this)) {
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,new Intent(),0);

if (data != null) {
String scheme = data.getScheme(); // Get the scheme (should be "bb")
String host = data.getHost(); // Get the host (should be "bugbazaar.com")
String path = data.getPath(); // Get the path (should be "/dashboard")

// Check if the deep link matches the expected values
if ("bb".equals(scheme) && "bugbazaar.com".equals(host) && "/dashboard".equals(path)) {
// Handle the deep link here, e.g., open the dashboard or perform other actions.
// You can also extract additional data from the deep link if needed.
}
// This is the first run, show your notification
AppInitializationManager.showNotification(this);
CustomDialog.showCustomDialog(this, " \uD83C\uDF89 Congratulations \uD83C\uDF89", "You've received a Rs 200 voucher.Login to Redeem",pendingIntent);
AppInitializationManager.markFirstRunDone(this);
}

// Rest of your activity initialization code

// Hide the keyboard and clear focus from the EditText
Expand Down

0 comments on commit a9bcea3

Please sign in to comment.