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

herow-plugin-react-native

v7.1.4

Published

Bridge to access to the HEROW SDK.

Downloads

2

Readme

react-native-herow-sdk-module

SDK HEROW React Native Module

Installation

If you need an empty React Native App'

npx react-native init herowApp
cd herowApp
npm install [email protected]

You should update several configuration files before modifying your code.

Android Steps

First, edit android/build.gradle and add :

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
        maven {
            name = "GitHubPackages"
            url = uri("https://maven.pkg.github.com/herowio/herow-sdk-android")
            credentials {
                // for more detail, please contact [email protected]
                username = "xxx"
                password = "xxx"
            }
        }
    }
}

For the moment this step is mandatory and we would be happy to provide you with the information by email at [email protected].

Second, set up the kotlinVersion

Edit android/build.gradle and add the key kotlinVersion :


buildscript {
    ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
        kotlinVersion = '1.4.32'
    }
    ...

Third, modify AndroidManifest.xml

Edit android/app/src/main/AndroidManifest.xml, you should adapt permissions..

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

and fix an issue by adding tools:replace="android:name", like that :

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  package="com.example.reactnativeherowsdkmodule">
  ...
    <application
    tools:replace="android:name"
    ...

That's it !

iOS Steps

Modify your podfile to include herow specs sources

source 'https://github.com/herowio/Specs'

Fixe your linking errors

You may receive error

linker command failed with exit code 1 (use -v to see invocation)"

And warnings:

ld: warning: Could not find auto-linked library 'swiftFoundation'

ld: warning: Could not find auto-linked library 'swiftDarwin'

ld: warning: Could not find auto-linked library 'swiftCoreFoundation'

ld: warning: Could not find auto-linked library 'swiftCore'

You have to follow this to fix the problem: Open ios/YourAppName.xcodeproj in Xcode Right-click on Your App Name in the Project Navigator on the left, and click New File… Create a single empty Swift file to the project (make sure that Your App Name target is selected when adding) when Xcode asks, press Create Bridging Header and do not remove Swift file then. re-run your build. This should fix the problem

Update your plist to use locations and idfa permissions ( you should read the native iOS documentation here

Usage

import HerowSdkModule from "herow-plugin-react-native";

// ...

HerowSdkModule.initialize("PROD", "my_api_key", "my_secret_key")
HerowSdkModule.setCustomId("my_custom_id")
HerowSdkModule.acceptOptin() //( or  HerowSdkModule.refuseOptin())
HerowSdkModule.launchClickAndCollect()  //( or HerowSdkModule.stopClickAndCollect())

for ios you have to ask somes permissions:

if  (Platform.OS == 'ios') {
    HerowSdkModule.askWhenInUseLocationPermission()
    HerowSdkModule.askNotificationsPermission()
    HerowSdkModule.requestIDFA()
 }

How to start locally

$ export ANDROID_HOME=/path/to/android-sdk
$ export PATH=$ANDROID_HOME/build-tools/30.0.3:$PATH
$ npx react-native run-android (or run-ios)

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT