Skip to content

Hard crash without any error #2

@mrousavy

Description

@mrousavy

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions