Skip to content

Instantly share code, notes, and snippets.

@devwithzachary
Created February 10, 2022 15:00
Show Gist options
  • Save devwithzachary/1eb670240b8fdb18e22a7caecaa96a86 to your computer and use it in GitHub Desktop.
Save devwithzachary/1eb670240b8fdb18e22a7caecaa96a86 to your computer and use it in GitHub Desktop.
HmsInstanceId inst = HmsInstanceId.getInstance(this);
Task<AAIDResult> idResult = inst.getAAID();
idResult.addOnSuccessListener(new OnSuccessListener<AAIDResult>() {
@Override
public void onSuccess(AAIDResult aaidResult) {
String aaid = aaidResult.getId();
textView.setText(aaid);
Log.d(TAG, "getAAID success:" + aaid );
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(Exception e) {
Log.d(TAG, "getAAID failure:" + e);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment