I upgrade today google play service library to the last and now i have such error like :
warning: [deprecation] getInvitation(GoogleApiClient,Activity,boolean) in AppInviteApi has been deprecated
when i read the doc they say
This interface was deprecated. getInstance() is the main entry point for accessing Dynamic Link data and use getInvitation(com.google.firebase.dynamiclinks.PendingDynamicLinkData) for getting AppInvites data from the Dynamic Link data.
But i don't understand how i can convert my previous code :
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, mActivity, mAutoLaunchDeepLink)
.setResultCallback(
new ResultCallback<AppInviteInvitationResult>() {
@Override
public void onResult(AppInviteInvitationResult result) {
if (result.getStatus().isSuccess()) {
Intent intent = result.getInvitationIntent();
String deepLink = AppInviteReferral.getDeepLink(intent);
String invitationId = AppInviteReferral.getInvitationId(intent);
if (mAppInviteInvitationResultListener != null) mAppInviteInvitationResultListener.onSuccess(deepLink, invitationId);
}
else {
if (mAppInviteInvitationResultListener != null) mAppInviteInvitationResultListener.onError(2, 0);
}
mGoogleApiClient.unregisterConnectionCallbacks(InvitationResult);
mGoogleApiClient.unregisterConnectionFailedListener(InvitationResult);
mGoogleApiClient.disconnect();
}
});
to use now FirebaseAppInvite.getInvitation(...) ?