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

nativescript-hockey-sdk

v1.2.0

Published

Use the HockeyApp SDK in NativeScript projects

Downloads

5

Readme

HockeyApp SDK for NativeScript

A NativeScript plugin for the HockeyApp SDK (iOS and Android)


This plugin installs the HockeyApp SDK in NativeScript projects and provides a common API for using in iOS and Android projects.

How to use

Run the following command in the root of your project:

$ tns plugin add nativescript-hockey-sdk

The SDK wrapper and init mechanism is shamelessly copied from the Fabric plugin. Before running an app with this plug-in, you will need an APP_ID from the HockeyApp service. Visit the HockeyApp website to obtain a key for your app. Enter that key in the AndroidManifest.xml or Info.plist.

iOS

Add the HockeyApp APP_ID to the /app/App_Resources/iOS/Info.plist file:

<key>HockeyAppId</key>
<string>${APP_ID}</string>

The iOS version of this plugin uses the HockeyApp SDK CocoaPod. See the HockeyApp SDK CocoaPod docs for additional configuration options.

NOTE: As of version 1.2.0, this plugin requires XCode 8.3+. If you use an older version of XCode, you may see invalid bitcode version errors when trying to build NativeScript projects that include this plugin.

Using build.xcconfig

On iOS, you also have the option of putting your HockeySDK APP_ID in the build.xcconfig file rather than directly embedding in Info.plst. This can help if, for example, you want to avoid putting SDK keys in source control.

Using the Info.plist syntax above with the ${APP_ID} key, simply add this line to build.xcconfig:

APP_ID = YOUR-HOCKYSDK-APP-ID

During builds, the value from build.xcconfig will replace the ${APP_ID} key in Info.plist.

Android

Add the HockeyApp APP_ID to the /app/App_Resources/Android/AndroidManifest.xml file:

<meta-data android:name="net.hockeyapp.android.appIdentifier" android:value="${APP_ID}" />

Usage

After the plug-in has been installed and the APP_ID has been configured, simply import and init the plugin.

import { HockeyApp } from 'nativescript-hockey-sdk';
...
HockeyApp.init();
HockeyApp.trackEvent("LOG_IN");

To init on app launch, import and init in your app.ts or app.js file in the launchEvent handler:

app.on(app.launchEvent, function(context) {
    HockeyApp.init();
});

If you're using Angular, you could alternatively use the AppModule constructor:

export class AppModule {
  constructor() {
    HockeyApp.init();
    HockeyApp.trackEvent("LAUNCH");
  }
}

Breaking Changes

v1.0.0

  • APP_ID key now expected in iOS/Android configuration files

TODOS

  • Add TypeScript definitions for CocoaPod types

License

MIT