- react-native: 0.59.10
npm install react-native-newrelic --save
https://docs.newrelic.com/docs/release-notes/mobile-release-notes/ios-release-notes/ios-agent-5142
- Use Finder to drag the
NewRelicAgent.framework
folder into your Xcode project, and drop it onto your project in the Project navigator window (inside theFrameworks
folder). - When prompted, select "Copy items into destination..." and "Create folder references...".
- Click on your Project in the Project Navigator window, under
Targets
select your app, and click theBuild Phases
tab. - Open the
Link Binary with Libraries
list. Click the plus sign and add these:
CoreTelephony.framework
SystemConfiguration.framework
libc++.tbd
libz.tbd
- Add
#import <NewRelicAgent/NewRelic.h>
. - Add this call as the first line of
application:didFinishLaunchingWithOptions
:
[NewRelicAgent startWithApplicationToken:@"<YOUR APP TOKEN>"];
Add the following to your app root (e.g. app.ios.js
):
import {default as newRelic} from 'react-native-newrelic';
newRelic.init({
overrideConsole: true,
reportUncaughtExceptions: true,
globalAttributes: {
'this-string': 'will be sent with every event that is being reported'
}
});