Did't get onEnter callback

Hello, i am Android developer
I am using ‘com.estimote:proximity-sdk:1.0.3’ SDK to connect with beacon i have started observation successfully but din’t get call back for onEnter i have only get callback for fulfil requirement only, here is how i try to get

ProximityObserver proximityObserver = new ProximityObserverBuilder(context, cloudCredentials)
        .onError(new Function1<Throwable, Unit>() {
            @Override
            public Unit invoke(Throwable throwable) {
                Log.e("apppp", "proximity observer error: " + throwable);
                return null;
            }
        })
        .withLowLatencyPowerMode()
        .withEstimoteSecureMonitoringDisabled()
        .withTelemetryReportingDisabled()
        .build();

ProximityZone zone = new ProximityZoneBuilder()
        .forTag("desks")
        .inCustomRange(3.0)
        .onContextChange(new Function1<Set<? extends ProximityZoneContext>, Unit>() {
            @Override
            public Unit invoke(Set<? extends ProximityZoneContext> contexts) {
                Toast.makeText(context, "context change", Toast.LENGTH_SHORT).show();
                List<ProximityContent> nearbyContent = new ArrayList<>(contexts.size());

                for (ProximityZoneContext proximityContext : contexts) {
                    String title = proximityContext.getAttachments().get("jingram-roborewards-com-s--17f/title");
                    if (title == null) {
                        title = "unknown";
                    }
                    String subtitle = Utils.getShortIdentifier(proximityContext.getDeviceId());

                    nearbyContent.add(new ProximityContent(title, subtitle));
                }

                proximityContentAdapter.setNearbyContent(nearbyContent);
                proximityContentAdapter.notifyDataSetChanged();

                return null;
            }
        })
        .onEnter(new Function1<ProximityZoneContext, Unit>() {
            @Override
            public Unit invoke(ProximityZoneContext proximityZoneContext) {
                Toast.makeText(context, "Enter", Toast.LENGTH_SHORT).show();
                return null;
            }
        })
        .onExit(new Function1<ProximityZoneContext, Unit>() {
            @Override
            public Unit invoke(ProximityZoneContext proximityZoneContext) {
                Toast.makeText(context, "exit", Toast.LENGTH_SHORT).show();
                return null;
            }
        })
        .build();

proximityObserverHandler = proximityObserver.startObserving(zone);

Can you double-check your App ID/Token, and if you have any beacons tagged “desks” in Estimote Cloud? Also, you could experiment with bumping the inCustomRange number. I’d also try to restart Bluetooth before starting your app.

1 Like