Git Product home page Git Product logo

baidumobstat-react-native's Introduction

baidumobstat-react-native

iOS

  • 新建一个React Native工程,参考React Native 官网

    react-native init hello
    cd hello
    yarn add baidumobstat-react-native
    react-native link
  • 在iOS工程的Linked Frameworks and Libraries, 加入以下依赖

     libz.tbd
     libc++.tbd
     libicucore.tbd
    
  • 在 iOS 工程中如果找不到头文件可能要在 TARGETS-> BUILD SETTINGS -> Search Paths -> Header Search Paths 添加如下路径

    $(SRCROOT)/../node_modules/jpush-react-native/ios/RCTJPushModule/RCTJPushModule
    
  • 打开ios下的工程,在AppDelegate.m内添加百度移动统计的启动代码

    #import "BaiduMobStat.h"
    
    // - (BOOL)application: didFinishLaunchingWithOptions:
    [[BaiduMobStat defaultStat] startWithAppId:@"xxx"];
  • 在App.js 内使用对应的接口

Android

  • 新建一个React Native工程,参考React Native 官网,添加百度移动统计react native插件支持

     react-native install baidumobstat-react-native
     react-native link baidumobstat-react-native
    
  • Application中注册sdk package

     @Override
     protected List<ReactPackage> getPackages() {
         ReactPackage packages[] = new ReactPackage[]{
             new MainReactPackage(),
             new RNBaiduMobStatPackage()
         };
         return Arrays.<ReactPackage>asList(packages);
     }
    
  • 在App.js 内使用对应的接口埋点,完成统计

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.