Periodic callbacks in the background for both IOS and Android

Overview

react-native-background-fetch · npm npm

By Transistor Software, creators of React Native Background Geolocation


Background Fetch is a very simple plugin which attempts to awaken an app in the background about every 15 minutes, providing a short period of background running-time. This plugin will execute your provided callbackFn whenever a background-fetch event occurs.

There is no way to increase the rate which a fetch-event occurs and this plugin sets the rate to the most frequent possible — you will never receive an event faster than 15 minutes. The operating-system will automatically throttle the rate the background-fetch events occur based upon usage patterns. Eg: if user hasn't turned on their phone for a long period of time, fetch events will occur less frequently or if an iOS user disables background refresh they may not happen at all.

🆕 Background Fetch now provides a scheduleTask method for scheduling arbitrary "one-shot" or periodic tasks.

iOS

  • There is no way to increase the rate which a fetch-event occurs and this plugin sets the rate to the most frequent possible — you will never receive an event faster than 15 minutes. The operating-system will automatically throttle the rate the background-fetch events occur based upon usage patterns. Eg: if user hasn't turned on their phone for a long period of time, fetch events will occur less frequently.
  • scheduleTask seems only to fire when the device is plugged into power.
  • ⚠️ When your app is terminated, iOS no longer fires events — There is no such thing as stopOnTerminate: false for iOS.
  • iOS can take days before Apple's machine-learning algorithm settles in and begins regularly firing events. Do not sit staring at your logs waiting for an event to fire. If your simulated events work, that's all you need to know that everything is correctly configured.
  • If the user doesn't open your iOS app for long periods of time, iOS will stop firing events.

Android


Contents


Installing the plugin

⚠️ If you have a previous version of react-native-background-fetch < 2.7.0 installed into react-native >= 0.60, you should first unlink your previous version as react-native link is no longer required.

$ react-native unlink react-native-background-fetch

With yarn

$ yarn add react-native-background-fetch

With npm

$ npm install --save react-native-background-fetch

Setup Guides

iOS Setup

react-native >= 0.60

Android Setup

react-native >= 0.60

Example

ℹ️ This repo contains its own Example App. See /example

import React from 'react';
import {
  SafeAreaView,
  StyleSheet,
  ScrollView,
  View,
  Text,
  FlatList,
  StatusBar,
} from 'react-native';

import {
  Header,
  Colors
} from 'react-native/Libraries/NewAppScreen';

import BackgroundFetch from "react-native-background-fetch";

class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      events: []
    };
  }

  componentDidMount() {
    // Initialize BackgroundFetch ONLY ONCE when component mounts.
    this.initBackgroundFetch();
  }

  async initBackgroundFetch() {
    // BackgroundFetch event handler.
    const onEvent = async (taskId) => {
      console.log('[BackgroundFetch] task: ', taskId);
      // Do your background work...
      await this.addEvent(taskId);
      // IMPORTANT:  You must signal to the OS that your task is complete.
      BackgroundFetch.finish(taskId);
    }

    // Timeout callback is executed when your Task has exceeded its allowed running-time.
    // You must stop what you're doing immediately BackgorundFetch.finish(taskId)
    const onTimeout = async (taskId) => {
      console.warn('[BackgroundFetch] TIMEOUT task: ', taskId);
      BackgroundFetch.finish(taskId);
    }

    // Initialize BackgroundFetch only once when component mounts.
    let status = await BackgroundFetch.configure({minimumFetchInterval: 15}, onEvent, onTimeout);

    console.log('[BackgroundFetch] configure status: ', status);
  }

  // Add a BackgroundFetch event to <FlatList>
  addEvent(taskId) {
    // Simulate a possibly long-running asynchronous task with a Promise.
    return new Promise((resolve, reject) => {
      this.setState(state => ({
        events: [...state.events, {
          taskId: taskId,
          timestamp: (new Date()).toString()
        }]
      }));
      resolve();
    });
  }

  render() {
    return (
      <>
        <StatusBar barStyle="dark-content" />
        <SafeAreaView>
          <ScrollView
            contentInsetAdjustmentBehavior="automatic"
            style={styles.scrollView}>
            <Header />

            <View style={styles.body}>
              <View style={styles.sectionContainer}>
                <Text style={styles.sectionTitle}>BackgroundFetch Demo</Text>
              </View>
            </View>
          </ScrollView>
          <View style={styles.sectionContainer}>
            <FlatList
              data={this.state.events}
              renderItem={({item}) => (<Text>[{item.taskId}]: {item.timestamp}</Text>)}
              keyExtractor={item => item.timestamp}
            />
          </View>
        </SafeAreaView>
      </>
    );
  }
}

const styles = StyleSheet.create({
  scrollView: {
    backgroundColor: Colors.lighter,
  },
  body: {
    backgroundColor: Colors.white,
  },
  sectionContainer: {
    marginTop: 32,
    paddingHorizontal: 24,
  },
  sectionTitle: {
    fontSize: 24,
    fontWeight: '600',
    color: Colors.black,
  },
  sectionDescription: {
    marginTop: 8,
    fontSize: 18,
    fontWeight: '400',
    color: Colors.dark,
  },
});

export default App;

Executing Custom Tasks

In addition to the default background-fetch task defined by BackgroundFetch.configure, you may also execute your own arbitrary "oneshot" or periodic tasks (iOS requires additional Setup Instructions). However, all events will be fired into the Callback provided to BackgroundFetch#configure:

⚠️ iOS:

  • scheduleTask on iOS seems only to run when the device is plugged into power.
  • scheduleTask on iOS are designed for low-priority tasks, such as purging cache files — they tend to be unreliable for mission-critical tasks. scheduleTask will never run as frequently as you want.
  • The default fetch event is much more reliable and fires far more often.
  • scheduleTask on iOS stop when the user terminates the app. There is no such thing as stopOnTerminate: false for iOS.
// Step 1:  Configure BackgroundFetch as usual.
let status = await BackgroundFetch.configure({
  minimumFetchInterval: 15
}, async (taskId) => {  // <-- Event callback
  // This is the fetch-event callback.
  console.log("[BackgroundFetch] taskId: ", taskId);

  // Use a switch statement to route task-handling.
  switch (taskId) {
    case 'com.foo.customtask':
      print("Received custom task");
      break;
    default:
      print("Default fetch task");
  }
  // Finish, providing received taskId.
  BackgroundFetch.finish(taskId);
}, async (taskId) => {  // <-- Task timeout callback
  // This task has exceeded its allowed running-time.
  // You must stop what you're doing and immediately .finish(taskId)
  BackgroundFetch.finish(taskId);
});

// Step 2:  Schedule a custom "oneshot" task "com.foo.customtask" to execute 5000ms from now.
BackgroundFetch.scheduleTask({
  taskId: "com.foo.customtask",
  forceAlarmManager: true,
  delay: 5000  // <-- milliseconds
});

API Documentation

Config

Common Options

@param {Integer} minimumFetchInterval [15]

The minimum interval in minutes to execute background fetch events. Defaults to 15 minutes. Note: Background-fetch events will never occur at a frequency higher than every 15 minutes. Apple uses a secret algorithm to adjust the frequency of fetch events, presumably based upon usage patterns of the app. Fetch events can occur less often than your configured minimumFetchInterval.

@param {Integer} delay (milliseconds)

ℹ️ Valid only for BackgroundFetch.scheduleTask. The minimum number of milliseconds in future that task should execute.

@param {Boolean} periodic [false]

ℹ️ Valid only for BackgroundFetch.scheduleTask. Defaults to false. Set true to execute the task repeatedly. When false, the task will execute just once.

Android Options

@config {Boolean} stopOnTerminate [true]

Set false to continue background-fetch events after user terminates the app. Default to true.

@config {Boolean} startOnBoot [false]

Set true to initiate background-fetch events when the device is rebooted. Defaults to false.

NOTE: startOnBoot requires stopOnTerminate: false.

@config {Boolean} forceAlarmManager [false]

By default, the plugin will use Android's JobScheduler when possible. The JobScheduler API prioritizes for battery-life, throttling task-execution based upon device usage and battery level.

Configuring forceAlarmManager: true will bypass JobScheduler to use Android's older AlarmManager API, resulting in more accurate task-execution at the cost of higher battery usage.

let status = await BackgroundFetch.configure({
  minimumFetchInterval: 15,
  forceAlarmManager: true
}, async (taskId) => {  // <-- Event callback
  console.log("[BackgroundFetch] taskId: ", taskId);
  BackgroundFetch.finish(taskId);
}, async (taskId) => {  // <-- Task timeout callback
  // This task has exceeded its allowed running-time.
  // You must stop what you're doing and immediately .finish(taskId)
  BackgroundFetch.finish(taskId);
});
.
.
.
// And with with #scheduleTask
BackgroundFetch.scheduleTask({
  taskId: 'com.foo.customtask',
  delay: 5000,       // milliseconds
  forceAlarmManager: true,
  periodic: false
});

@config {Boolean} enableHeadless [false]

Set true to enable React Native's Headless JS mechanism, for handling fetch events after app termination.

  • 📂 index.js (MUST BE IN index.js):
import BackgroundFetch from "react-native-background-fetch";

let MyHeadlessTask = async (event) => {
  // Get task id from event {}:
  let taskId = event.taskId;
  let isTimeout = event.timeout;  // <-- true when your background-time has expired.
  if (isTimeout) {
    // This task has exceeded its allowed running-time.
    // You must stop what you're doing immediately finish(taskId)
    console.log('[BackgroundFetch] Headless TIMEOUT:', taskId);
    BackgroundFetch.finish(taskId);
    return;
  }
  console.log('[BackgroundFetch HeadlessTask] start: ', taskId);

  // Perform an example HTTP request.
  // Important:  await asychronous tasks when using HeadlessJS.
  let response = await fetch('https://facebook.github.io/react-native/movies.json');
  let responseJson = await response.json();
  console.log('[BackgroundFetch HeadlessTask] response: ', responseJson);

  // Required:  Signal to native code that your task is complete.
  // If you don't do this, your app could be terminated and/or assigned
  // battery-blame for consuming too much time in background.
  BackgroundFetch.finish(taskId);
}

// Register your BackgroundFetch HeadlessTask
BackgroundFetch.registerHeadlessTask(MyHeadlessTask);

@config {integer} requiredNetworkType [BackgroundFetch.NETWORK_TYPE_NONE]

Set basic description of the kind of network your job requires.

If your job doesn't need a network connection, you don't need to use this option as the default value is BackgroundFetch.NETWORK_TYPE_NONE.

NetworkType Description
BackgroundFetch.NETWORK_TYPE_NONE This job doesn't care about network constraints, either any or none.
BackgroundFetch.NETWORK_TYPE_ANY This job requires network connectivity.
BackgroundFetch.NETWORK_TYPE_CELLULAR This job requires network connectivity that is a cellular network.
BackgroundFetch.NETWORK_TYPE_UNMETERED This job requires network connectivity that is unmetered. Most WiFi networks are unmetered, as in "you can upload as much as you like".
BackgroundFetch.NETWORK_TYPE_NOT_ROAMING This job requires network connectivity that is not roaming (being outside the country of origin)

@config {Boolean} requiresBatteryNotLow [false]

Specify that to run this job, the device's battery level must not be low.

This defaults to false. If true, the job will only run when the battery level is not low, which is generally the point where the user is given a "low battery" warning.

@config {Boolean} requiresStorageNotLow [false]

Specify that to run this job, the device's available storage must not be low.

This defaults to false. If true, the job will only run when the device is not in a low storage state, which is generally the point where the user is given a "low storage" warning.

@config {Boolean} requiresCharging [false]

Specify that to run this job, the device must be charging (or be a non-battery-powered device connected to permanent power, such as Android TV devices). This defaults to false.

@config {Boolean} requiresDeviceIdle [false]

When set true, ensure that this job will not run if the device is in active use.

The default state is false: that is, the for the job to be runnable even when someone is interacting with the device.

This state is a loose definition provided by the system. In general, it means that the device is not currently being used interactively, and has not been in use for some time. As such, it is a good time to perform resource heavy jobs. Bear in mind that battery usage will still be attributed to your application, and shown to the user in battery stats.


Methods

Method Name Arguments Returns Notes
configure {FetchConfig}, callbackFn, timeoutFn Promise<BackgroundFetchStatus> Configures the plugin's callbackFn and timeoutFn. This callback will fire each time a background-fetch event occurs in addition to events from #scheduleTask. The timeoutFn will be called when the OS reports your task is nearing the end of its allowed background-time.
scheduleTask {TaskConfig} Promise<boolean> Executes a custom task. The task will be executed in the same Callback function provided to #configure.
status callbackFn Promise<BackgroundFetchStatus> Your callback will be executed with the current status (Integer) 0: Restricted, 1: Denied, 2: Available. These constants are defined as BackgroundFetch.STATUS_RESTRICTED, BackgroundFetch.STATUS_DENIED, BackgroundFetch.STATUS_AVAILABLE (NOTE: Android will always return STATUS_AVAILABLE)
finish String taskId Void You MUST call this method in your callbackFn provided to #configure in order to signal to the OS that your task is complete. iOS provides only 30s of background-time for a fetch-event -- if you exceed this 30s, iOS will kill your app.
start none Promise<BackgroundFetchStatus> Start the background-fetch API. Your callbackFn provided to #configure will be executed each time a background-fetch event occurs. NOTE the #configure method automatically calls #start. You do not have to call this method after you #configure the plugin
stop [taskId:String] Promise<boolean> Stop the background-fetch API and all #scheduleTask from firing events. Your callbackFn provided to #configure will no longer be executed. If you provide an optional taskId, only that #scheduleTask will be stopped.

Debugging

iOS

🆕 BGTaskScheduler API for iOS 13+

  • ⚠️ At the time of writing, the new task simulator does not yet work in Simulator; Only real devices.
  • See Apple docs Starting and Terminating Tasks During Development
  • After running your app in XCode, Click the [||] button to initiate a Breakpoint.
  • In the console (lldb), paste the following command (Note: use cursor up/down keys to cycle through previously run commands):
e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"com.transistorsoft.fetch"]
  • Click the [ > ] button to continue. The task will execute and the Callback function provided to BackgroundFetch.configure will receive the event.

Simulating task-timeout events

  • Only the new BGTaskScheduler api supports simulated task-timeout events. To simulate a task-timeout, your fetchCallback must not call BackgroundFetch.finish(taskId):
let status = await BackgroundFetch.configure({
  minimumFetchInterval: 15
}, async (taskId) => {  // <-- Event callback.
  // This is the task callback.
  console.log("[BackgroundFetch] taskId", taskId);
  //BackgroundFetch.finish(taskId); // <-- Disable .finish(taskId) when simulating an iOS task timeout
}, async (taskId) => {  // <-- Event timeout callback
  // This task has exceeded its allowed running-time.
  // You must stop what you're doing and immediately .finish(taskId)
  print("[BackgroundFetch] TIMEOUT taskId:", taskId);
  BackgroundFetch.finish(taskId);
});
  • Now simulate an iOS task timeout as follows, in the same manner as simulating an event above:
e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateExpirationForTaskWithIdentifier:@"com.transistorsoft.fetch"]

Old BackgroundFetch API

  • Simulate background fetch events in XCode using Debug->Simulate Background Fetch
  • iOS can take some hours or even days to start a consistently scheduling background-fetch events since iOS schedules fetch events based upon the user's patterns of activity. If Simulate Background Fetch works, your can be sure that everything is working fine. You just need to wait.

Android

  • Observe plugin logs in $ adb logcat:
$ adb logcat *:S ReactNative:V ReactNativeJS:V TSBackgroundFetch:V
  • Simulate a background-fetch event on a device (insert <your.application.id>) (only works for sdk 21+:
$ adb shell cmd jobscheduler run -f <your.application.id> 999
  • For devices with sdk <21, simulate a "Headless JS" event with (insert <your.application.id>)
$ adb shell am broadcast -a <your.application.id>.event.BACKGROUND_FETCH

Licence

The MIT License

Copyright (c) 2013 Chris Scott, Transistor Software [email protected] http://transistorsoft.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • News: BackgroundTasks are coming to iOS

    News: BackgroundTasks are coming to iOS

    Available for following:

    • iOS 13.0+Beta
    • UIKit for Mac 13.0+Beta
    • tvOS 13.0+Beta

    BackgroundTasks Request the system to launch your app in the background to run tasks.

    Overview Use the BackgroundTasks framework to keep your app content up to date and run tasks requiring minutes to complete while your app is in the background. Longer tasks can optionally require a powered device and network connectivity.

    Register launch handlers for tasks when the app launches and schedule them as required. The system will launch your app in the background and execute the tasks.

    Read more: https://developer.apple.com/documentation/backgroundtasks

    enhancement 
    opened by atulmy 54
  • Background Fetch Not Working [IOS]

    Background Fetch Not Working [IOS]

    Your Environment

    • Plugin version: 3.0.3
    • Platform: iOS
    • OS version: 13.2.3
    • Device manufacturer / model: 11 Pro
    • React Native version (react-native -v): 0.61.5
    • Plugin config just timere 15

    Expected Behavior

    Work on background

    Actual Behavior

    When close app console says and not working on background. Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

    Steps to Reproduce

    1. start app
    2. background Fetch config started on componentDidMount
    3. Closed app
    4. And error fired

    Context

    Work on background fetch

    Debug logs

    Your Environment

    • Plugin version: npm v3.0.6
    • Platform: iOS
    • OS version: iOS 13.3
    • Device manufacturer / model: iPhone 7 Plus
    • React Native version (react-native -v): ~0.61.5
    • Plugin config

    Expected Behavior

    This is a great tool and Chris has been super helpful in relaying his thoughts on our challenges! We are hopeful to have the below issues resolved and think it might just be a configuration issue. However, just to be sure, we have included the following information about our integration of the plugin with our application:

    The expected behavior of our application is to launch the BackgroundFetch task on start of our application and to see that it is launched in the background.

    We have added the HeadlessJS functionality to our application as well (which we understand takes a few hours to confirm it's working) as our task requires the app to function even when the program is terminated by the user.

    Please see our code below:

    ` // This is a react-native application using React Hooks/JS. The useEffect below acts similarly to // 'componentDidMount' in traditional React

    useEffect(() => { /* 1. Wire up event listeners for background fetching of location 2. Execute #ready method 3. Start tracking location */

    BackgroundGeolocation.ready({
      // Geolocation Config
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      distanceFilter: 10,
      // Activity Recognition
      stopTimeout: 1,
      // Application config
      debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
      //logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      foregroundService: true,
      stopOnTerminate: false,   // <-- Allow the background-service to continue tracking when user closes the app.
      startOnBoot: true,        // <-- Auto start tracking when device is powered-up.
      enableHeadless: true,
      batchSync: false,       // <-- [Default: false] Set true to sync locations to server in a single HTTP request.
      autoSync: true,         // <-- [Default: true] Set true to sync each location to server as it arrives.
    }, (state) => {
      console.log("- BackgroundGeolocation is configured and ready: ", state.enabled);
    
      if (!state.enabled) {
        ////
        // 3. Start tracking!
        //
        BackgroundGeolocation.start(function() {
          console.log("- Start success");
        });
      }
    });
    

    BackgroundFetch.configure({ minimumFetchInterval: 15, // <-- minutes (15 is minimum allowed) // Android options forceAlarmManager: false, // <-- Set true to bypass JobScheduler. stopOnTerminate: false, startOnBoot: true, requiredNetworkType: BackgroundFetch.NETWORK_TYPE_NONE, // Default requiresCharging: false, // Default requiresDeviceIdle: false, // Default requiresBatteryNotLow: false, // Default requiresStorageNotLow: false // Default }, async (taskId) => { console.log("[js] Received background-fetch event: ", taskId); // Required: Signal completion of your task to native code // If you fail to do this, the OS can terminate your app // or assign battery-blame for consuming too much background-time BackgroundFetch.finish(taskId); }, (error) => { console.log("[js] RNBackgroundFetch failed to start"); });

    BackgroundFetch.status((status) => {
      switch(status) {
        case BackgroundFetch.STATUS_RESTRICTED:
          console.log("BackgroundFetch restricted");
          break;
        case BackgroundFetch.STATUS_DENIED:
          console.log("BackgroundFetch denied");
          break;
        case BackgroundFetch.STATUS_AVAILABLE:
          console.log("BackgroundFetch is enabled");
          break;
      }
    });
    
    let MyHeadlessTask = async (event) => {
      let location = await BackgroundGeolocation.getCurrentPosition({persist: true, samples:1, extras: {'context': 'background-fetch-position'}});
      
      // Await for location before post request
      if (location !== undefined && location !== null) {
        let currentTime = new Date();
        setUserCoordinates(location);
        setTimeStamp(currentTime)
    
        **console.log("This is the current location: ", location)
        console.log("This is the current time: ", currentTime)**
        
        try {
          axios.post('/api/ping', {
            coordinates: userCoordinates,
            time: timeStamp
          })
          .then(response => {
            console.log(response)
          })
          .catch(error => {
            console.log(error)
          })
        } catch (err) {
          console.log(err)
        }
      }
     
      BackgroundFetch.finish();
    }
     
    // Register your BackgroundFetch HeadlessTask
    BackgroundFetch.registerHeadlessTask(MyHeadlessTask);
    

    }, []); `

    Actual Behavior

    The expected behavior when running our application on our physical device is to see the same LOGs as when we run our application through an XCode device emulator.

    Our emulator is set up with the following:

    • Plugin version: npm v3.0.6
    • Platform: iOS
    • OS version: iOS 13.5
    • Device manufacturer / model: iPhone 11
    • React Native version (react-native -v): ~0.61.5

    When we run our device through our XCode emulator for our iPhone 11, we see the following terminal logs:

    image

    LOG: BackgroundGeolocation is configured and ready: true **LOG: BackgroundFetch is enabled **

    Versus, when we launch the app through XCode to our physical iPhone 7 device, we see these following logs instead:

    image

    LOG: BackgroundGeolocation is configured and ready: true LOG: [js] RNBackgroundFetch failed to start LOG: BackgroundFetch denied

    Steps to Reproduce

    Context

    We are expecting our application send a user's geolocation to our defined server route every 15 minutes as shown above.

    Our expectation is to also see logs of the user's current location and a timestamp as well - as shown above in the two console logs:

    console.log("This is the current location: ", location)
    console.log("This is the current time: ", currentTime)

    Debug logs

    The following are the debug logs related to launching our application on our physical iPhone 7 device:

    2020-06-05 11:06:04.050636-0400 coverSeven[2350:848752] [TSBackgroundFetch load]: ( ) 2020-06-05 11:06:04.051116-0400 coverSeven[2350:848752] [TSBGAppRefreshSubscriber load]: { TSLocationManager = ""; "react-native-background-fetch" = ""; } 2020-06-05 11:06:04.293 [info][tid:main][RCTRootView.m:293] Running application main ({ initialProps = { }; rootTag = 1; }) 2020-06-05 11:06:04.551970-0400 coverSeven[2350:848975] [] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused] 2020-06-05 11:06:04.553652-0400 coverSeven[2350:848975] [] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused] 2020-06-05 11:06:04.557287-0400 coverSeven[2350:848974] [] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection 2020-06-05 11:06:04.557345-0400 coverSeven[2350:848974] TCP Conn 0x2827a6dc0 Failed : error 0:61 [61] 2020-06-05 11:06:25.646 [info][tid:com.facebook.react.JavaScript] Running "main" with {"rootTag":1,"initialProps":{}} 2020-06-05 11:06:25.669784-0400 coverSeven[2350:848978] [] nw_socket_handle_socket_event [C5:1] Socket SO_ERROR [61: Connection refused] 2020-06-05 11:06:25.670125-0400 coverSeven[2350:848992] [] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection 2020-06-05 11:06:25.670516-0400 coverSeven[2350:848992] TCP Conn 0x2827a8b40 Failed : error 0:61 [61] 2020-06-05 11:06:25.758778-0400 coverSeven[2350:848752] - RNBackgroundFetch failed to start, status: 1 2020-06-05 11:06:25.965 [info][tid:com.facebook.react.JavaScript] '- BackgroundGeolocation is configured and ready: ', true 2020-06-05 11:06:25.973 [info][tid:main][RNGestureHandlerManager.m:136] [GESTURE HANDLER] Initialize gesture handler for root view <RCTRootContentView: 0x10720b970; reactTag: 1; frame = (0 0; 375 667); gestureRecognizers = <NSArray: 0x281cc05d0>; layer = <CALayer: 0x2812beea0>> 2020-06-05 11:06:25.994 [info][tid:com.facebook.react.JavaScript] [js] RNBackgroundFetch failed to start 2020-06-05 11:06:25.994 [info][tid:com.facebook.react.JavaScript] BackgroundFetch denied 2020-06-05 11:06:26.228629-0400 coverSeven[2350:848994] Metal GPU Frame Capture Enabled CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/92634CF4-9D70-4DB8-8122-F6B5D28B709E/coverSeven.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo' 2020-06-05 11:06:26.267124-0400 coverSeven[2350:848994] Metal API Validation Enabled 2020-06-05 11:06:26.269768-0400 coverSeven[2350:848978] [error] fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable. CoreData: fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable. 2020-06-05 11:06:26.297535-0400 coverSeven[2350:848978] [error] CoreData: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable. CoreData: warning: Property 'value' on Entity 'GMSCacheProperty' is using nil or an insecure NSValueTransformer. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/92634CF4-9D70-4DB8-8122-F6B5D28B709E/coverSeven.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo' CoreData: warning: Property 'value' on Entity 'GMSCacheProperty' is using nil or an insecure NSValueTransformer. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/92634CF4-9D70-4DB8-8122-F6B5D28B709E/coverSeven.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo' CoreData: warning: Property 'value' on Entity 'GMSCacheProperty' is using nil or an insecure NSValueTransformer. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. 2020-06-05 11:30:42.487116-0400 coverSeven[2350:848752] Can't end BackgroundTask: no background task exists with identifier 12 (0xc), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

    stale 
    opened by jkeane889 35
  • IOS real device testing - not working

    IOS real device testing - not working

    Your Environment

    • Plugin version:2.6.1
    • Platform: iOS
    • OS version: 12.3.1
    • Device manufacturer / model: iPhone 7
    • React Native version (react-native -v): 0.59.9
    • Plugin config
    BackgroundFetch.configure({
          minimumFetchInterval: 15, // <-- minutes (15 is minimum allowed)
          stopOnTerminate: false,   // <-- Android-only,
          startOnBoot: true,        // <-- Android-only
          enableHeadless: true
        }
    

    Hello,

    I've been testing this on the simulator for a long time (with the simulate background fetch option) with success. However, I can't seem to get the background fetch to fire on a real device (see device above).

    With the device plugged in, I can still fire the background fetch from xcode successfully, so this tells me everything is working fine. On the hand, if I leave the device unplugged with a release build, it doesn't seem to fire at all. I've left the device overnight and background fetch didn't fire once.

    Lastly, background fetch is enabled on the app if we go to settings.

    Any hints? Did I miss something to make it work on a real device without simulating it?

    opened by cristianoccazinsp 31
  • Build error: Execution failed for task ':react-native-background-task:processReleaseResources'.

    Build error: Execution failed for task ':react-native-background-task:processReleaseResources'.

    Your Environment

    • Plugin version: [email protected]
    • Platform: iOS or Android: Android
    • OS version: Ubuntu 16.04
    • Device manufacturer / model: N/A
    • React Native version (react-native -v): react-native-cli: 2.0.1 react-native: 0.56.0
    • Plugin config
    allprojects {
        repositories {
            mavenLocal()
            jcenter()
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url "$rootDir/../node_modules/react-native/android"
            }
            maven {
                url 'https://maven.google.com/'
                name 'Google'
            }
    
            maven {
               url "$rootDir/../node_modules/react-native-background-fetch/android/libs"
            }
        }
    }
    

    Expected Behavior

    It should compile

    Actual Behavior

    It does not compile

    Steps to Reproduce

    1. cd AwesomeProject/
    2. npm i react-native-queue
    3. react-native link realm
    4. npm i react-native-background-task
    5. react-native link react-native-background-task
    6. npm i react-native-background-fetch
    7. react-native link react-native-background-fetch
    8. npm install
    9. react-native run-android

    Context

    Test this module

    Debug logs

    /home/rob/AwesomeProject/node_modules/react-native-background-task/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

    /home/rob/AwesomeProject/node_modules/react-native-background-task/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:4: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

    /home/rob/AwesomeProject/node_modules/react-native-background-task/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

    /home/rob/AwesomeProject/node_modules/react-native-background-task/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

    /home/rob/AwesomeProject/node_modules/react-native-background-task/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

    /home/rob/AwesomeProject/node_modules/react-native-background-task/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

    • What went wrong: Execution failed for task ':react-native-background-task:processReleaseResources'.

    com.android.ide.common.process.ProcessException: Failed to execute aapt

    opened by robertclarkson 28
  • BackgroundFetch is not working when the app is Minimized or Terminated

    BackgroundFetch is not working when the app is Minimized or Terminated

    Your Environment

    • Plugin version: 3.0.4
    • Platform: iOS & Android
    • OS version:
    • Device manufacturer / model: Simulator
    • React Native version (react-native -v): 0.60
    • Plugin config

    Expected Behavior

    BackgroundFetch should work when the app is in Foreground, Minimized and Terminated mode.

    Actual Behavior

    BackgroundFetch is working only when the app is in Foreground but it is not working when the app is Minimized or Terminated mode.

    Steps to Reproduce

    Context

    Debug logs

    opened by anandtechmedia 27
  • Not able to run on iOS

    Not able to run on iOS

    Your Environment

    • Plugin version: 3.0.3
    • Platform: iOS
    • OS version: 12 - 13
    • React Native version: 0.61.5
    • Plugin config

    Expected Behavior

    What I expect is the ability to update my app in background on iOS and Android.

    Actual Behavior

    Currently, the background fetch works for Android without any problems. But we were never able to do the same for iOS.

    I started to work on it with the 2.7.0. When I Simulate Background Fetch everything was good. But in the facts, on real devices, even after several weeks/months, any background fetch doesn't seems to fire.

    So when I saw that a 3.0.0 was released I tryed to test it. But I faced some other problems. I have follow the new iOS setup but without any success, even worse. Simulate Background Fetch doesn't work anymore and all I get is that XCode error:

    2020-02-24 10:10:41.862467+0100 united-dev[45458:18364223] [TSBackgroundFetch performFetchWithCompletionHandler] 2020-02-24 10:10:41.862564+0100 united-dev[45458:18364223] [TSBackgroundFetch scheduleBGAppRefresh] com.transistorsoft.fetch 2020-02-24 10:10:41.862707+0100 united-dev[45458:18364223] Warning: Application delegate received call to -application:performFetchWithCompletionHandler: but the completion handler was never called.

    I don't know what the problem is :/

    opened by voortexx 27
  • [Question] Timing out an async call

    [Question] Timing out an async call

    It is required behaviour on iOS to call the finish event within 30sec of starting the background fetch event. However, it is thinkable that my async call to the server does not receive a response (result or error) from the server within 30 seconds and the code keeps waiting, leading to the app being killed. Intuitively I would have used a javascript timeout (setTimeout), which calls the finish event after say 25 seconds. However, the timeout does not seem to work in background mode and the function defined in the timeout is only called once the app returns to foreground. How do you work around this issue? Or am I just not understanding something?

    Your Environment

    • Plugin version: 2.4.6
    • Platform: both
    • OS version: android 8, iOS 12
    • Device manufacturer / model: Samsung a3, iPhone SE
    • React Native version (react-native -v): 0.57.8
    • Plugin config

    Expected Behavior

    function defined in setTimeout is called after the defined time in background mode

    Actual Behavior

    function defined in setTimeout is called only when app returns to foreground

    Steps to Reproduce

    1. Define a timeout with setTimeout within the background fetch config
    2. Move app to background
    3. Fire a background fetch event
    4. Wait.. After waiting long enough, move app back to foreground, see function inside timeout being called

    Context

    Timeout async server calls so that iOS doesnt kill the app if server returns nothing within 30sec

    Debug logs

    N/A

    opened by jnurkka 26
  • Unable to run into android API 31

    Unable to run into android API 31

    I am getting below error while run/install application.

    Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

    Thanks

    opened by dinesh-fareye 23
  • App crashes : RNBackgroundFetch.configure got 2 arguments, expected 3

    App crashes : RNBackgroundFetch.configure got 2 arguments, expected 3

    Your Environment

    • Plugin version:4.1.1
    • Platform: Android
    • OS version:Android 10 and above
    • Device manufacturer / model:One plus
    • React Native version (react-native -v):0.63.2
    • Plugin config { minimumFetchInterval: 30, // <-- minutes ( minimum allowed) // Android options forceAlarmManager: true, // <-- Set true to bypass JobScheduler. stopOnTerminate: false, startOnBoot: true, enableHeadless: true, // periodic:false, requiredNetworkType: BackgroundFetch.NETWORK_TYPE_ANY, // Default requiresCharging: false, // Default requiresDeviceIdle: false, // Default requiresBatteryNotLow: false, // Default requiresStorageNotLow: false // Default },

    Expected Behavior

    App should not crash on start

    Actual Behavior

    App is crashing after splashscreen

    Steps to Reproduce

    Context

    i was trying build apk and run it in diff devices

    Debug logs

    2022-12-22 00:47:13.253 13374-13374/? E/sa.smartcontro: Unknown bits set in runtime_flags: 0x28000 2022-12-22 00:47:14.199 13374-15908/ae.adafsa.smartcontrol E/unknown:ReactNative: ReactInstanceManager.createReactContext: mJSIModulePackage null 2022-12-22 00:47:14.199 13374-15921/ae.adafsa.smartcontrol E/ReactNativeJNI: logMarker CREATE_REACT_CONTEXT_END 2022-12-22 00:47:14.227 13374-15921/ae.adafsa.smartcontrol E/ReactNativeJNI: logMarker RUN_JS_BUNDLE_START 2022-12-22 00:47:14.228 13374-15922/ae.adafsa.smartcontrol E/unknown:ReactNative: ReactInstanceManager.attachRootViewToInstance() 2022-12-22 00:47:14.485 13374-15922/ae.adafsa.smartcontrol E/unknown:ReactRootView: runApplication: call AppRegistry.runApplication 2022-12-22 00:47:14.656 13374-13374/ae.adafsa.smartcontrol E/unknown:ReactNative: Unable to launch logbox because react was unable to create the root view 2022-12-22 00:47:15.681 13374-13374/ae.adafsa.smartcontrol E/libc: Access denied finding property "ro.serialno" 2022-12-22 00:47:16.551 13374-15921/ae.adafsa.smartcontrol E/ReactNativeJNI: logMarker RUN_JS_BUNDLE_END 2022-12-22 00:47:16.836 13374-15922/ae.adafsa.smartcontrol E/unknown:ReactNative: CatalystInstanceImpl caught native exception com.facebook.react.bridge.NativeArgumentsParseException: RNBackgroundFetch.configure got 2 arguments, expected 3 at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:349) at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) at android.os.Looper.loop(Looper.java:214) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226) at java.lang.Thread.run(Thread.java:919) 2022-12-22 00:47:16.837 13374-15922/ae.adafsa.smartcontrol E/unknown:DisabledDevSupportManager: Caught exception com.facebook.react.bridge.NativeArgumentsParseException: RNBackgroundFetch.configure got 2 arguments, expected 3 at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:349) at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) at android.os.Looper.loop(Looper.java:214) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226) at java.lang.Thread.run(Thread.java:919)

    --------- beginning of crash
    

    2022-12-22 00:47:16.837 13374-15922/ae.adafsa.smartcontrol E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules Process: ae.adafsa.smartcontrol, PID: 13374 com.facebook.react.bridge.NativeArgumentsParseException: RNBackgroundFetch.configure got 2 arguments, expected 3 at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:349) at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) at android.os.Looper.loop(Looper.java:214) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226) at java.lang.Thread.run(Thread.java:919)

    opened by arshiyanaz 10
  • Bump decode-uri-component from 0.2.0 to 0.2.2 in /example

    Bump decode-uri-component from 0.2.0 to 0.2.2 in /example

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • react-native-background-fetch issue about: react-native-background-fetch:compileDebugJavaWithJavac

    react-native-background-fetch issue about: react-native-background-fetch:compileDebugJavaWithJavac

    react-native-background-fetch issue about: react-native-background-fetch:compileDebugJavaWithJavac

    • Plugin version: 4.1.5
    • Platform: Android
    • Device manufacturer / model: windows 10 -> android 12
    • React Native version (react-native -v): 0.61.5

    When I try to run app I'm getting error this suddenly started happens I changed minsdk: 30 to 31 for android releases and update react-native-background-fetch now I'm getting error

    error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 npm WARN config global --global, --local are deprecated. Use --location=global instead. C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:7: error: package com.facebook.react does not exist import com.facebook.react.ReactApplication; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:8: error: package com.facebook.react does not exist import com.facebook.react.ReactInstanceManager; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:9: error: package com.facebook.react does not exist import com.facebook.react.ReactNativeHost; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:10: error: package com.facebook.react.bridge does not exist import com.facebook.react.bridge.ReactContext; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:11: error: package com.facebook.react.bridge does not exist import com.facebook.react.bridge.UiThreadUtil; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:12: error: package com.facebook.react.bridge does not exist import com.facebook.react.bridge.WritableMap; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:13: error: package com.facebook.react.bridge does not exist import com.facebook.react.bridge.WritableNativeMap; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:14: error: package com.facebook.react.jstasks does not exist import com.facebook.react.jstasks.HeadlessJsTaskConfig; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:15: error: package com.facebook.react.jstasks does not exist import com.facebook.react.jstasks.HeadlessJsTaskContext; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:16: error: package com.facebook.react.jstasks does not exist import com.facebook.react.jstasks.HeadlessJsTaskEventListener; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:19: error: package com.facebook.react.common does not exist import com.facebook.react.common.LifecycleState; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:25: error: cannot find symbol public class HeadlessTask implements HeadlessJsTaskEventListener { ^ symbol: class HeadlessJsTaskEventListener C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:28: error: cannot find symbol private ReactNativeHost mReactNativeHost; ^ symbol: class ReactNativeHost location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:29: error: cannot find symbol private HeadlessJsTaskContext mActiveTaskContext; ^ symbol: class HeadlessJsTaskContext location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:68: error: cannot find symbol protected void startTask(final HeadlessJsTaskConfig taskConfig) { ^ symbol: class HeadlessJsTaskConfig location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:94: error: cannot find symbol private void invokeStartTask(ReactContext reactContext, final HeadlessJsTaskConfig taskConfig) { ^ symbol: class ReactContext location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:94: error: cannot find symbol private void invokeStartTask(ReactContext reactContext, final HeadlessJsTaskConfig taskConfig) { ^ symbol: class HeadlessJsTaskConfig location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:6: error: package com.facebook.react.bridge does not exist import com.facebook.react.bridge.*; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:7: error: package com.facebook.react.modules.core does not exist import com.facebook.react.modules.core.RCTNativeAppEventEmitter; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:11: error: cannot find symbol public class RNBackgroundFetchModule extends ReactContextBaseJavaModule implements ActivityEventListener, LifecycleEventListener { ^ symbol: class ReactContextBaseJavaModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:11: error: cannot find symbol public class RNBackgroundFetchModule extends ReactContextBaseJavaModule implements ActivityEventListener, LifecycleEventListener { ^ symbol: class ActivityEventListener C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:11: error: cannot find symbol public class RNBackgroundFetchModule extends ReactContextBaseJavaModule implements ActivityEventListener, LifecycleEventListener { ^ symbol: class LifecycleEventListener C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:21: error: cannot find symbol public RNBackgroundFetchModule(ReactApplicationContext reactContext) { ^ symbol: class ReactApplicationContext location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:34: error: cannot find symbol public void configure(ReadableMap options, final Callback success, final Callback failure) { ^ symbol: class ReadableMap location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:34: error: cannot find symbol public void configure(ReadableMap options, final Callback success, final Callback failure) { ^ symbol: class Callback location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:34: error: cannot find symbol public void configure(ReadableMap options, final Callback success, final Callback failure) { ^ symbol: class Callback location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:60: error: cannot find symbol public void scheduleTask(ReadableMap options, final Callback success, final Callback failure) { ^ symbol: class ReadableMap location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:60: error: cannot find symbol public void scheduleTask(ReadableMap options, final Callback success, final Callback failure) { ^ symbol: class Callback location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:60: error: cannot find symbol public void scheduleTask(ReadableMap options, final Callback success, final Callback failure) { ^ symbol: class Callback location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:67: error: cannot find symbol public void start(Callback success, Callback failure) { ^ symbol: class Callback location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:67: error: cannot find symbol public void start(Callback success, Callback failure) { ^ symbol: class Callback location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:74: error: cannot find symbol public void stop(String taskId, Callback success, Callback failure) { ^ symbol: class Callback location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:74: error: cannot find symbol public void stop(String taskId, Callback success, Callback failure) { ^ symbol: class Callback location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:82: error: cannot find symbol public void status(Callback success) { ^ symbol: class Callback location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:128: error: cannot find symbol private BackgroundFetchConfig.Builder buildConfig(ReadableMap options) { ^ symbol: class ReadableMap location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:3: error: package com.facebook.react does not exist import com.facebook.react.ReactPackage; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:4: error: package com.facebook.react.bridge does not exist import com.facebook.react.bridge.JavaScriptModule; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:5: error: package com.facebook.react.bridge does not exist import com.facebook.react.bridge.NativeModule; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:6: error: package com.facebook.react.bridge does not exist import com.facebook.react.bridge.ReactApplicationContext; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:7: error: package com.facebook.react.uimanager does not exist import com.facebook.react.uimanager.ViewManager; ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:13: error: cannot find symbol public class RNBackgroundFetchPackage implements ReactPackage { ^ symbol: class ReactPackage C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:15: error: cannot find symbol public List createNativeModules (ReactApplicationContext reactContext) { ^ symbol: class ReactApplicationContext location: class RNBackgroundFetchPackage C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:15: error: cannot find symbol public List createNativeModules (ReactApplicationContext reactContext) { ^ symbol: class NativeModule location: class RNBackgroundFetchPackage C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:21: error: cannot find symbol public List<Class<? extends JavaScriptModule>> createJSModules() { ^ symbol: class JavaScriptModule location: class RNBackgroundFetchPackage C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:26: error: cannot find symbol public List createViewManagers(ReactApplicationContext reactContext) { ^ symbol: class ReactApplicationContext location: class RNBackgroundFetchPackage C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:26: error: cannot find symbol public List createViewManagers(ReactApplicationContext reactContext) { ^ symbol: class ViewManager location: class RNBackgroundFetchPackage C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:33: error: cannot find symbol @ReactMethod ^ symbol: class ReactMethod location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:59: error: cannot find symbol @ReactMethod ^ symbol: class ReactMethod location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:66: error: cannot find symbol @ReactMethod ^ symbol: class ReactMethod location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:73: error: cannot find symbol @ReactMethod ^ symbol: class ReactMethod location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:81: error: cannot find symbol @ReactMethod ^ symbol: class ReactMethod location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:87: error: cannot find symbol @ReactMethod ^ symbol: class ReactMethod location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:93: error: cannot find symbol @ReactMethod ^ symbol: class ReactMethod location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:98: error: cannot find symbol @ReactMethod ^ symbol: class ReactMethod location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:33: error: cannot find symbol ReactApplication reactApplication = ((ReactApplication) context.getApplicationContext()); ^ symbol: class ReactApplication location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:33: error: cannot find symbol ReactApplication reactApplication = ((ReactApplication) context.getApplicationContext()); ^ symbol: class ReactApplication location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:39: error: cannot find symbol WritableMap clientEvent = new WritableNativeMap(); ^ symbol: class WritableMap location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:39: error: cannot find symbol WritableMap clientEvent = new WritableNativeMap(); ^ symbol: class WritableNativeMap location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:42: error: cannot find symbol HeadlessJsTaskConfig config = new HeadlessJsTaskConfig(HEADLESS_TASK_NAME, clientEvent, 30000); ^ symbol: class HeadlessJsTaskConfig location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:42: error: cannot find symbol HeadlessJsTaskConfig config = new HeadlessJsTaskConfig(HEADLESS_TASK_NAME, clientEvent, 30000); ^ symbol: class HeadlessJsTaskConfig location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:51: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:55: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:69: error: cannot find symbol UiThreadUtil.assertOnUiThread(); ^ symbol: variable UiThreadUtil location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:70: error: cannot find symbol final ReactInstanceManager reactInstanceManager = mReactNativeHost.getReactInstanceManager(); ^ symbol: class ReactInstanceManager location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:71: error: cannot find symbol ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); ^ symbol: class ReactContext location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:73: error: package ReactInstanceManager does not exist reactInstanceManager.addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener() { ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:95: error: cannot find symbol if (reactContext.getLifecycleState() == LifecycleState.RESUMED) { ^ symbol: variable LifecycleState location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:98: error: cannot find symbol final HeadlessJsTaskContext headlessJsTaskContext = HeadlessJsTaskContext.getInstance(reactContext); ^ symbol: class HeadlessJsTaskContext location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:98: error: cannot find symbol final HeadlessJsTaskContext headlessJsTaskContext = HeadlessJsTaskContext.getInstance(reactContext); ^ symbol: variable HeadlessJsTaskContext location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java:102: error: cannot find symbol UiThreadUtil.runOnUiThread(new Runnable() { ^ symbol: variable UiThreadUtil location: class HeadlessTask C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:26: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:39: error: cannot find symbol WritableMap params = new WritableNativeMap(); ^ symbol: class WritableMap C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:39: error: cannot find symbol WritableMap params = new WritableNativeMap(); ^ symbol: class WritableNativeMap C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:42: error: cannot find symbol getReactApplicationContext().getJSModule(RCTNativeAppEventEmitter.class).emit(EVENT_FETCH, params); ^ symbol: class RCTNativeAppEventEmitter C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:42: error: cannot find symbol getReactApplicationContext().getJSModule(RCTNativeAppEventEmitter.class).emit(EVENT_FETCH, params); ^ symbol: method getReactApplicationContext() C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:45: error: cannot find symbol WritableMap params = new WritableNativeMap(); ^ symbol: class WritableMap C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:45: error: cannot find symbol WritableMap params = new WritableNativeMap(); ^ symbol: class WritableNativeMap C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:48: error: cannot find symbol getReactApplicationContext().getJSModule(RCTNativeAppEventEmitter.class).emit(EVENT_FETCH, params); ^ symbol: class RCTNativeAppEventEmitter C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:48: error: cannot find symbol getReactApplicationContext().getJSModule(RCTNativeAppEventEmitter.class).emit(EVENT_FETCH, params); ^ symbol: method getReactApplicationContext() C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:103: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:110: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:114: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:118: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:123: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:174: error: cannot find symbol Activity activity = getCurrentActivity(); ^ symbol: method getCurrentActivity() location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchModule.java:182: error: cannot find symbol return BackgroundFetch.getInstance(getReactApplicationContext()); ^ symbol: method getReactApplicationContext() location: class RNBackgroundFetchModule C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:14: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:16: error: cannot find symbol List modules = new ArrayList<>(); ^ symbol: class NativeModule location: class RNBackgroundFetchPackage C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\RNBackgroundFetchPackage.java:25: error: method does not override or implement a method from a supertype @Override ^ Note: C:\Users\user\Desktop\projects\save2\visiongo\node_modules\react-native-background-fetch\android\src\main\java\com\transistorsoft\rnbackgroundfetch\HeadlessTask.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 89 errors

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':react-native-background-fetch:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    BUILD FAILED in 1m 9s at checkExecSyncError (node:child_process:828:11) at execFileSync (node:child_process:863:15) at runOnAllDevices (C:\Users\user\Desktop\projects\save2\visiongo\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39) at buildAndRun (C:\Users\user\Desktop\projects\save2\visiongo\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41) at C:\Users\user\Desktop\projects\save2\visiongo\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Command.handleAction (C:\Users\user\Desktop\projects\save2\visiongo\node_modules@react-native-community\cli\build\index.js:182:9) error Command failed with exit code 1.

    Android/build.gradle:

    buildscript { ext { buildToolsVersion = "29.0.2" minSdkVersion = 16 compileSdkVersion = 31 targetSdkVersion = 31 supportLibVersion = "28.0.0" androidMapsUtilsVersion = "0.5+" } repositories { google() mavenCentral() jcenter() } dependencies { classpath("com.android.tools.build:gradle:3.4.2") classpath 'com.google.gms:google-services:4.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } maven { // react-native-background-fetch url("${project(':react-native-background-fetch').projectDir}/libs") } google() jcenter() maven { url 'https://jitpack.io' } maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases' } } }

    opened by teriologia 11
  • No task request with identifier <decode: missing data> has been scheduled

    No task request with identifier has been scheduled

    Your Environment

    • Plugin version: 4.1.2
    • Platform: iOS
    • OS version: 16.0.2
    • Device manufacturer / model: iPhone
    • React Native version (react-native -v): "0.68.2"
    • Plugin config

    Expected Behavior

    The simulated background task runs.

    Actual Behavior

    The simulated background task never runs.

    Steps to Reproduce

    1. Check Fetch/Processing in capabilities file
    2. Added Transistorsoft string to plist
    3. Added changes to AppDelegate.m
    4. Added node_modules/react-native-background-fetch/ios/RNBackgroundFetch/RNBackgroundFetch+AppDelegate.m to project

    Context

    Simulate background task.

    Debug logs

    iOS

    (lldb) e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"com.transistorsoft.fetch"] 2022-10-11 17:33:48.620501-0700 RealityMaps[2318:156959] Simulating launch for task with identifier com.transistorsoft.fetch 2022-10-11 17:33:48.803767-0700 RealityMaps[2318:156959] Simulating launch for task with identifier com.transistorsoft.fetch 2022-10-11 17:33:51.256109-0700 RealityMaps[2318:157236] No task request with identifier <decode: missing data> has been scheduled 2022-10-11 17:33:51.256726-0700 RealityMaps[2318:157236] No task request with identifier <decode: missing data> has been scheduled

    opened by awcchungster 11
  • duplicate calls to background task

    duplicate calls to background task

    Your Environment

    • Plugin version: 4.1.1
    • Platform: Android
    • OS version: Android 9 (similar errors have been observed in versions up to 12, but not as clearly)
    • Device manufacturer / model: Redmi Note 8
    • React Native version (react-native -v): 0.68.2
    • Plugin config { minimumFetchInterval: 15, stopOnTerminate: false, startOnBoot: true, enableHeadless: true, requiredNetworkType: BackgroundFetch.NETWORK_TYPE_ANY }

    Expected Behavior

    The background task (onEvent handler) should be called only if BackgroundFetch.finish has been called, or if the method timed out (onTimeout handler).

    Actual Behavior

    On Android, it seems that the background task overtriggers. From our logs:

    2022-09-07T11:41:02.788000Z: headed-bg-task: finished with id react-native-background-fetch
    2022-09-07T11:41:02.840000Z: headed-bg-task: STARTING with id react-native-background-fetch
    2022-09-07T11:41:16.610000Z: headed-bg-task: finished with id react-native-background-fetch
    2022-09-07T11:56:22.012000Z: headed-bg-task: STARTING with id react-native-background-fetch
    2022-09-07T11:57:20.171000Z: headed-bg-task: timeout with id react-native-background-fetch
    2022-09-07T11:57:50.204000Z: headed-bg-task: STARTING with id react-native-background-fetch
    2022-09-07T11:58:50.205000Z: headed-bg-task: timeout with id react-native-background-fetch
    2022-09-07T11:58:50.259000Z: headed-bg-task: STARTING with id react-native-background-fetch
    2022-09-07T11:59:01.003000Z: headed-bg-task: finished with id react-native-background-fetch
    2022-09-07T11:59:02.323000Z: headed-bg-task: finished with id react-native-background-fetch
    

    Steps to Reproduce

    Unfortunately we have only been able to observe this issue in the wild.

    Context

    We use the background task to sync with the client, so it's problematic if the sync process is ran multiple times concurrently.

    Debug logs

    See above.

    opened by savv 0
  • Dynamic headless timeout

    Dynamic headless timeout

    Your Environment

    • Plugin version: 4.1.2
    • Platform: Android
    • OS version: 11
    • Device manufacturer/model: Xiaomi Poco F1
    • React Native version (react-native -v): 0.67.4
    • Plugin config
    {
          minimumFetchInterval: 15, // <-- minutes (15 is minimum allowed)
          stopOnTerminate: false,
          enableHeadless: true,
          startOnBoot: true,
          // Android options
          forceAlarmManager: false, // <-- Set true to bypass JobScheduler.
          requiredNetworkType: BackgroundFetch.NETWORK_TYPE_NONE, // Default
          requiresCharging: false, // Default
          requiresDeviceIdle: false, // Default
          requiresBatteryNotLow: false, // Default
          requiresStorageNotLow: false, // Default
     };
    

    Expected Behavior

    Have the ability to pass a dynamic value for the Headless timeout (see here)

    Actual Behavior

    Headless js is always initialized with a fixed timeout of 30s

    Steps to Reproduce

    N/A

    Context

    I have a long async operation that may take more than 30s to complete.

    Debug logs

    N/A

    opened by fmendoza 0
Owner
Transistor Software
Premium Software mobile software engineering consultants. Native geolocation specialists.
Transistor Software
Detects device type on both android and ios

React Native Device Specs RNDeviceSpecs detects the specifications of the device it is running on. Requiring or importing the module will give you an

Fixt 11 May 10, 2017
🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.

React Native Firebase React Native Firebase is a collection of official React Native modules connecting you to Firebase services; each module is a lig

Invertase 10.5k Jan 1, 2023
Use the built-in share view from iOS and Android to let the user share on Facebook and Twitter.

Use the built-in share view from iOS and Android to let the user share on Facebook and Twitter. It will use the user's existing account without having to get new authorizations. You can even preset text, image and link for the share view.

Kim Døfler 415 Oct 9, 2022
React Native ssl pinning and cookies handling based on okhttp3 on (Android). and AFNetworking on (iOS)

react-native-ssl-pinning React-Native ssl pinning & public key pinning using OkHttp 3 in Android, and AFNetworking on iOS. NOTES: for RN 0.60.0 or lat

Maxim Toyberman 260 Dec 19, 2022
Alarm clock functionality for react native ios and android using react-native-push-notification and react-native-community/async-storage

react-native-simple-alarm Alarm clock functionality for react native ios and android built using react-native-push-notification and react-native-commu

Jordan Daniels 74 Jan 6, 2023
Device Information for React Native iOS and Android

react-native-device-info Device Information for React Native. TOC Installation Linking Usage API Troubleshooting Release Notes react-native-dom / reac

null 6k Dec 31, 2022
An unified permissions API for React Native on iOS and Android

☝?? react-native-permissions A unified permissions API for React Native on iOS, Android and Windows. (For Windows only builds 18362 and later are supp

Mathieu Acthernoene 3.4k Jan 8, 2023
React native package to add in app review functionality for android and ios applications

react-native-in-app-review Now you can integrate this to react native and in-app review dialog can be shown to user. User doesn't need to move to play

Ravi Rupareliya 74 Nov 2, 2022
A cordova battery status listener for react-native, support for ios and android

React Native BatteryStatus (remobile) A cordova battery status listener for react-native, support for ios and android Installation npm install @remobi

YunJiang.Fang 14 Jan 28, 2020
Event Source implementation for React Native. Server-Sent Events (SSE) for iOS and Android 🚀

React Native EventSource (Server-Sent Events) ?? Your missing EventSource implementation for React Native! React-Native-SSE library supports TypeScrip

Binaryminds 52 Dec 16, 2022
React native geolocation service for iOS and android

React native geolocation service for iOS and android

Iftekhar Rifat 1.4k Jan 6, 2023
iOS CallKit framework and Android ConnectionService for React Native

iOS CallKit framework and Android ConnectionService for React Native

React Native WebRTC 736 Dec 29, 2022
React Native library for PSPDFKit for iOS, Android and Windows UWP.

React Native Library for PSPDFKit for iOS, Android & Windows UWP. (PDF SDK for React Native) This library requires a valid license of PSPDFKit. Licens

PSPDFKit GmbH 120 Dec 14, 2022
Understand and reduce your carbon footprint 🌱 iOS & Android.

?? NMF.earth app Understand and reduce your carbon footprint Repository for the NMF.earth React Native application, built with Expo, Redux Toolkit and

NMF.earth 364 Dec 27, 2022
Youtube Music Client for Android, iOS and Web

Youtube Music client for Android, iOS and Web built with React Native that allows you to listen to music from Youtube. You can download songs and list

Kevin Pfeifer 49 Jan 7, 2023
Fully customizable, easy to use checkbox with flexible component by React Native on Android and iOS

Installation Add the dependency: npm i react-native-checkbox-flex Peer Dependencies IMPORTANT! You need install them "@freakycoder/react-native-bounce

FreakyCoder 11 Nov 20, 2021
React-Native Haptic Feedback for iOS with Android similar behaviour.

react-native-haptic-feedback Contributions welcome Right now the Android implementation is a small Vibrate pattern, similar to the "feeling" of the iO

Junina 645 Jan 6, 2023
Secure Storage for React Native (Android & iOS)

RNSecureStorage Secure Storage for React Native (Android & iOS) - Keychain & Keystore v3.0.0-beta.0 This version still under development. But you can

Talut TASGIRAN 160 Dec 29, 2022
Get device heading information on iOS or Android

React Native Heading Get device heading information on iOS or Android What Report back device orientation in degrees, 0-360, with 0 being North. Examp

Yonah Forst 37 Nov 4, 2021