congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
AppBackgroundMonitor.inBackground
Code IndexAdd Tabnine to your IDE (free)

How to use
inBackground
method
in
co.chatsdk.core.utils.AppBackgroundMonitor

Best Java code snippets using co.chatsdk.core.utils.AppBackgroundMonitor.inBackground (Showing top 2 results out of 315)

origin: chat-sdk/chat-sdk-android

if (ChatSDK.auth() == null || !ChatSDK.auth().userAuthenticatedThisSession() || ChatSDK.config().backgroundPushTestModeEnabled) {
  appIntent = new Intent(context, ChatSDK.ui().getLoginActivity());
} else if (AppBackgroundMonitor.shared().inBackground() && ChatSDK.auth().userAuthenticatedThisSession()) {
  appIntent = new Intent(context, ChatSDK.ui().getChatActivity());
origin: chat-sdk/chat-sdk-android

public void handleLocalNotifications () {
  if (localNotificationDisposable != null) {
    localNotificationDisposable.dispose();
  }
  // TODO: Check this
  localNotificationDisposable = ChatSDK.events().sourceOnMain()
      .filter(NetworkEvent.filterType(EventType.MessageAdded))
      .subscribe(networkEvent -> {
        Message message = networkEvent.message;
        Thread thread = networkEvent.thread;
        if(message != null && !AppBackgroundMonitor.shared().inBackground()) {
          if (thread.typeIs(ThreadType.Private) || (thread.typeIs(ThreadType.Public) && ChatSDK.config().pushNotificationsForPublicChatRoomsEnabled)) {
            if(!message.getSender().isMe() && ChatSDK.ui().showLocalNotifications(message.getThread())) {
              ReadStatus status = message.readStatusForUser(ChatSDK.currentUser());
              if (!message.isRead() && !status.is(ReadStatus.delivered())) {
                // Only show the alert if we'recyclerView not on the private threads tab
                ChatSDK.ui().notificationDisplayHandler().createMessageNotification(message);
              }
            }
          }
        }
      });
}
co.chatsdk.core.utilsAppBackgroundMonitorinBackground

Popular methods of AppBackgroundMonitor

  • shared
  • setEnabled

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • setRequestProperty (URLConnection)
  • Kernel (java.awt.image)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • JOptionPane (javax.swing)
  • JTable (javax.swing)
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now