I have kontakt.io beacon and I try to write application for background 
scanning with nearby API.

I use this method to subscribe messages:

SubscribeOptions options = new SubscribeOptions.Builder()
            // Finds messages attached to BLE beacons. See
            // https://developers.google.com/beacons/
            .setStrategy(Strategy.BLE_ONLY)
            .build();

    Nearby.Messages.subscribe(mGoogleApiClient, getPendingIntent(), options)
            .setResultCallback(new ResultCallback<Status>() {
                @Override
                public void onResult(@NonNull Status status) {
                    if (status.isSuccess()) {
                        Log.i(TAG, "subscribed successfully");
                        mSubState = SubState.SUBSCRIBING;
                        // Start background service for handling the 
notification.
                        
getActivity().startService(getBackgroundSubscribeServiceIntent());
                    } else {
                        Log.i(TAG, "could not subscribe");
                        handleUnsuccessfulNearbyResult(status);
                    }
                }
            });

My code is according to this sample: 
https://github.com/googlesamples/android-nearby/tree/master/messages/NearbyBackgroundBeacons

I´m receiving messages correctly, but when I kill application no more 
message come.

Is there any way to get messages from nearby after killing application?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f927d0dd-cf51-41d3-b882-70a88a99f8d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to