// 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/PushyGateway.java
// public class PushyGateway {
//     // Set custom heartbeat interval (in ms) for the underlying MQTT socket
//     public static int SOCKET_HEARTBEAT_INTERVAL = 60 * 3;
// 
//     // Pushy Topic ID 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;
//     }
// }


import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.red.alert.R;
import com.red.alert.config.Logging;
import com.red.alert.config.push.PushyGateway;
import com.red.alert.utils.caching.Singleton;
import me.pushy.sdk.Pushy;
package com.red.alert.logic.push;




public class PushyRegistration {
    public static void registerForPushNotifications(Context context) throws Exception {
        // Acquire a unique registration ID for this device
        String token = Pushy.register(context);

        // Log to logcat
        Log.d(Logging.TAG, "Pushy registration success: " + token);

        // Subscribe to global alerts topic (we need this for location alerts to work)
        Pushy.subscribe(PushyGateway.ALERTS_TOPIC, context);

        // Log it
// 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/PushyGateway.java
// public class PushyGateway {
//     // Set custom heartbeat interval (in ms) for the underlying MQTT socket
//     public static int SOCKET_HEARTBEAT_INTERVAL = 60 * 3;
// 
//     // Pushy Topic ID 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/logic/push/PushyRegistration.java
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.red.alert.R;
import com.red.alert.config.Logging;
import com.red.alert.config.push.PushyGateway;
import com.red.alert.utils.caching.Singleton;
import me.pushy.sdk.Pushy;

package com.red.alert.logic.push;




public class PushyRegistration {
    public static void registerForPushNotifications(Context context) throws Exception {
        // Acquire a unique registration ID for this device
        String token = Pushy.register(context);

        // Log to logcat
        Log.d(Logging.TAG, "Pushy registration success: " + token);

        // Subscribe to global alerts topic (we need this for location alerts to work)
        Pushy.subscribe(PushyGateway.ALERTS_TOPIC, context);

        // Log it
        Log.d(Logging.TAG, "Pushy subscribe success: " + PushyGateway.ALERTS_TOPIC);