content: package com.banrossyn.socialsaver.util;
  
  import android.app.Activity;
  import android.app.Application;
  import android.content.pm.ActivityInfo;
  import android.os.Bundle;
  
  import androidx.annotation.NonNull;
  
  import com.google.firebase.messaging.FirebaseMessaging;
  import com.onesignal.Continue;
  import com.onesignal.OneSignal;
  import com.onesignal.debug.LogLevel;
  
  
  public class MyApplication extends Application {
  
      private static final String ONESIGNAL_APP_ID = "571ba96f-b5bf-4de6-8efe-c577d23cefca";
      @Override
      public void onCreate() {
          super.onCreate();
  
          FirebaseMessaging.getInstance().subscribeToTopic("all");
  
  // Verbose Logging set to help debug issues, remove before releasing your app.
          OneSignal.getDebug().setLogLevel(LogLevel.VERBOSE);
  
          // OneSignal Initialization
          OneSignal.initWithContext(this, ONESIGNAL_APP_ID);
  
          // requestPermission will show the native Android notification permission prompt.
          // NOTE: It's recommended to use a OneSignal In-App Message to prompt instead.
          OneSignal.getNotifications().requestPermission(true, Continue.with(r -> {
              if (r.isSuccess()) {
                  if (r.getData()) {
                      // `requestPermission` completed successfully and the user has accepted permission
                  }
                  else {
                      // `requestPermission` completed successfully but the user has rejected permission
                  }
              }
              else {
                  // `requestPermission` completed unsuccessfully, check `r.getThrowable()` for more info on the failure reason
              }
          }));
  
          registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
              @Override
              public void onActivityCreated(Activity a, Bundle savedInstanceState) {
                  a.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
              }
  
              @Override
              public void onActivityStarted(@NonNull Activity activity) {
  
              }
  
              @Override
              public void onActivityResumed(@NonNull Activity activity) {
  
              }
  
              @Override
              public void onActivityPaused(@NonNull Activity activity) {
  
              }
  
              @Override
              public void onActivityStopped(@NonNull Activity activity) {
  
              }
  
              @Override
              public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {
  
              }
  
              @Override
              public void onActivityDestroyed(@NonNull Activity activity) {
  
              }
          });
  
      }
  
  }
  