// Path: app/src/main/java/com/red/alert/config/Logging.java
// public class Logging {
//     // Tag for all logcat logs
//     public static String TAG = "RedAlert";
// }
// 
// Path: app/src/main/java/com/red/alert/config/push/FCMGateway.java
// public class FCMGateway {
//     // FCM Sender ID
//     public static String SENDER_ID = "23150228579";
// 
//     // FCM Scope
//     public static String SCOPE = "*";
// 
//     // FCM Topic Name for PubSub push notifications
//     public static String ALERTS_TOPIC = "alerts";
// }
// 
// Path: app/src/main/java/com/red/alert/utils/caching/Singleton.java
// public class Singleton {
//     static ObjectMapper mMapper;
//     static SharedPreferences mSettings;
// 
//     public static SharedPreferences getSharedPreferences(Context context) {
//         // First time?
//         if (mSettings == null) {
//             // Open shared preferences
//             mSettings = PreferenceManager.getDefaultSharedPreferences(context);
//         }
// 
//         // Return cached object
//         return mSettings;
//     }
// 
//     public static ObjectMapper getJackson() {
//         // First time?
//         if (mMapper == null) {
//             // Get Jackson instance
//             mMapper = new ObjectMapper();
// 
//             // Ignore unknown properties
//             mMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//         }
// 
//         // Return cached object
//         return mMapper;
//     }
// }
// 
// Path: app/src/main/java/com/red/alert/utils/integration/GooglePlayServices.java
// public class GooglePlayServices {
//     public static boolean isAvailable(Context context) {
//         // Get availability checker
//         GoogleApiAvailability playServices = GoogleApiAvailability.getInstance();
// 
//         // Check whether services are available
//         int result = playServices.isGooglePlayServicesAvailable(context);
// 
//         // Are we good?
//         return result == ConnectionResult.SUCCESS;
//     }
// }


import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.messaging.FirebaseMessaging;
import com.red.alert.R;
import com.red.alert.config.Logging;
import com.red.alert.config.push.FCMGateway;
import com.red.alert.utils.caching.Singleton;
import com.red.alert.utils.integration.GooglePlayServices;
import androidx.annotation.NonNull;
package com.red.alert.logic.push;




public class FCMRegistration {
    public static String registerForPushNotifications(final Context context) throws Exception {
        // Make sure we have Google Play Services
        if (!GooglePlayServices.isAvailable(context)) {
            // Throw exception
// Path: app/src/main/java/com/red/alert/config/Logging.java
// public class Logging {
//     // Tag for all logcat logs
//     public static String TAG = "RedAlert";
// }
// 
// Path: app/src/main/java/com/red/alert/config/push/FCMGateway.java
// public class FCMGateway {
//     // FCM Sender ID
//     public static String SENDER_ID = "23150228579";
// 
//     // FCM Scope
//     public static String SCOPE = "*";
// 
//     // FCM Topic Name for PubSub push notifications
//     public static String ALERTS_TOPIC = "alerts";
// }
// 
// Path: app/src/main/java/com/red/alert/utils/caching/Singleton.java
// public class Singleton {
//     static ObjectMapper mMapper;
//     static SharedPreferences mSettings;
// 
//     public static SharedPreferences getSharedPreferences(Context context) {
//         // First time?
//         if (mSettings == null) {
//             // Open shared preferences
//             mSettings = PreferenceManager.getDefaultSharedPreferences(context);
//         }
// 
//         // Return cached object
//         return mSettings;
//     }
// 
//     public static ObjectMapper getJackson() {
//         // First time?
//         if (mMapper == null) {
//             // Get Jackson instance
//             mMapper = new ObjectMapper();
// 
//             // Ignore unknown properties
//             mMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//         }
// 
//         // Return cached object
//         return mMapper;
//     }
// }
// 
// Path: app/src/main/java/com/red/alert/utils/integration/GooglePlayServices.java
// public class GooglePlayServices {
//     public static boolean isAvailable(Context context) {
//         // Get availability checker
//         GoogleApiAvailability playServices = GoogleApiAvailability.getInstance();
// 
//         // Check whether services are available
//         int result = playServices.isGooglePlayServicesAvailable(context);
// 
//         // Are we good?
//         return result == ConnectionResult.SUCCESS;
//     }
// }


// Path: app/src/main/java/com/red/alert/logic/push/FCMRegistration.java
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.messaging.FirebaseMessaging;
import com.red.alert.R;
import com.red.alert.config.Logging;
import com.red.alert.config.push.FCMGateway;
import com.red.alert.utils.caching.Singleton;
import com.red.alert.utils.integration.GooglePlayServices;
import androidx.annotation.NonNull;

package com.red.alert.logic.push;




public class FCMRegistration {
    public static String registerForPushNotifications(final Context context) throws Exception {
        // Make sure we have Google Play Services
        if (!GooglePlayServices.isAvailable(context)) {
            // Throw exception
            throw new Exception(context.getString(R.string.noGooglePlayServices));