pashute/Noam

finish beacon (branch: v098c)

Closed this issue · 4 comments

stage 1 - for android // this stage was completed

  • 1.0 When beacon is detected write the UID to a console.log. or anything else you can do...
    something simple.
  • commit and push !!!

stage 2 - fix android beacon scanning

app runs ok on connected device, but in console (F12 in chrome on debug for connected device:

  • see if you get the errors ?
    C:\dev\devreact\noam\AppMain.js:222 [startScanning] error:

    Error: Did you forget to call connect() or did the connect() call fail? The beacon manager is not connected.

At some stage (I think) it was working ok and doing startScanning. but i cannot find which branch or commit that happened on. The error was happening because the startScanning was defined inside (or maybe outside) the constructor (or maybe inside or outside the class?) I'm not sure.

There is a "junk" folder with the kontaktio component that Omar made that worked perfectly listing the beacons in android.

stage 3 - for both android and ios.

  • 3.1 detecting beacon

  • 3.1.1 When beacon is detected find the UID in placesData/place/beacon/beaconId
    and set that place as currentPlace. (in the context?)

  • 3.1.2 Alert the user (ok button): New beacon detected.

  • 3.2 no beacon detected

  • 3.2.1 After splash when reaches InPlace page: if no beacon information then

  • 3.2.2 cover mainpage with dialog:

Searching for beacon information...
{(lastplace != undefined):} Are you still at ? YES / NO

  • 3.2.3 Show question only if lastplace is defined.

  • 3.3 User answer:

  • 3.3.1 - If the user answers YES, simply dismiss the dialog.

  • 3.3.2 If user answers NO -

  • 3.3.2.1 change dialog content: remove question in dialog

  • 3.3.2.2 but leave "Searching for beacon information...

  • 3.3.2.3 and disable the two other tabs. ThisWay and Nearby.

  • Note: besides disabling the tabs, change the ButtonGroup label and icon colors to a style of disabled color (gray...). In other words: change the "This Way", "Nearby" and "In the Building" text color and the arrow-up icon color to disabled style with gray color._

  • 3.4 beacon re-detected

    • If after NO from user, at some time later beacon info IS received from the Kontact.io api - then:
  • re-enable the tabs

  • 3.4.1 Go to 3.1.1 and 3.1.2

@omarvgdev

  1. Could you mark the checkmarks that were done?
  2. With the current version can I see the console.log somehow? If you don't know the answer leave it to me to look it up.
  3. When can you make a version that shows the id somewhere in the app.
  4. Tell me in whatsapp when your done answering these questions here.

Nearby.js

    console.log('checking beacon');
if (Platform.OS !== 'ios') {
  connect()
    .then(() => {
      console.log('startScanning');
      startScanning();
    })
    .catch(error => {
      console.log('error', error);
    });

  DeviceEventEmitter.addListener(
    'beaconsDidUpdate',
    ({ beacons, region }) => {
      console.log('beaconsDidUpdate', beacons, region);
    }
  );
}

Thisway.js

<WayPoints beaconIndex={this.props.beaconIndex} />

Mainpage.js

      <TabbedPage
        selectedIndex={this.state.tabIndex}
        pointingDirection={this.state.pointingTo}
        heading={this.state.heading}
        beaconIndex={this.state.beaconIndex}
      />


const TabbedPage = ({
   selectedIndex,
   pointingDirection,
   heading,
   beaconIndex
}) => { ... ... ... return( ...
  <ThisWay
      pointingDirection={pointingDirection}
      heading={heading}
      beaconIndex={beaconIndex}
    />
  • 1. Moshe: Move back to IN PROGRESS.
  • 2. Moshe: decide branch by comparing develop and v098c
  • 3. Moshe: write feature request for Omar

The app runs ok on a connected android device but the console (in chrome pressing F12) shows the following error:

startKontaktIoScan called
blob:http://localhost:8081/873020f1-e281-431b-ad45-21bbfc7bc930:72488 startKontaktIoScan called

...C:\dev\devreact\noam\AppMain.js:317 dbg.mapStateToProps currentBeacon: Object
blob:http://localhost:8081/873020f1-e281-431b-ad45-21bbfc7bc930:72686 dbg.mapStateToProps currentBeacon:

C:\dev\devreact\noam\redux\actions\DataActions.js:14 dbg.dataactions. set currentplace Object
blob:http://localhost:8081/873020f1-e281-431b-ad45-21bbfc7bc930:117514 dbg.dataactions. set currentplace

C:\dev\devreact\noam\AppMain.js:317 dbg.mapStateToProps currentBeacon: Object
blob:http://localhost:8081/873020f1-e281-431b-ad45-21bbfc7bc930:72686 dbg.mapStateToProps currentBeacon:

C:\dev\devreact\noam\AppMain.js:222 [startScanning] error:
Error: Did you forget to call connect() or did the connect() call fail? The beacon manager is not connected.
at createErrorFromErrorData (C:\dev\devreact\noam\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:121)
at C:\dev\devreact\noam\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:78
at MessageQueue.__invokeCallback (C:\dev\devreact\noam\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:398)
at C:\dev\devreact\noam\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:137
at MessageQueue.__guardSafe (C:\dev\devreact\noam\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:314)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (C:\dev\devreact\noam\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:136)
at debuggerWorker.js:70
blob:http://localhost:8081/873020f1-e281-431b-ad45-21bbfc7bc930:72492 [startScanning] error: