// Path: AccBeacons/app/src/main/java/com/accengage/samples/beacons/activities/MainActivity.java
// public class MainActivity extends Activity {
// 
//     private static final int LOCATION_REQUEST = 1;
// 
//     private RecyclerView mBeaconList;
//     private BeaconAdapter mBeaconAdapter;
//     private LinkedHashMap<String, Beacon> mBeacons = new LinkedHashMap<>();
// 
//     private BroadcastReceiver mReceiver = new BroadcastReceiver() {
// 
//         @Override
//         public void onReceive(Context context, Intent intent) {
//             Bundle payload = intent.getExtras();
//             if (payload == null) {
//                 return;
//             }
// 
//             Bundle beacons = payload.getBundle(Constants.EXTRA_BEACON_PAYLOAD);
//             if (beacons == null) {
//                 return;
//             }
// 
//             List<Beacon> beaconsList = fromBundle(beacons);
//             for (Beacon beacon : beaconsList) {
//                 mBeacons.put(beacon.getInternalId(), beacon);
//             }
//             mBeaconAdapter.notifyDataSetChanged();
//         }
// 
//         private List<Beacon> fromBundle(Bundle beaconsBundle) {
//             List<Beacon> beacons = new ArrayList<>();
//             Set<String> triggeredBeacons = beaconsBundle.keySet();
//             for (String beaconId : triggeredBeacons) {
//                 Bundle beaconDetails = beaconsBundle.getBundle(beaconId);
//                 if (beaconDetails != null) {
//                     beacons.add(Beacon.fromBundle(beaconDetails));
//                 }
//             }
//             return beacons;
//         }
//     };
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         A4S.get(this).setPushNotificationLocked(false);
//         setContentView(R.layout.activity_beacon);
// 
//         // Request location permission for beacons features
//         if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
//             ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST);
//         }
// 
//         mBeaconList = findViewById(R.id.listBeacons);
//         mBeaconList.setHasFixedSize(true);
//         mBeaconList.setLayoutManager(new LinearLayoutManager(this));
//         mBeaconList.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
//         mBeaconAdapter = new BeaconAdapter(mBeacons);
//         mBeaconList.setAdapter(mBeaconAdapter);
// 
//         findViewById(R.id.buttonClearBeacons).setOnClickListener(new View.OnClickListener() {
// 
//             @Override
//             public void onClick(View v) {
//                 mBeacons.clear();
//                 mBeaconAdapter.notifyDataSetChanged();
//             }
//         });
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         listenBeacons();
//     }
// 
//     @Override
//     protected void onPause() {
//         super.onPause();
//         unlistenBeacons();
//     }
// 
//     private void listenBeacons() {
//         IntentFilter filter = new IntentFilter(Constants.ACTION_TRIGGER);
//         filter.addCategory(Constants.CATEGORY_BEACON_NOTIFICATIONS);
//         registerReceiver(mReceiver, filter);
//     }
// 
//     private void unlistenBeacons() {
//         unregisterReceiver(mReceiver);
//     }
// 
// }


import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import com.accengage.samples.beacons.activities.MainActivity;
import com.ad4screen.sdk.Constants;
import java.util.Set;
package com.accengage.samples.beacons;




public class BeaconReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
// Path: AccBeacons/app/src/main/java/com/accengage/samples/beacons/activities/MainActivity.java
// public class MainActivity extends Activity {
// 
//     private static final int LOCATION_REQUEST = 1;
// 
//     private RecyclerView mBeaconList;
//     private BeaconAdapter mBeaconAdapter;
//     private LinkedHashMap<String, Beacon> mBeacons = new LinkedHashMap<>();
// 
//     private BroadcastReceiver mReceiver = new BroadcastReceiver() {
// 
//         @Override
//         public void onReceive(Context context, Intent intent) {
//             Bundle payload = intent.getExtras();
//             if (payload == null) {
//                 return;
//             }
// 
//             Bundle beacons = payload.getBundle(Constants.EXTRA_BEACON_PAYLOAD);
//             if (beacons == null) {
//                 return;
//             }
// 
//             List<Beacon> beaconsList = fromBundle(beacons);
//             for (Beacon beacon : beaconsList) {
//                 mBeacons.put(beacon.getInternalId(), beacon);
//             }
//             mBeaconAdapter.notifyDataSetChanged();
//         }
// 
//         private List<Beacon> fromBundle(Bundle beaconsBundle) {
//             List<Beacon> beacons = new ArrayList<>();
//             Set<String> triggeredBeacons = beaconsBundle.keySet();
//             for (String beaconId : triggeredBeacons) {
//                 Bundle beaconDetails = beaconsBundle.getBundle(beaconId);
//                 if (beaconDetails != null) {
//                     beacons.add(Beacon.fromBundle(beaconDetails));
//                 }
//             }
//             return beacons;
//         }
//     };
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         A4S.get(this).setPushNotificationLocked(false);
//         setContentView(R.layout.activity_beacon);
// 
//         // Request location permission for beacons features
//         if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
//             ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST);
//         }
// 
//         mBeaconList = findViewById(R.id.listBeacons);
//         mBeaconList.setHasFixedSize(true);
//         mBeaconList.setLayoutManager(new LinearLayoutManager(this));
//         mBeaconList.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
//         mBeaconAdapter = new BeaconAdapter(mBeacons);
//         mBeaconList.setAdapter(mBeaconAdapter);
// 
//         findViewById(R.id.buttonClearBeacons).setOnClickListener(new View.OnClickListener() {
// 
//             @Override
//             public void onClick(View v) {
//                 mBeacons.clear();
//                 mBeaconAdapter.notifyDataSetChanged();
//             }
//         });
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         listenBeacons();
//     }
// 
//     @Override
//     protected void onPause() {
//         super.onPause();
//         unlistenBeacons();
//     }
// 
//     private void listenBeacons() {
//         IntentFilter filter = new IntentFilter(Constants.ACTION_TRIGGER);
//         filter.addCategory(Constants.CATEGORY_BEACON_NOTIFICATIONS);
//         registerReceiver(mReceiver, filter);
//     }
// 
//     private void unlistenBeacons() {
//         unregisterReceiver(mReceiver);
//     }
// 
// }


// Path: AccBeacons/app/src/main/java/com/accengage/samples/beacons/BeaconReceiver.java
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import com.accengage.samples.beacons.activities.MainActivity;
import com.ad4screen.sdk.Constants;
import java.util.Set;

package com.accengage.samples.beacons;




public class BeaconReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Intent notifIntent = new Intent(context, MainActivity.class);