在Android 的 Nearby Messages API 中,要在后台获取 Beacon 消息(一旦订阅 BLE),它会说:
protected void onHandleIntent(Intent intent) {
Nearby.Messages.handleIntent(intent, new MessageListener() {
@Override
public void onFound(Message message) {
Log.i(TAG, "Found message via PendingIntent: " + message);
}
@Override
public void onLost(Message message) {
Log.i(TAG, "Lost message via PendingIntent: " + message);
}
});
}
但Nearby.Messages.handleIntent(PendingIntent intent, MessageListener messageListener)
找不到该功能:见 Android Studio