简体   繁体   English

Kontakt IO信标-API密钥的用法

[英]Kontakt IO Beacon - Usage of API Key

I have downloaded demo from GitHub 我已经从GitHub下载了演示

https://github.com/kontaktio/kontakt-beacon-admin-sample-app https://github.com/kontaktio/kontakt-beacon-admin-sample-app

Here they have used Server API Key to initialize. 在这里,他们使用服务器API密钥进行初始化。

public class App extends Application {

  private static final String API_KEY = "Your Api Key here";

  @Override
  public void onCreate() {
    super.onCreate();
    initializeDependencies();
  }

  //Initializing Kontakt SDK. Insert your API key to allow all samples to work correctly
  private void initializeDependencies() {
    KontaktSDK.initialize(API_KEY);
  }

}

My question is , 我的问题是

it is suppose to scan and give only those beacon which are registered to my portal of which Server API key I have placed in above code ? 是否假设仅扫描并提供那些注册到我的门户的信标,这些信标是我在上面的代码中放置的Server API密钥的?

Currently, I am running the demo with 2 different API key and both the time I am getting 2 of my beacons which are registered with only single API key, my thinking is that second key should not give any beacon in result of scan. 目前,我正在使用2个不同的API密钥运行演示,并且每次我获得仅用一个API密钥注册的2个信标时,我的想法是第二个密钥不应在扫描结果中提供任何信标。

Please clear my doubts. 请清除我的疑虑。 How to use API key to only get those beacons which are registered for that key only? 如何使用API​​密钥仅获取那些仅为该密钥注册的信标?

The API key is meant to authenticate any communication with Kontakt.io's RESTful API; API密钥旨在验证与Kontakt.io的RESTful API的任何通信; scanning is happening locally using the BLE interface, that's why you can see both devices. 扫描是使用BLE接口在本地进行的,这就是为什么您可以同时看到两个设备的原因。

Try configuration instead, which should fetch appropriate credentials only when authenticating with the correct API key. 请尝试配置,该配置仅在使用正确的API密钥进行身份验证时才应获取适当的凭据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM