This commit is contained in:
14Sandee
2023-11-21 21:12:01 +05:30
parent a45cca120d
commit c9964bba14

View File

@@ -1,5 +1,6 @@
package com.app.simplitend.apputils;
import static com.app.simplitend.apputils.AppUtil.NOTIFICATION_ACTION;
import static com.app.simplitend.patientgeofencing.GeoFenceHelper.GEOFENCE_ID;
import static com.app.simplitend.patientgeofencing.GeoFenceHelper.GEOFENCE_TAG;
@@ -9,7 +10,9 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.provider.Settings;
import android.util.Log;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresPermission;
@@ -57,13 +60,24 @@ public class NotificationService implements INotificationServiceExtension {
}
}
Intent intent = new Intent(AppUtil.NOTIFICATION_ACTION);
Intent intent = new Intent(iNotificationReceivedEvent.getContext(), BottomNotificationActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(NOTIFICATION_ACTION);
intent.putExtra(CONTENT_TYPE_KEY, content_type);
intent.putExtra(NOTIFICATION_BODY_KEY, iNotificationReceivedEvent.getNotification().getBody());
intent.putExtra(NOTIFICATION_TITLE_KEY, iNotificationReceivedEvent.getNotification().getTitle());
intent.putExtra(NOTIFICATION_CONTENT_ID_KEY, id);
intent.putExtra(NOTIFICATION_SENIOR_ADDRESS_KEY, senior_current_address);
try {
if (AppUtil.getCgToken(iNotificationReceivedEvent.getContext()) != null){
// only if caregiver is logged in
iNotificationReceivedEvent.getContext().startActivity(intent);
}
} catch (Exception e) {
// do nothing
}
iNotificationReceivedEvent.getContext().sendBroadcast(intent);
if (Constants.GEOFENCING_RADIUS_ADDED.equals(content_type)