I'm looking to get a shortlink when using Firebases dynamic links using this code from their documentation:
Task shortLinkTask = FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLink(Uri.parse("https://example.com/"))
.setDynamicLinkDomain("abc123.app.goo.gl")
// Set parameters
// ...
.buildShortDynamicLink()
.addOnCompleteListener(this, new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if (task.isSuccessful()) {
// Short link created
Uri shortLink = task.getResult().getShortLink();
Uri flowchartLink = task.getResult().getPreviewLink();
} else {
// Error
}
}
});
Here is the doc from where the code came from. Whats the quick fix? I've tried fiddling with imports with not much success.