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();
}