Driversnote-Dev / react-native-kontaktio

React Native (iOS and Android) library for Kontakt.io beacons (and all other beacons)
MIT License
112 stars 48 forks source link

MinimalExample.android.js — How to run it? #30

Closed didacus closed 6 years ago

didacus commented 6 years ago

Hi all, I am trying to run the minimal android example using Eddystone beacons. Unfortunately, nothing comes out on the console. Am I missing something?

import React, { Component } from 'react';
import { View, DeviceEventEmitter } from 'react-native';

import Kontakt from 'react-native-kontaktio';
const { connect, startScanning } = Kontakt;

export default class MinimalExample extends Component {
  componentDidMount() {
    connect()
      .then(() => startScanning())
      .catch(error => console.log('error', error));

    DeviceEventEmitter.addListener(
      'eddystonesDidUpdate',
      ({ eddystones, namespace }) => {
        console.log('eddystonesDidUpdate', eddystones, namespace);
      }
    );
  }

  render() {
    return <View />;
  }
}

Thank you in advance.

didacus commented 6 years ago

This issue is solved.