React Native Module for umeng analytics
yarn add react-native-umeng-analytics-nevo
- init module (in Application.java)
...
import com.umengs.analytics.RNUMConfigure;
public class MainApplication extends Application {
...
@Override
public void onCreate() {
...
RNUMConfigure.init(this, "xxxx", "Umeng", UMConfigure.DEVICE_TYPE_PHONE, "");
}
}
- init MobclickAgent (in MainActivity.java)
...
import com.umeng.analytics.MobclickAgent;
public class MainActivity extends ReactActivity {
...
@Override
public void onResume() {
super.onResume();
MobclickAgent.onResume(this);
}
@Override
protected void onPause() {
super.onPause();
MobclickAgent.onPause(this);
}
}
pod install
- init module (in AppDelegate.m)
...
#import "RNUMConfigure.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
[RNUMConfigure initWithAppkey:@"xxxxx" channel:@"AppleStore"];
}
import Analytics from 'react-native-umeng-analytics-nevo';
Analytics.onPageEnd('LoginScreen');