<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chris Dougherty</title>
    <description>The latest articles on DEV Community by Chris Dougherty (@christophertdoc).</description>
    <link>https://dev.to/christophertdoc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F247201%2F6d2f21a0-84cb-432c-a573-d8e162b039c1.jpeg</url>
      <title>DEV Community: Chris Dougherty</title>
      <link>https://dev.to/christophertdoc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/christophertdoc"/>
    <language>en</language>
    <item>
      <title>Meta Wearable Device Access Toolkit - Overview of the developer preview</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Wed, 22 Oct 2025 00:30:20 +0000</pubDate>
      <link>https://dev.to/christophertdoc/meta-wearable-device-access-toolkit-overview-of-the-developer-preview-20e2</link>
      <guid>https://dev.to/christophertdoc/meta-wearable-device-access-toolkit-overview-of-the-developer-preview-20e2</guid>
      <description>&lt;p&gt;A summary of two presentations from Meta (see links below) and some key takeaways/thoughts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=xlViEqrQG3s" rel="noopener noreferrer"&gt;Meta Wearables Device Access Toolkit&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=U0Ha6AmXBS0&amp;amp;t=290s" rel="noopener noreferrer"&gt;Developer Preview: Introducing Meta Wearables Device Access Toolkit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Meta will soon release a new SDK to let developers build mobile apps that integrate directly with Meta AI Glasses — including the new Ray-Ban Display glasses.&lt;/p&gt;

&lt;p&gt;𝐃𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫 𝐏𝐫𝐞𝐯𝐢𝐞𝐰: Rolling out to a limited group of developers in phases throughout Fall 2025.&lt;/p&gt;

&lt;p&gt;𝐅𝐮𝐥𝐥 𝐒𝐃𝐊 𝐋𝐚𝐮𝐧𝐜𝐡: Planned for 2026&lt;/p&gt;

&lt;p&gt;𝐒𝐃𝐊 𝐈𝐍𝐂𝐋𝐔𝐃𝐄𝐒:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;APIs for:

&lt;ul&gt;
&lt;li&gt;Media streaming&lt;/li&gt;
&lt;li&gt;Photo capture&lt;/li&gt;
&lt;li&gt;Error handling&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Sample applications&lt;/li&gt;

&lt;li&gt;Testing options:

&lt;ul&gt;
&lt;li&gt;Developer mode — testing with real glasses&lt;/li&gt;
&lt;li&gt;Mock device kit — testing without hardware (e.g., injecting video for simulation &amp;amp; E2E testing)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;𝐍𝐎𝐓𝐀𝐁𝐋𝐄 𝐓𝐀𝐊𝐄𝐀𝐖𝐀𝐘𝐒&lt;br&gt;
The Meta AI app manages the connection approval between your mobile app and the AI glasses. It’s unclear whether this extra step through the Meta AI app will make the setup process feel clunky or add friction for users.&lt;/p&gt;

&lt;p&gt;The Mock Device Kit appears to support injecting video into an AI glasses simulator — potentially a major boost for both development and end-to-end testing. This isn’t possible in most traditional mobile app simulators.&lt;/p&gt;

&lt;p&gt;For now, the SDK won’t support sending imagery to the Ray-Ban Display HUD or accessing gestures from the Neural Band. When those features arrive, they’ll unlock far more customized in-app experiences.&lt;/p&gt;

</description>
      <category>metaraybandisplay</category>
      <category>aiglasses</category>
    </item>
    <item>
      <title>Real Estate Valuation with TensorFlow</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Mon, 25 Sep 2023 22:39:06 +0000</pubDate>
      <link>https://dev.to/christophertdoc/real-estate-valuation-with-tensorflow-3b52</link>
      <guid>https://dev.to/christophertdoc/real-estate-valuation-with-tensorflow-3b52</guid>
      <description>&lt;p&gt;&lt;a href="https://colab.research.google.com/drive/1Q7GCCafPZFn-cCAeKoyC-SqVHaDGzAYJ#scrollTo=D30VJy6KLFtF"&gt;This notebook presents a real estate valuator model built to predict the price per unit area of properties in Sindian Dist., New Taipei City, Taiwan&lt;/a&gt;. Utilizing a dataset from the University of California Irvine containing historical transaction data from 2012-2013, the model employs linear regression techniques. The dataset comprises 414 instances with features like transaction date, house age, distance to the nearest MRT station, number of convenience stores, and geographical coordinates. The target variable represents the house price per unit area, denominated in 10,000 New Taiwan Dollar/Ping. The methodology encompasses data acquisition from the University of California Irvine, preprocessing where data is split into training and testing sets and standardized, model building and training using TensorFlow, and evaluation. After building and training the model, users can predict prices for new properties by entering the property's details into the notebook.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>tensorflow</category>
      <category>python</category>
    </item>
    <item>
      <title>Underwater Object Identification with TensorFlow: Mines vs. Rocks</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Mon, 18 Sep 2023 03:08:07 +0000</pubDate>
      <link>https://dev.to/christophertdoc/underwater-object-identification-with-tensorflow-mines-vs-rocks-3a6d</link>
      <guid>https://dev.to/christophertdoc/underwater-object-identification-with-tensorflow-mines-vs-rocks-3a6d</guid>
      <description>&lt;p&gt;A very simple example of machine learning classification with TensorFlow along with very thorough explanations of each step in the process.&lt;/p&gt;

&lt;p&gt;Hello and welcome to a small project I’ve been working on that utilizes a dataset from the University of California at Irvine. &lt;a href="https://colab.research.google.com/drive/18DY3EBmhasSOEoe3dcs__GaOO-VGMSON?usp=sharing"&gt;This notebook shares a machine learning technique that is broken down into easily digestible parts and can hopefully serve as an educational example for others.&lt;/a&gt; In particular, the notebook uses classification techniques to differentiate between sonar signals bounced off a metal object (like a mine) and those bounced off a rock.&lt;/p&gt;

&lt;p&gt;Enjoy, and if you have any suggestions on how to improve upon this notebook, I’d love to hear them.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>tensorflow</category>
      <category>python</category>
    </item>
    <item>
      <title>Customize API Gateway URL with Domain Purchased From Google Domains</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Thu, 27 Apr 2023 01:09:46 +0000</pubDate>
      <link>https://dev.to/christophertdoc/customize-api-gateway-url-with-domain-purchased-from-google-domains-57hc</link>
      <guid>https://dev.to/christophertdoc/customize-api-gateway-url-with-domain-purchased-from-google-domains-57hc</guid>
      <description>&lt;p&gt;Creating a custom URL for an AWS API Gateway API is straightforward enough if you obtained your domain from AWS. But what if you purchased a domain through another company such as Google? Well, the following resources will walk you through how to do just that.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=Iu_wCP1oevQ&amp;amp;ab_channel=JohnGreenDev"&gt;Create an AWS Route 53 Hosted Zone for your Google domain&lt;/a&gt;. This allows your domain to be used by AWS.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=ESei6XQ7dMg&amp;amp;t=425s&amp;amp;ab_channel=BeABetterDev"&gt;Add a custom domain and use it for your API&lt;/a&gt;. i.e. api.mywebapp.com&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>domainnames</category>
      <category>aws</category>
      <category>google</category>
      <category>apigateway</category>
    </item>
    <item>
      <title>Integrate GPT-X with Google Search by using Langchain</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Thu, 13 Apr 2023 02:56:59 +0000</pubDate>
      <link>https://dev.to/christophertdoc/integrate-gpt-x-with-google-search-by-using-langchain-1891</link>
      <guid>https://dev.to/christophertdoc/integrate-gpt-x-with-google-search-by-using-langchain-1891</guid>
      <description>&lt;p&gt;GPT-3/GPT-4 are fantastic technologies but as of now, they come with a few limitations. One of these limitations is that the large language model that this technology is based, only has knowledge up to a certain date. That's where Langchain comes in. Langchain provides tools to increase GPT-X's capabilities. And one of those capabilities is allowing GPT-X to perform Google searches in order to retrieve up-to-date information. Check out &lt;a href="https://colab.research.google.com/drive/1XgsoFXyL01cEEGozeNJww_WZUIIs5zV6#scrollTo=iu_--FLXbCQM"&gt;this simple example that can get you up and running in no time!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>langchain</category>
      <category>ai</category>
      <category>gpt3</category>
      <category>gpt4</category>
    </item>
    <item>
      <title>Understanding Vector Databases: Powering the World of AI</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Fri, 07 Apr 2023 00:51:06 +0000</pubDate>
      <link>https://dev.to/christophertdoc/understanding-vector-databases-powering-the-world-of-ai-240p</link>
      <guid>https://dev.to/christophertdoc/understanding-vector-databases-powering-the-world-of-ai-240p</guid>
      <description>&lt;p&gt;&lt;em&gt;An easy-to-understand guide to the role of vector databases in Artificial Intelligence&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Artificial Intelligence (AI) has been making significant advancements in recent years, with new technologies and applications emerging at an incredible pace. One of the key components for AI systems, especially in areas like machine learning, is the ability to store and analyze large amounts of complex data. This is where vector databases come in. In this blog post, we will provide a simple explanation of what vector databases are, why they are important in AI applications, and how they can help drive breakthroughs in numerous fields.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are Vector Databases?
&lt;/h2&gt;

&lt;p&gt;Vector databases are specialized storage systems designed to handle large amounts of complex data, which can include things like images, text, or audio. These databases store and organize this data in a way that makes it easier to search for and find similar items based on certain criteria, such as how closely related two pieces of data are.&lt;/p&gt;

&lt;p&gt;Traditional databases can struggle with searching for similarities in large, complex datasets, as the search process becomes slower and less efficient as the amount of data increases. Vector databases, however, use specialized techniques and algorithms to speed up this process, making it much faster and more efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  How are Vector Databases Used in AI?
&lt;/h2&gt;

&lt;p&gt;Vector databases play an important role in various AI applications, especially those involving machine learning, deep learning, and natural language processing. Some of the main ways vector databases are used in AI include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Recommender Systems: One of the most common uses of vector databases is in creating personalized recommendation systems, like those used by online shopping websites, music streaming platforms, and news websites. These systems use vector databases to store information about users' preferences and interests, making it easier to find and suggest items that are most relevant to them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Image and Video Recognition: In the area of computer vision, vector databases are used to help recognize and understand images and videos. AI models can analyze visual content and generate data that represents its key features, which can then be stored and searched in a vector database to perform tasks like identifying objects, classifying images, or finding similar images.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Natural Language Processing: In applications that involve understanding and processing human language, vector databases are used to store and manage information about words and sentences. This information can then be used to perform tasks like searching for related content, grouping similar documents together, or analyzing the sentiment of a piece of text.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anomaly Detection: Vector databases can also be used to help detect unusual activities or behaviors in various areas, such as cybersecurity, fraud detection, or monitoring of industrial equipment. By storing information about normal and abnormal patterns, vector databases can be used to search for and identify potential anomalies or outliers.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Benefits of Vector Databases in AI
&lt;/h2&gt;

&lt;p&gt;Vector databases offer several advantages that make them well-suited for AI applications:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Scalability: Vector databases are designed to handle large amounts of complex data, making them ideal for storing the vast amounts of data generated by AI applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Speed: By using specialized techniques and algorithms, vector databases can search for similarities in data much faster than traditional databases, allowing for real-time or near-real-time analysis in AI systems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Flexibility: Vector databases can store and manage a wide range of data types, including images, text, audio, and more, making them adaptable to various AI applications and fields.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Improved Accuracy: By using vector databases to find similarities in data, AI systems can achieve better results and more accurate predictions, ultimately improving the overall performance of the application.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Vector databases are a crucial component in the world of AI, providing the necessary infrastructure for storing and analyzing complex data. Their ability to quickly and efficiently find similarities in data makes them invaluable for numerous AI applications, such as recommendation systems, image recognition, natural language processing, and anomaly detection. As AI continues to evolve and grow, the importance of vector databases will only increase, driving further advancements in the field and helping to unlock the full potential of artificial intelligence.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Harnessing the Power of A.I. to Supercharge Your Software Projects</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Fri, 24 Mar 2023 16:22:42 +0000</pubDate>
      <link>https://dev.to/christophertdoc/harnessing-the-power-of-ai-to-supercharge-your-software-projects-1agh</link>
      <guid>https://dev.to/christophertdoc/harnessing-the-power-of-ai-to-supercharge-your-software-projects-1agh</guid>
      <description>&lt;p&gt;Artificial Intelligence (A.I.) has been making waves in various industries, from healthcare to automotive, and software development is no exception. By leveraging A.I., developers can automate repetitive tasks, facilitate collaboration, and enhance coding efficiency. In this post, we will delve into how you can harness the power of A.I. to supercharge your software projects and make your coding journey more enjoyable and efficient.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. Automate repetitive tasks
&lt;/h3&gt;

&lt;p&gt;One of the key benefits of A.I. in software development is the ability to automate repetitive tasks. This not only saves time but also minimizes the risk of human errors. Some of the tasks that can be automated using A.I. include:&lt;/p&gt;

&lt;h5&gt;
  
  
  Code generation:
&lt;/h5&gt;

&lt;p&gt;Tools like Tabnine and Codota use A.I. to assist developers in writing code. They analyze the context of the code being written and provide relevant suggestions, allowing developers to write code more quickly and accurately.&lt;/p&gt;

&lt;h5&gt;
  
  
  Bug detection:
&lt;/h5&gt;

&lt;p&gt;A.I. can help identify potential bugs in the codebase. Tools like Snyk and SonarQube use machine learning algorithms to analyze your code and flag potential issues, such as security vulnerabilities, code smells, and bugs.&lt;/p&gt;

&lt;h5&gt;
  
  
  Automated testing:
&lt;/h5&gt;

&lt;p&gt;Tools like Testim and Applitools leverage A.I. to create, execute, and maintain automated tests for your applications. These tools can significantly reduce the time and effort spent on manual testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Enhance code quality and readability
&lt;/h3&gt;

&lt;p&gt;In addition, A.I.-powered code review platforms like DeepSource and Codacy can help identify potential issues in your code and suggest improvements to ensure best practices are followed. This not only improves the quality of your code but also makes it more maintainable in the long run.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Facilitate collaboration and knowledge sharing
&lt;/h3&gt;

&lt;p&gt;A.I. can be used to enhance collaboration among team members and foster a more efficient development process. For example, A.I.-powered chatbots like Stack Overflow's bot can help developers find relevant information and solutions to their coding problems more quickly, reducing the time spent searching for answers and allowing for more efficient collaboration.&lt;/p&gt;

&lt;p&gt;Moreover, platforms like GitHub Copilot use A.I. to analyze your code and provide context-aware suggestions, making it easier for developers to collaborate on projects and ensure that best practices are followed.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Improve project estimation and management
&lt;/h3&gt;

&lt;p&gt;A.I. can play a crucial role in improving project estimation and management. By analyzing historical project data, machine learning algorithms can predict the time and resources required to complete a project with greater accuracy. This can help managers allocate resources more efficiently and avoid potential bottlenecks.&lt;/p&gt;

&lt;p&gt;Tools like ClickUp and Forecast use A.I. to provide data-driven insights and recommendations for project management, such as task prioritization, team workload balancing, and risk identification.&lt;/p&gt;




&lt;p&gt;A.I. has the potential to revolutionize the way we approach software development, making it faster, more efficient, and less prone to human error. By embracing A.I. in your software projects, you can automate repetitive tasks, enhance code quality, facilitate collaboration, and improve project management. The future of software development is undoubtedly intertwined with A.I., and leveraging its power will give you a competitive edge in the rapidly evolving technology landscape.&lt;/p&gt;

&lt;p&gt;This post was co-written with GPT-4  ;)&lt;br&gt;
Image generated by Midjourney&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>engineering</category>
    </item>
    <item>
      <title>A Close Look at "React Native Background Fetch"</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Mon, 01 Aug 2022 12:20:38 +0000</pubDate>
      <link>https://dev.to/christophertdoc/a-close-look-at-react-native-background-fetch-2g73</link>
      <guid>https://dev.to/christophertdoc/a-close-look-at-react-native-background-fetch-2g73</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;a href="https://www.npmjs.com/package/react-native-background-fetch"&gt;react-native-background-fetch (RNBF)&lt;/a&gt; provides &lt;a href="https://dev.to/christophertdoc/what-are-background-processes-in-computing-e46"&gt;background processing&lt;/a&gt; that can optimize the performance of an application's user interface. RNBF is for React Native applications and has support for both iOS and Android. The following post is a high-level but thorough description of this module's features. Further, we take a more detailed look at the native Android and iOS technology behind the module. For more information about installation, setup and simulating events, &lt;a href="https://github.com/transistorsoft/react-native-background-fetch"&gt;check out the docs here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Main features&lt;/li&gt;
&lt;li&gt;Platform implementation comparison&lt;/li&gt;
&lt;li&gt;Comparison with other modules&lt;/li&gt;
&lt;li&gt;The native technology behind RNBF&lt;/li&gt;
&lt;li&gt;Benchmark tests (Coming Soon)&lt;/li&gt;
&lt;li&gt;Configurations for iOS and Android&lt;/li&gt;
&lt;li&gt;Configurations for Android only&lt;/li&gt;
&lt;li&gt;Methods&lt;/li&gt;
&lt;li&gt;Basic examples&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Main features
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Provides background processing for React Native applications on both iOS and Android.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;(Android Only)&lt;/em&gt; Support for manually triggering RNBF to handle a background task. This can be triggered by the user OR the application itself.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;(iOS and Android)&lt;/em&gt; Also has support for allowing the OS to determine when RNBF will periodically handle background tasks. This typically occurs at a minimum of 15 minutes per interval but can change due to several factors including frequency of device usage.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Platform implementation comparison
&lt;/h1&gt;

&lt;h4&gt;
  
  
  iOS
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;When your app is terminated, RNBF 
will NO longer be able to handle events on iOS.&lt;/li&gt;
&lt;li&gt;If a user doesn't open the application for a long period of time, RNBF will handle events less frequently.&lt;/li&gt;
&lt;li&gt;The user MUST have the &lt;a href="https://support.apple.com/en-us/HT202070#:~:text=Use%20Background%20App%20Refresh&amp;amp;text=If%20you%20want%20suspended%20apps,before%20you%20open%20it%20again."&gt;"background app refresh" setting&lt;/a&gt; turned ON in order for RNBF to trigger background tasks on iOS. This setting is "ON" by default in iOS.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Android
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;RNBF can continue handling events even after app termination.&lt;/li&gt;
&lt;li&gt;Support for options such as the ability to require that the battery or storage NOT be low in order to run the background worker.&lt;/li&gt;
&lt;li&gt;If needed, you can require that the device be connected to a charger in order to handle tasks.&lt;/li&gt;
&lt;li&gt;Also has the ability to optionally require that the device be idle in order to handle background tasks.&lt;/li&gt;
&lt;li&gt;If needed, you can manually trigger the background worker to start working on a task. This functionality also has the option to continuously run tasks one after another.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Comparison with other modules
&lt;/h1&gt;

&lt;p&gt;Bottom line, I think that RNBF is currently the best overall React Native module for background processing. It works for both iOS and Android. And it is by far, the best maintained module with the most active support. Further, with that being said, there really aren't many great options available for React Native background processing. The alternatives are not well maintained and mostly do NOT have as many (working) features as RNBF. If you'd like to take a closer look at a comparison of background processing modules for React Native, &lt;a href="https://dev.to/christophertdoc/background-processing-for-react-native-applications-in-2022-340g"&gt;check out this post&lt;/a&gt;. In the near future, I'll post a recipe of what would be the ideal React Native module for background processing.&lt;/p&gt;




&lt;h1&gt;
  
  
  The native technology behind RNBF
&lt;/h1&gt;

&lt;p&gt;The following is a description of ONLY the features, of these technologies, that are made available to RNBF.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://developer.android.com/reference/android/app/job/JobScheduler"&gt;JobScheduler&lt;/a&gt; &lt;em&gt;(Android)&lt;/em&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;By default, RNBF uses this for Android.&lt;/li&gt;
&lt;li&gt;JobScheduler has the option to use its own internal mechanism for determining the intervals between when it triggers background events. If you use this option, JobScheduler prioritizes battery life by throttling task execution.&lt;/li&gt;
&lt;li&gt;If needed, you can manually schedule tasks instead of relying on JobScheduler to determine when tasks are handled.&lt;/li&gt;
&lt;li&gt;Depending on the Android version, JobScheduler might stop a task before it is finished. For build version code "LOLLIPOP", jobs have a maximum execution time of 1 minute. Starting with build version code "M" and ending with "R", jobs have a maximum execution time of 10 minutes. Starting from build version code "S", jobs will NOT be stopped after 10 minutes UNLESS the system is busy or needs extra resources. &lt;a href="https://apilevels.com/"&gt;If you want to understand more about how build version codes relate to versions of Android, SDK levels and more, please see this guide&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://developer.android.com/reference/android/app/AlarmManager"&gt;AlarmManager&lt;/a&gt; &lt;em&gt;(Android)&lt;/em&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;RNBF &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-boolean-forcealarmmanager-false"&gt;gives you the option to bypass JobScheduler&lt;/a&gt; in order to use native Android's AlarmManager.&lt;/li&gt;
&lt;li&gt;In comparison to JobScheduler, AlarmManager executes tasks more frequently at the cost of higher battery usage.&lt;/li&gt;
&lt;li&gt;Like JobScheduler, you can also manually schedule tasks instead of relying on the native module to determine when tasks are handled.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler"&gt;BGTaskScheduler&lt;/a&gt; &lt;em&gt;(iOS)&lt;/em&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;This is the only native module that RNBF uses for iOS.&lt;/li&gt;
&lt;li&gt;With this native module, you do NOT have the option to manually trigger task execution. Instead, you have to rely on the BGTaskScheduler to do that for you.&lt;/li&gt;
&lt;li&gt;BGTaskScheduler will automatically limit how often tasks are triggered based on usage patterns. For instance, if a user hasn't turned on their device for a long period of time, tasks will be started less frequently once the device &lt;em&gt;is&lt;/em&gt; turned on.&lt;/li&gt;
&lt;li&gt;It can take days before Apple's machine-learning algorithm behind BGTaskScheduler to regularly trigger tasks.&lt;/li&gt;
&lt;li&gt;In order to avoid having to wait long periods of time before BGTaskScheduler will start events, you can use &lt;a href="https://dev.to-%20In%20order%20to%20avoid%20having%20to%20wait%20long%20periods%20of%20time%20before%20BGT"&gt;simulated events&lt;/a&gt; for development / testing. If the simulated events are working correctly, then you have correctly configured RNBF for BGTaskScheduler / iOS.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Benchmark tests
&lt;/h1&gt;

&lt;p&gt;(COMING SOON)&lt;br&gt;
In the near future, I'll detail the results of some basic tests in order to provide some more insight into the capabilities of RNBF. Examples of some of these tests include "when using OS determined event triggering, how often does RNBF try to start new tasks", "does the worker automatically prevent multiple tasks from running at the same time", and "under certain conditions, how long will RNBF run a single task before timing out?".&lt;/p&gt;


&lt;h1&gt;
  
  
  Configurations for iOS and Android
&lt;/h1&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-integer-requirednetworktype-backgroundfetchnetwork_type_none"&gt;requiredNetworkType&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;This configuration specifies what type of network connection (if any) is required for RNBF to handle events. You can choose between "none", "any", "cellular", "unmetered" or "not roaming".&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#param-integer-minimumfetchinterval-15"&gt;minimumFetchInterval&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Sets the amount of time in minutes between OS determined executions of events. Defaults to 15 minutes (which is also the minimum).&lt;/p&gt;


&lt;h1&gt;
  
  
  Configurations for Android only
&lt;/h1&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-boolean-stoponterminate-true"&gt;stopOnTerminate&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Set &lt;code&gt;false&lt;/code&gt; in order to continue background work even after user terminates the app.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-boolean-enableheadless-false"&gt;enableHeadless&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Set &lt;code&gt;true&lt;/code&gt; in order to use &lt;a href="https://reactnative.dev/docs/headless-js-android"&gt;React Native's Headless JS&lt;/a&gt; feature for continuing background work after app termination.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-boolean-startonboot-false"&gt;startOnBoot&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Continue background work when device is rebooted.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-boolean-forcealarmmanager-false"&gt;forceAlarmManager&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;By default, RNBF uses Android's JobScheduler. Setting &lt;code&gt;forceAlarmManager: true&lt;/code&gt; will bypass JobScheduler to use Android's AlarmManager.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-boolean-requiresbatterynotlow-false"&gt;requiresBatteryNotLow&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Set &lt;code&gt;true&lt;/code&gt; in order to ONLY run the background worker if the battery is NOT low. "Low" is considered to be at the point where a user is given a "low battery" warning.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-boolean-requiresstoragenotlow-false"&gt;requiresStorageNotLow&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Setting &lt;code&gt;requiresStorageNotLow: true&lt;/code&gt; will cause the background worker to ONLY run when storage is NOT low. "Low" is considered to be at the point that a user is given a "low storage" warning.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-boolean-requirescharging-false"&gt;requiresCharging&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Set &lt;code&gt;true&lt;/code&gt; in order to require that the device be connected to a charger for the module to do background work.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#config-boolean-requiresdeviceidle-false"&gt;requiresDeviceIdle&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;When set &lt;code&gt;true&lt;/code&gt;, the background worker will ONLY work on tasks if the device is NOT in active use.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#param-boolean-periodic-false"&gt;periodic&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Valid only for the &lt;code&gt;scheduleTask&lt;/code&gt; method. Set &lt;code&gt;true&lt;/code&gt; to execute the task handling callback repeatedly. When &lt;code&gt;false&lt;/code&gt;, the task handling callback will execute just once.&lt;/p&gt;


&lt;h1&gt;
  
  
  &lt;a href="https://github.com/transistorsoft/react-native-background-fetch#methods"&gt;Methods&lt;/a&gt;
&lt;/h1&gt;
&lt;h3&gt;
  
  
  configure
&lt;/h3&gt;

&lt;p&gt;Add configuration options and specify the callback function to handle background work. Also specify a timeout function that runs when a task has reached its allowed execution duration. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;forceAlarmManager&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;MORE&lt;/span&gt; &lt;span class="nx"&gt;CONFIG&lt;/span&gt; &lt;span class="nx"&gt;HERE&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;handleTask&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onTimeout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  status &lt;em&gt;(iOS Only)&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Returns the status of the background worker as either "restricted" (0), "denied" (1) or "available" (2). Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  scheduleTask &lt;em&gt;(Android Only)&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Use this method to manually execute background work. Set &lt;code&gt;periodic: true&lt;/code&gt; in the config to keep triggering &lt;code&gt;scheduleTask&lt;/code&gt; over and over. This method executes the same task handling callback function that the &lt;code&gt;configure&lt;/code&gt; method defines. You can also specify a delay between the calling of this method and when the module starts working on a task. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scheduleTask&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TASK ID HERE&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// amount of time in ms between when scheduleTask() is called and the execution of the task&lt;/span&gt;
  &lt;span class="na"&gt;forceAlarmManager&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  stop
&lt;/h3&gt;

&lt;p&gt;Stop all background work. Optionally, if you provide a &lt;code&gt;taskId&lt;/code&gt; as an argument, you can stop a specific call to &lt;code&gt;scheduleTask&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  finish
&lt;/h3&gt;

&lt;p&gt;This must be called at the end of the callback function that handles your background task in order to signal to the OS that the task is complete. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleTask&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="c1"&gt;// Do background work here&lt;/span&gt;

  &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Basic examples
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Here are a couple basic examples of how to use RNBF in order to give you a sense of the overall implementation approach. For more detailed and specific examples, please check out &lt;a href="https://github.com/transistorsoft/react-native-background-fetch"&gt;the docs&lt;/a&gt; and / or &lt;a href="https://github.com/transistorsoft/react-native-background-fetch/tree/master/example"&gt;the example app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  OS determined task schedule &lt;em&gt;(iOS and Android)&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;This is an example of how to implement a worker that allows the OS to determine when RNBF will periodically handle background tasks. Here is an example of a timeline for how this type of worker functions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Call &lt;code&gt;initBackgroundFetch()&lt;/code&gt; to start worker in background.&lt;/li&gt;
&lt;li&gt;Worker waits for a minimum of 15 minutes.&lt;/li&gt;
&lt;li&gt;Worker triggers &lt;code&gt;handleTask()&lt;/code&gt; to do background work.&lt;/li&gt;
&lt;li&gt;The task finishes.&lt;/li&gt;
&lt;li&gt;The worker waits again for another minimum of 15 minutes.&lt;/li&gt;
&lt;li&gt;The worker triggers &lt;code&gt;handleTask()&lt;/code&gt; a second time to do more background work.&lt;/li&gt;
&lt;li&gt;The second task finishes.&lt;/li&gt;
&lt;li&gt;Steps 2 - 7 are repeated.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="c1"&gt;// Example of OS determined task schedule&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-background-fetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="c1"&gt;// Start the background worker&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;initBackgroundFetch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;minimumFetchInterval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 15 minutes&lt;/span&gt;
    &lt;span class="c1"&gt;// ADDITIONAL CONFIG HERE&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;handleTask&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onTimeout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[ RNBF STATUS ]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// handleTask is called periodically when RNBF triggers an event&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleTask&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[ RNBF TASK ID ]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="c1"&gt;// DO BACKGROUND WORK HERE&lt;/span&gt;

  &lt;span class="c1"&gt;// This MUST be called in order to signal to the OS that your task is complete&lt;/span&gt;
  &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;onTimeout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="c1"&gt;// The timeout function is called when the OS signals that the task has reached its maximum execution time.&lt;/span&gt;

  &lt;span class="c1"&gt;// ADD CLEANUP WORK HERE (IF NEEDED)&lt;/span&gt;

  &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;initBackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Manually determined task schedule &lt;em&gt;(Android Only)&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;This is an example of how to implement a worker that allows the application or user to manually schedule tasks instead of relying on the OS to determine when a task will be worked on. For example, this type of worker can be triggered to handle a task by pressing a button (or some other manual event). &lt;strong&gt;IMPORTANT:&lt;/strong&gt; In this type of worker, if you set &lt;code&gt;periodic: true&lt;/code&gt; in the config, the worker will continuously handle tasks over and over again. Here is an example timeline of how this type of worker would function:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Call &lt;code&gt;initBackgroundFetch()&lt;/code&gt; to start worker in background.&lt;/li&gt;
&lt;li&gt;User presses a button that triggers &lt;code&gt;scheduleTask()&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;The &lt;code&gt;scheduleTask()&lt;/code&gt; function schedules a task to be worked on. If you have included &lt;code&gt;delay&lt;/code&gt; in the config, that delay will specify the time between when the button is pressed and when the worker will begin handling the task.&lt;/li&gt;
&lt;li&gt;After an optionally specified delay, RNBF starts working on the task.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;periodic: true&lt;/code&gt; is set in the config, steps 3 - 4 will occur over and over again.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Example of a manually determined task schedule&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-background-fetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="c1"&gt;// Start the background worker&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;initBackgroundFetch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;minimumFetchInterval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// minutes&lt;/span&gt;
      &lt;span class="c1"&gt;// ADDITIONAL CONFIG HERE&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;handleTask&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onTimeout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[ RNBF STATUS ]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// handleTask is called periodically when RNBF triggers an event&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleTask&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[ RNBF TASK ID ]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;// DO BACKGROUND WORK HERE&lt;/span&gt;

    &lt;span class="c1"&gt;// This MUST be called in order to signal to the OS that your task is complete&lt;/span&gt;
    &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;onTimeout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="c1"&gt;// The timeout function is called when the OS signals that the task has reached its maximum execution time.&lt;/span&gt;

    &lt;span class="c1"&gt;// ADD CLEANUP WORK HERE (IF NEEDED)&lt;/span&gt;

    &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// Schedule task to be handled by background worker&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;scheduleTask&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;BackgroundFetch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scheduleTask&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;taskId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;uuid.v4()&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;forceAlarmManager&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt;
        &lt;span class="nx"&gt;onPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;scheduleTask&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Do background work&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
      &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>reactnative</category>
      <category>backgroundprocessing</category>
      <category>software</category>
    </item>
    <item>
      <title>What are background processes in computing?</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Tue, 26 Jul 2022 20:40:00 +0000</pubDate>
      <link>https://dev.to/christophertdoc/what-are-background-processes-in-computing-e46</link>
      <guid>https://dev.to/christophertdoc/what-are-background-processes-in-computing-e46</guid>
      <description>&lt;p&gt;&lt;em&gt;A background process does work for a computer in a way that optimizes performance of the user interface.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Running an automatic update for an application.&lt;/li&gt;
&lt;li&gt;A word processor printing a file.&lt;/li&gt;
&lt;li&gt;Checking the device’s network connection.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;The user interface is run on a particular thread (a thread is a sequence of programmed instructions executed by the CPU). Background processes are run on a separate thread from the user interface. And running these on a separate thread can have the potential to prevent background processes from affecting the performance of the UI. In some cases, background processes can run even if the application that triggered them is closed.&lt;/p&gt;




&lt;h2&gt;
  
  
  What are they used for?
&lt;/h2&gt;

&lt;p&gt;Background processes are ideal for tasks that have the potential to diminish the performance of a user interface. Examples of this include downloading or uploading large media files. Running these as a background process can prevent the tasks from slowing down the performance of the UI. They are also great for tasks that require little to no user interaction such as logging, system monitoring, scheduling and user notification.&lt;/p&gt;




&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;...Coming soon.&lt;/p&gt;

</description>
      <category>computing</category>
      <category>backgroundprocess</category>
      <category>software</category>
    </item>
    <item>
      <title>Background Processing for React Native Applications in 2022</title>
      <dc:creator>Chris Dougherty</dc:creator>
      <pubDate>Mon, 25 Jul 2022 20:25:00 +0000</pubDate>
      <link>https://dev.to/christophertdoc/background-processing-for-react-native-applications-in-2022-340g</link>
      <guid>https://dev.to/christophertdoc/background-processing-for-react-native-applications-in-2022-340g</guid>
      <description>&lt;p&gt;&lt;em&gt;A background process does work for a computer in a way that optimizes performance of the user interface. &lt;a href="https://dev.to/christophertdoc/what-are-background-processes-in-computing-e46"&gt;If you are new to background processing, check out this article&lt;/a&gt;. There are several options for background processing regarding react native applications, each with their own trade-offs and levels of built-in functionality. The following is a brief overview of each option along with a list of advantages and disadvantages.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;a href="https://www.npmjs.com/package/react-native-background-fetch"&gt;React Native Background Fetch&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This is a fairly simple but well maintained background worker created by a company called &lt;a href="https://www.transistorsoft.com/"&gt;Transistor Software&lt;/a&gt; which specializes in making native location API’s that run in the background. React native background fetch will perform periodic work once every 15 minutes and works on both Android and iOS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Well maintained&lt;/li&gt;
&lt;li&gt;Works on both android AND iOS&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Disadvantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Only a periodic worker (no support for queue)&lt;/li&gt;
&lt;li&gt;Only runs once every 15 minutes. There is no way to speed this up.&lt;/li&gt;
&lt;li&gt;Not very many features.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;a href="https://www.npmjs.com/package/react-native-background-task"&gt;React Native Background Task&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This module is very similar to react-native-background-fetch in that it offers iOS and Android support for a periodic worker that executes a task no faster than once every 15 minutes. It offers a few different features as compared to react-native-background-fetch but is NOT maintained and has some pretty restrictive limitations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Works on both android AND iOS&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Disadvantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Not well maintained&lt;/li&gt;
&lt;li&gt;Only offers a periodic worker that runs once every 15 minutes.&lt;/li&gt;
&lt;li&gt;Has some pretty &lt;a href="http://react-native-background-fetch/"&gt;restrictive limitations&lt;/a&gt; such as tasks not being run while the app is in the foreground for Android and tasks are not able to run if the user manually closes the app on iOS.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;a href="https://github.com/JoaoLSS/react-native-background-worker"&gt;React Native Background Worker&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;React Native Background Worker offers the most amount of features as compared with the other options. It has the ability to do periodic work OR manage a queue of tasks among other things. It is built on &lt;a href="https://developer.android.com/topic/libraries/architecture/workmanager"&gt;Android SDK’s own feature-rich WorkManager API&lt;/a&gt;. Despite having some of these advantages, it also has some downsides including NOT being well maintained and having at least one feature that no longer works (&lt;a href="https://github.com/JoaoLSS/react-native-background-worker#cancel"&gt;canceling a task&lt;/a&gt;). Still though, this module does have some nice features and if someone were to maintain it and incorporate even just a little more of Android WorkManager’s functionality, this module would be a home run for background processing on Android applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Offers queue AND periodic worker options.&lt;/li&gt;
&lt;li&gt;Includes more functionality as compared to other options.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Disadvantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Not well maintained.&lt;/li&gt;
&lt;li&gt;Can only be used for android.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;a href="https://reactnative.dev/docs/headless-js-android"&gt;Headless JS&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Headless JS is react-native’s own approach to executing processes for Android only. It utilizes &lt;a href="https://developer.android.com/guide/components/services?authuser=1"&gt;Android SDK’s Services application component&lt;/a&gt; and does require that you write some native code in order to get it up and running. Further, headless JS only offers some basic features such as the ability to specify how headless JS will approach retrying tasks (in case of failure). If you need to manage a queue of tasks or even periodic work on tasks, you’ll have to write this functionality yourself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Well maintained and supported by react-native.&lt;/li&gt;
&lt;li&gt;Customizable retry policy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Disadvantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Requires that you write some native code.&lt;/li&gt;
&lt;li&gt;Does not have a whole lot of features such as managing periodic or queue work.&lt;/li&gt;
&lt;li&gt;Only works on Android (NOT on iOS)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  (Coming Soon) &lt;a href="https://github.com/technogise/rn-background-queue-processor"&gt;React Native Background Queue Processor&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;...&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;There is not ONE module that includes all of the best functionality for both iOS and Android. Instead, we are left with only several options that have some trade-offs. However, I DO believe there is currently a best option for each platform. For android, the best options are react-native-background-worker for being feature-rich and react-native-background-fetch for its simplicity of use and being well maintained. For iOS, again the best option here would be react-native-background-fetch for the same reasons as Android. Ideally in the future though, there is great opportunity to improve on background processing for react-native applications. If someone were to take over and further enhance react-native-background-worker and offer support for iOS on that module, that would be a big win for the react-native ecosystem.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>backgroundprocessing</category>
      <category>software</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
