0.5.0 • Published 3 years ago

react-native-startup-trace v0.5.0

Weekly downloads
149
License
MIT
Repository
github
Last release
3 years ago

react-native-startup-trace

:warning: You need Firebase performance installed on your project See the Firebase docs

Getting started

$ npm install react-native-startup-trace --save

Usage

In ios/AppDelegate.m:

#import <StartupTrace.h>

...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
	...

	// After Firebase initialization
	[StartupPerformanceTrace start];

	...
	return YES;
}

In MainApplication.java

import tech.bam.rnperformance.startuptrace.StartupTraceModule;

	...

	@Override
  public void onCreate() {
      super.onCreate();
      SoLoader.init(this, /* native exopackage */ false);

      StartupTraceModule.start();
  }

In App.js

import { useStopStartupTrace } from 'react-native-startup-trace';

const App = () => {
	useStopStartupTrace();

	return (
		...
	)
};

Test it works

Android

Follow the Firebase Android doc step 4 to view the logs. Then run:

adb logcat | grep STARTUP_JS

And start the app.

You should see something similar to:

FirebasePerformance: Logging trace metric - STARTUP_JS 2423.1650ms
0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.0

4 years ago