-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NR-199912: Background Instrumentation #192
Merged
cdillard-NewRelic
merged 14 commits into
develop
from
NR-199912-background-instrumentation
Apr 10, 2024
Merged
NR-199912: Background Instrumentation #192
cdillard-NewRelic
merged 14 commits into
develop
from
NR-199912-background-instrumentation
Apr 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using background tasks framework like my open Proof of Concept for iOS Background Instrumentation on iOS only guarantees that iOS will harvest in the background once per 24hr period. It’s kind of crappy but its the best guarantee we can get from iOS and background execution. |
… NR-199912-background-instrumentation
… NR-199912-background-instrumentation # Conflicts: # Agent/Public/NewRelicFeatureFlags.h
… NR-199912-background-instrumentation # Conflicts: # Agent/Public/NewRelicFeatureFlags.h
… NR-199912-background-instrumentation
… NR-199912-background-instrumentation
mbruin-NR
previously approved these changes
Mar 28, 2024
mbruin-NR
approved these changes
Apr 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
// NOTE: BackgroundReporting is only enabled for iOS 13+.
Accomplishes Acceptance Criteria of tickets:
https://new-relic.atlassian.net/browse/NR-238932
https://new-relic.atlassian.net/browse/NR-238931
Prerequisites in your iOS app project to use Background instrumentation
Add the key
Permitted background task scheduler identifiers
with an array including an item containing your apps bundle Id.Enable
Background Fetch
andBackground Processing
in the “Background Modes” section of the Xcode project capabilities.Run test harvest in background with:
replacing
com.newrelic.NRTestApp.bitcode
with your apps bundleId.Or Await the periodically occurring harvest in the background.
The exact frequency at which your tasks will run is determined by the system based on factors like device usage, batt life, and workloads. Therefore while we can request periodic execution , the system ultimately is the one that decides when to execute tasks. The background task will be run once per 24hr period.
In order to add BackgroundTasks to app you must add this to your AppDelegate.
Adds changes to NewRelicAgentInternal such that BackgroundTasks framework is interacted with and background task can be scheduled for harvest
Comments out following files as they are no longer used in our agent project.
Agent/HandledException/NRMAHexBackgroundUploader.h
Agent/HandledException/NRMASessionIdentifierManager.h
Tests/Unit-Tests/NewRelicAgentTests/Handled-Exception-Tests/TestSessionIdentifierManger.m