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

react-native-poc-usabilla

v1.3.0

Published

1. Enter the `android` folder in home directory of the RN app 2. Copy the latest .aar version of the Usabilla SDK in the path app/libs/ 3. Change the Gradle wrapper to be at least `4.1-all` in `gradle-wrapper.properties` 4. Replace the original Project-le

Downloads

4

Readme

Android

  1. Enter the android folder in home directory of the RN app
  2. Copy the latest .aar version of the Usabilla SDK in the path app/libs/
  3. Change the Gradle wrapper to be at least 4.1-all in gradle-wrapper.properties
  4. Replace the original Project-level build.gradle file with this
    buildscript {
        ext.kotlin_version = '1.2.10'
        repositories {
            jcenter()
            google()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.1'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        }
    }
    
    allprojects {
        repositories {
            mavenLocal()
            jcenter()
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url "$rootDir/../node_modules/react-native/android"
            }
            google()
        }
    }
  5. Add the following to the App-level build.gradle file
    apply plugin: 'kotlin-android'
       
    ...
       
    implementation fileTree(dir: "libs", include: ["*.aar"])
    implementation "com.android.support:appcompat-v7:26.1.0"
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation "com.facebook.react:react-native:0.52.0"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support.test.espresso:espresso-idling-resource:3.0.1'
  6. Create a class called UsabillaBridge.kt which will host all the methods bridging from React Native to Java/Kotlin, such as
    class BridgeModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
    
        override fun getName() = "UsabillaBridge"
    
        @ReactMethod
        fun initialize(appId: String) {
            currentActivity?.let {
                Usabilla.initialize(it.baseContext, appId)
                Toast.makeText(it.baseContext, "SDK initialised with AppId $appId", Toast.LENGTH_SHORT).show()
            }
        }
           
        // Other methods
    }
  7. Create a class called BridgePackage.kt to be able to reference the previous class from React Native, such as
    class BridgePackage : ReactPackage {
    
        override fun createNativeModules(reactContext: ReactApplicationContext): MutableList<NativeModule> =
                mutableListOf(UsabillaBridge(reactContext))
    
        override fun createViewManagers(reactContext: ReactApplicationContext?): MutableList<ViewManager<View, ReactShadowNode<*>>> =
                Collections.emptyList()
    }
  8. In MainApplication.kt (or its java version) add the BridgePackage to the method getPackages()
  9. Run the app either opening the project in the android folder with AndroidStudio, or via command line typing react-native run-android from within the RN folder
  10. Add the following to App.js
    import { NativeModules } from 'react-native';
  11. You should be able to call a method in the UsabillaBridge.kt from the RN app with
    NativeModules.UsabillaBridge.initialize('5a37c12145380769f373d71b');