0

Our apps can connect to GoogleAPIClient even though the KEY is wrong or not supplied.

<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();
    }
Chetan Joshi
  • 5,582
  • 4
  • 30
  • 43
John
  • 31
  • 5

1 Answers1

0

The failure will occur if you try to publish or subscribe. Connecting the GoogleApiClient doesn't result in a call to our servers, so the key isn't used.

Brian Duff
  • 406
  • 3
  • 12