Search code examples
androidibeacongoogle-nearbygoogle-nearby-messages

Nearby Messages API namespace reserved


I am trying to implement beacon scanning with Firebase, Nearby Messages and iBeacons. I have followed Googles docs on how to set up the beacons and started a service which handles Messages. But the only response I get is:

Message received: Message{namespace='__reserved_namespace', type='__i_beacon_id', content=[20 bytes]}

My namespace type is project-name-1234/room with data test. I subscribe to Nearby Messages like this:

 MessageFilter messageFilter = new MessageFilter.Builder()
            .includeIBeaconIds(UUID, major, minor)
            .includeNamespacedType("project-name-1234/room", "test")
            .build();

 SubscribeOptions options = new SubscribeOptions.Builder()
            .setStrategy(Strategy.BLE_ONLY)
            .setFilter(messageFilter)
            .build();

 Nearby.Messages.subscribe(mGoogleApiClient, getPendingIntent(), options);

It seems to be a problem with my namespace but I can't figure out what it it is.


Solution

  • Use IBeaconId.from(Message) to parse your message. Also see https://developers.google.com/nearby/messages/android/get-beacon-messages for end to end example on how to work with beacons.