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-greet-solutions

v1.0.19

Published

SDK for RN of Greet Solutions

Downloads

17

Readme

Greet Solutions Platform

Greet Solutions is a user recognition platform that detects store visitors through native SDKs and routers.

Requirements

  • Contact with Greet Solution sales department to get your Greet Solutions App ID, available in Keys & IDs.

IOS

  • An iOS device (iPhone, iPad, iPod Touch) to test on.
  • A Mac with a new version of Xcode.

Installation

With react-native-cli

Install library

from npm

npm install react-native-greet-solutions

from yarn

yarn add react-native-greet-solutions

Usage

import React, { useEffect } from 'react'
import { NativeEventEmitter} from 'react-native';
//...
import SdkGreetSolutions from "react-native-greet-solutions";
const SDKEvents = new NativeEventEmitter(SdkGreetSolutions)
//...

Methods

| Name | Parameters | Description | | ---------------------- | ---------------------------------------- | -----------------------------------------------------------| | setCredencials() | keyClient, customerId, callback function | Set client credentials | | startWifiPermissions() | N/A | Make the automatic connection with the wifi | | registerUserInServer() | name, phone, email, clientTokenId | User Register in to cloud | | registerUserInLocal() | N/A | UUID Register in Router |

setCredencials()

const onSetCredentials = () => {
    let keyClient = "XXXXXXXXXXXXX-XXXXXXXXXXXXXX";
    let customerId = "XXXXXXXXXXXXXX";
    SdkGreetSolutions.setCredencials(keyClient, customerId, (resp) => { console.log("Set Credentials response:", resp) })
}

Add a listener

useEffect(() => {
    // ...
    SDKEvents.addListener('onSetCredentials', result => {
        console.log('onSetCredentials received', result)
    })
    // ...
}, []);

startWifiPermissions()

const onStartWiFi = async () => {
    try {
        await SdkGreetSolutions.startWifiPermissions()
    } catch (e) {
        console.log(e.message, e.code)
    }
}

Add a listener

useEffect(() => {
    // ...
    SDKEvents.addListener('onStartWifi', result => {
        console.log('onStartWifi received', result)
    })
    // ...
}, []);

registerUserInServer()

const onSendUniqueIdToServer = async () => {
    try {
        await SdkGreetSolutions.registerUserInServer("USER_NAME", "USER_PHONE", "USER_EMAIL", "CLIENT_TOKEN_ID")
    } catch (e) {
        console.log(e.message, e.code)
    }
}

Add a listener

useEffect(() => {
    // ...
    SDKEvents.addListener('onRegisterUserInServer', result => {
        console.log('onRegisterUserInServer received', result)
    })
    // ...
}, []);

registerUserInLocal()

const onSendUniqueIdToLocalNetwork = async () => {
    try {
        await SdkGreetSolutions.registerUserInLocal()
    } catch (e) {
        console.log(e.message, e.code)
    }
}

Add a listener

useEffect(() => {
    // ...
    SDKEvents.addListener('onRegisterUserInLocal', result => {
        console.log('onRegisterUserInLocal received', result)
    })
    // ...
}, []);

iOS React Native SDK

Instructions for adding Greet Solutions SDK to your iOS React Native app.

After the library installation, install the new pod:

cd ios && pod install

Add Privacy Message in Info.plist

This step is important because it’s necessary to ask the user of your app for permission to access their WiFi communication, and Network configuration.

Go to “Info.plist” file.

  • Right Click and find “ Open As” and select “Source Code”.
  • Copy this code. You can change the message for each privacy message.
	<key>NSLocalNetworkUsageDescription</key>
	<string>This lets you contact customer services in the store.</string>

Add Required Capabilities

Select the root project, your main app target and "Signing & Capabilities". Then go to new Capability and add "Hotspot Configuration".

xcode-add

Android React Native SDK

Configure Network security policy to router connection

Create res/xml/network_security_config.xml with content:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">10.10.10.1</domain>
    </domain-config>
</network-security-config>

Point to this file from your manifest:

<application
  android:networkSecurityConfig="@xml/network_security_config"
  android:label="@string/app_name"
  android:theme="@style/AppTheme">

</application>