0
키가 잘못되었거나 제공되지 않았더라도 Google Apps는 GoogleAPIClient
에 연결할 수 있습니다.앱이 Google Nearby API에 성공적으로 연결되었는지 확인하는 방법은 무엇인가요?
<meta-data
android:name="com.google.android.nearby.messages.API_KEY"
android:value="ourapikey" />
MainActivity.java
public class MainActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Nearby.MESSAGES_API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.enableAutoManage(this, this) //enable auto manage
.build();
@Override
public void onConnected(@Nullable Bundle bundle) {
//THIS method is called -> we assume the GoogleApiClient therefore is successfully connected
backgroundSubscribe();
}