OneSignal-iOS-SDK icon indicating copy to clipboard operation
OneSignal-iOS-SDK copied to clipboard

[Bug]: Background Task

Open Fontinhas opened this issue 3 years ago • 0 comments

What happened?

Getting a lot of log messages similar to the following

[BackgroundTask] Background Task 312 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.

[BackgroundTask] Background task still not ended after expiration handlers were called: <UIBackgroundTaskInfo: 0x280750a40>: taskID = 312, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943362 (elapsed = 38). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(:) to avoid this.

Steps to reproduce?

I integrated the latest OneSignal iOS SDK 3.12.3 via SPM and I'm getting a lot of these messages every time I open a push notification while the app is in background.

What did you expect to happen?

No messages on the console

OneSignal iOS SDK version

Release 3.12.3

iOS version

15

Specific iOS version

iOS 16.1.1

Relevant log output

2023-01-10 17:43:05.048243+0000 ProjectX[38194:10287612] [BackgroundTask] Background Task 171 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
2023-01-10 17:43:09.144539+0000 ProjectX[38194:10287612] [BackgroundTask] Background Task 196 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
2023-01-10 17:43:11.158852+0000 ProjectX[38194:10287612] [BackgroundTask] Background Task 220 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
2023-01-10 17:43:15.176915+0000 ProjectX[38194:10287612] [BackgroundTask] Background Task 262 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
2023-01-10 17:43:18.224591+0000 ProjectX[38194:10287612] [BackgroundTask] Background Task 289 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
2023-01-10 17:43:21.291059+0000 ProjectX[38194:10287612] [BackgroundTask] Background Task 312 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
2023-01-10 17:43:23.323893+0000 ProjectX[38194:10287612] [BackgroundTask] Background Task 337 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
2023-01-10 17:43:24.269878+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x2808a1b00>: taskID = 71, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943333 (elapsed = 67). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.269926+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x280750540>: taskID = 96, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943336 (elapsed = 64). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.269983+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x280757e00>: taskID = 121, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943339 (elapsed = 61). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.270078+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x28075ac00>: taskID = 145, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943342 (elapsed = 58). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.270137+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x280883b00>: taskID = 262, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943356 (elapsed = 44). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.271421+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x2808e8bc0>: taskID = 171, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943345 (elapsed = 55). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.271445+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x2808a34c0>: taskID = 196, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943349 (elapsed = 51). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.272151+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x280750a40>: taskID = 312, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943362 (elapsed = 38). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.272171+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x2807452c0>: taskID = 289, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943359 (elapsed = 41). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.273232+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x28071a940>: taskID = 337, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943364 (elapsed = 36). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.273252+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x28086fe40>: taskID = 220, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943352 (elapsed = 48). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.273277+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x28083b300>: taskID = 361, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943366 (elapsed = 34). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.273294+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x2808b87c0>: taskID = 42, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943329 (elapsed = 71). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:24.274127+0000 ProjectX[38194:10287612] [BackgroundTask] Background task still not ended after expiration handlers were called: <_UIBackgroundTaskInfo: 0x28076e740>: taskID = 387, taskName = Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask], creationTime = 943369 (elapsed = 31). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(_:) to avoid this.
2023-01-10 17:43:25.328916+0000 ProjectX[38194:10287612] [BackgroundTask] Background Task 361 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
2023-01-10 17:43:27.145648+0000 ProjectX[38194:10287784] Request <OSRequestOnFocus: 0x2812fcb10> success result {
    id = "7282cf89-9d5f-4193-bafd-9b5477a9e886";
    success = 1;
}
2023-01-10 17:43:28.334239+0000 ProjectX[38194:10287612] [BackgroundTask] Background Task 387 ("Called by OneSignal, from -[OSAttributedFocusTimeProcessor beginDelayBackgroundTask]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Fontinhas avatar Jan 10 '23 17:01 Fontinhas