java.lang.Object | |
↳ | com.usebutton.sdk.Button |
Main entry point to the Button SDK.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Button.InvalidAppIdException | Exception class when an Application id is invalid. | ||||||||||
Button.OnConfigureListener | Completion listener for configure(Context, String, OnConfigureListener) . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Buttons provide relevant actions to your users, complete with a corresponding UI.
| |||||||||||
Discards the current session and all persisted data.
| |||||||||||
Button SDK feature configuration.
| |||||||||||
Configures
Button with your application id. | |||||||||||
Configures
Button with your application id. | |||||||||||
Debug the Button SDK.
| |||||||||||
Call this if you need to have the Button SDK reload its language settings from
Locale.getDefault() (in case you're forcing a different language in your app from the
device default. | |||||||||||
Button Purchase Path takes regular merchant URLs to products, categories or just the homepage
and replaces them with a fully attributed Button Purchase Path, optimized for both conversion
and user experience.
| |||||||||||
Associate your user with a Button session.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Buttons provide relevant actions to your users, complete with a corresponding UI. Buttons can be configured with one or more merchants that they can offer to your users.
See https://developer.usebutton.com/guides/publishers/android/using-button-actions{@code ActionQuery query = ActionQuery.withSubjectLocation(new Location(40.71, 74.0)); ActionRequest request = new ActionRequest("btn-abc123", query); Button.actions().fetch(reservationRequest, new ActionListener() {@Override public void onComplete(@Nullable ButtonAction action, @Nullable Throwable t) { if (action != null) { action.start(context); } } }); }</pre>
Discards the current session and all persisted data.
Call this method in your log out handler if/when your user logs out of your app.Button SDK feature configuration.
Configures Button
with your application id.
This method should be called from your Application.onCreate()
.
context | Context you application context. |
---|---|
applicationId | your Button application id found at https://app.usebutton.com/. |
listener | optional callback when configuration is complete. |
Configures Button
with your application id.
Application.onCreate()
.context | Context you application context. |
---|---|
applicationId | your Button application id found at https://app.usebutton.com/. |
Debug the Button SDK.
Enable debug logging during integration for more visibility.if (BuildConfig.DEBUG) { Button.debug().setLoggingEnabled(true); }
Call this if you need to have the Button SDK reload its language settings from
Locale.getDefault()
(in case you're forcing a different language in your app from the
device default.
Button Purchase Path takes regular merchant URLs to products, categories or just the homepage and replaces them with a fully attributed Button Purchase Path, optimized for both conversion and user experience.
See https://developer.usebutton.com/guides/publishers/android/create-a-button-purchase-path{@code PurchasePathRequest request = new PurchasePathRequest("https://www.example.com/"); Button.purchasePath().fetch(request, new ActionListener() {@Override public void onComplete(@Nullable PurchasePath action, @Nullable Throwable t) { if (action != null) { action.start(context); } } }); }</pre>
Associate your user with a Button session.
You can associate all Button activity with one of your users by setting their user identifier. This can be your user ID, email or a stable hash of one. You can use this later to look up orders, activity and identify the user using Webhooks. See https://developer.usebutton.com/guides/publishers/configure-webhooks.Button.user().setIdentifier(myLoggedInUser.identifier);