react-native-background-fetch icon indicating copy to clipboard operation
react-native-background-fetch copied to clipboard

[Bug]: iOS setup Error

Open rudda opened this issue 10 months ago • 6 comments

Required Reading

  • [x] Confirmed

Plugin Version

4.2.7

Mobile operating-system(s)

  • [x] iOS
  • [ ] Android

Device Manufacturer(s) and Model(s)

NA

Device operating-systems(s)

NA

React Native / Expo version

"react-native": "0.71.4"

What happened?

Error while running the initial setup for ios project. While I was performing this section: https://github.com/transistorsoft/react-native-background-fetch/blob/master/docs/INSTALL-AUTO-IOS.md#backgroundfetch-appdelegate-extension the flowwing error raises:

Image

My App seams not have a AppDelegate implementation, so due this reason, I had to import the file manually.

Please, can you help me with that question ?

Plugin Code and/or Config

NA

Relevant log output

PT-BR log:
"A operação não pôde ser concluída. Background procssing task was not registered in AppDelegate didFinishLaunchingWithOptions.  See iOS Setup Guide."

rudda avatar Feb 10 '25 03:02 rudda

My App seams not have a AppDelegate implementation, so due this reason, I had to import the file manually.

Every iOS app, pure native or otherwise, has an AppDelegate

christocracy avatar Feb 10 '25 03:02 christocracy

My App seams not have a AppDelegate implementation, so due this reason, I had to import the file manually.

Every iOS app, pure native or otherwise, has an AppDelegate

You are totally right, but I also had to add the following code below

 TSBackgroundFetch.sharedInstance().didFinishLaunching()

  TSBackgroundFetch.sharedInstance().registerBGProcessingTask("react-native-background-fetch")

        TSBackgroundFetch.sharedInstance().registerBGProcessingTask("CUSTOM_TASK_ID_HERE")

and I didn't see any of these codes in the documents

rudda avatar Feb 10 '25 04:02 rudda

You do not have to had anything not documented.

Show me your Info.plist

christocracy avatar Feb 10 '25 14:02 christocracy

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Mar 13 '25 02:03 github-actions[bot]

My App seams not have a AppDelegate implementation, so due this reason, I had to import the file manually.

Every iOS app, pure native or otherwise, has an AppDelegate

I upgraded my project from rn v0.76.7 to v0.78.0 as per react native upgrade helper. So, AppDelegate.h has been removed. Please provide me a solution.

AjayFrancisTechversant avatar Mar 13 '25 08:03 AjayFrancisTechversant

RN removed AppDelegate.h because they migrated to swift (ie AppDelegate.swift)

There is always an AppDelegate.

christocracy avatar Mar 13 '25 12:03 christocracy

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Apr 13 '25 02:04 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Apr 28 '25 02:04 github-actions[bot]