Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update VenmoLauncher to use ComponentActivity #879

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Venmo/src/main/java/com/braintreepayments/api/VenmoLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.LifecycleOwner;

/**
Expand All @@ -25,7 +24,7 @@ public class VenmoLauncher {

/**
* Used to launch the Venmo authentication flow to tokenize a Venmo account. This class must be
* instantiated in the OnCreate method of your Fragment.
* instantiated before the Fragment is created.
*
* @param fragment an Android Fragment from which you will launch the Venmo app
* @param callback a {@link VenmoLauncherCallback} to receive the result of the Venmo
Expand All @@ -39,13 +38,13 @@ public VenmoLauncher(@NonNull Fragment fragment,

/**
* Used to launch the Venmo authentication flow to tokenize a Venmo account. This class must be
* instantiated in the OnCreate method of your Activity.
* instantiated before the Activity is created.
*
* @param activity an Android Activity from which you will launch the Venmo app
* @param callback a {@link VenmoLauncherCallback} to receive the result of the Venmo
* app switch authentication flow
*/
public VenmoLauncher(@NonNull FragmentActivity activity,
public VenmoLauncher(@NonNull ComponentActivity activity,
@NonNull VenmoLauncherCallback callback) {
this(activity.getActivityResultRegistry(), activity, callback);
}
Expand All @@ -58,7 +57,9 @@ public VenmoLauncher(@NonNull FragmentActivity activity,
}

/**
* Launches the Venmo authentication flow by switching to the Venmo app.
* Launches the Venmo authentication flow by switching to the Venmo app. This method cannot be
* called until the lifecycle of the Fragment or Activity used to instantiate your
* {@link VenmoLauncher} has reached the CREATED state.
*
* @param venmoPaymentAuthRequest the result of
* {@link VenmoClient#createPaymentAuthRequest(android.content.Context, VenmoRequest, VenmoPaymentAuthRequestCallback)}
Expand Down
Loading