npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

talkingdata

v1.2.2

Published

Cordova plugin for TalkingData Analytics SDK integration

Downloads

1

Readme

Cordova Plugin for TalkingData Analytics SDK 集成文档

Cordova Plugin for TalkingData Analytics SDK 适用于 CordovaPhoneGap 跨平台项目。

集成方式

  1. 下载项目到本地目录:

    git clone https://github.com/TalkingData/TalkingData-Analytics-SDK-Cordova-Plugin.git

  2. 访问 TalkingData 官网 下载最新版本的 Android 和 iOS 平台 Analytics SDK。Plugin 中的 SDK 可能不是最新版本,需要检查并使用刚刚下载的新版本,进入克隆到本地的 Plugin 目录:

    • Android 平台
      使用最新版本 SDK 的 jar 包替换 Plugin 中的 src\android\TalkingData.jar 文件。

    • iOS 平台
      使用最新版本 SDK 的 .h 头文件和 .a 静态库文件替换 Plugin 中 src\ios 文件夹下的同名文件。

    之后,参考 Analytics SDK 集成文档 配置工程。

  3. 进入 Cordova 工程目录,执行下面的命令添加 Plugin

     cordova plugin add "[Plugin 路径]"
  4. 访问 TalkingData 官网 注册帐号并按照提示申请 AppId

  5. 使用申请到的 AppId 在 Cordova 工程的 Native 代码中集成 SDK 并初始化。

    • Android 平台
      在继承自 CordovaActivity 类型的 JAVA 类文件,比如 %Cordova工程目录%\platforms\android\src\com\talkingdata\demo\MainActivity.java 中,找到 onCreate 方法,加入下面的初始化代码:

        TCAgent.LOG_ON = true;
        TCAgent.init(this, "[Your AppId]", "[Your ChannelId]");
        TCAgent.setReportUncaughtExceptions(true);

      [Your AppId] 就是刚刚申请的 AppId,[Your ChannelId] 是应用的渠道号。

    • iOS 平台
      %Cordova工程目录%\/platforms/ios/demo/Classes/AppDelegate.m 文件中,找到方法 (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions,添加下面的代码:

        [TalkingData setSignalReportEnabled:YES];
        [TalkingData setLogEnabled:YES];
        [TalkingData sessionStarted:@"[Your AppId]" withChannelId:@"[Your ChannelId]"];

      同样的,[Your AppId] 就是刚刚申请的 AppId,[Your ChannelId] 是应用的渠道号。

  6. 编译工程:

     cordova build

Demo

下面的 Demo 中演示了不同平台上的集成方式,包括 Demo 的创建过程: