Coder Social home page Coder Social logo

react-native-nearby-api-example's People

Contributors

adrianso avatar dependabot[bot] avatar

react-native-nearby-api-example's Issues

Hard crash without any error

Hi @adrianso ! I don't know where else to post this, but thanks for your changes to react-native-nearby-api! Couldn't find your fork of it, but I've finally got it working on my app.

I do have a problem though. I'm getting a hard crash on Simulators and real devices without any error information.

When only using NearbyApi.connect() everything works fine, but once I try to subscribe() or publish() the app crashes. (not instantly, but with a short delay).

image

My code:

const nearbyAPI = new NearbyAPI(true);
nearbyAPI.onFound((m) => {
	if (typeof m === 'string') onNearbyUserFound(m);
});
nearbyAPI.onPublishFailed((message) => {
	Logger.logError(`[NEARBY] Publishing User ID failed! ${message}`, new Error(`[GOOGLE-NEARBY] Publish failed! ${message}`));
});
nearbyAPI.onSubscribeFailed((message) => {
	Logger.logError(`[NEARBY] Subscribing to messages failed! ${message}`, new Error(`[GOOGLE-NEARBY] Subscribing failed! ${message}`));
});
nearbyAPI.onConnectionFailure((message) => {
	Logger.logError(`[NEARBY] Failed to connect BTE to Google Nearby! ${message}`, new Error(`[GOOGLE-NEARBY] Connection failure! ${message}`));
});
Logger.debug('[NEARBY] Connecting...');
nearbyAPI.connect(GOOGLE_NEARBY_API_KEY); // works fine
nearbyAPI.subscribe(); // executes
Logger.debug('[NEARBY] Connected!'); // executes

// about a second later the app crashes..

I'm guessing it has something to do with Bluetooth permissions, do you know how I can get this working?

Also, the library always includes Assets.car in [CP] Copy Pods Resources in Xcode Build Phases, do you know why this happens? Must be something in the podspec.. (See: badfeatures/react-native-nearby-api#33)

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.