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. | |||||||||||
This method is deprecated.
use
openURL(String, BrowserConfig, OnBrowserOpenedListener) .
| |||||||||||
This method is deprecated.
use
openURL(String, BrowserConfig, OnBrowserOpenedListener) .
| |||||||||||
Asynchronously open a given URL.
| |||||||||||
Asynchronously open a given URL.
| |||||||||||
Asynchronously open a given URL.
| |||||||||||
This method is deprecated.
use
openURL(String, BrowserConfig, OnBrowserOpenedListener) .
| |||||||||||
Asynchronously open a given URL.
| |||||||||||
Personalize your user's experience.
| |||||||||||
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.
Application.onCreate()
.context | Context you application context. |
---|---|
applicationId | your Button application id found at https://app.usebutton.com/. |
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. |
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.
This method is deprecated.
use openURL(String, BrowserConfig, OnBrowserOpenedListener)
.
Asynchronously open a given URL.
You can use this method to open links to Brands regardless of their partnership status with Button. Please contact your PSM to enable support for non-Button Brands. For such Brands, you may pass a title to provide your users with a cohesive experience.url | the link to open |
---|---|
title | optional browser title |
listener | optional completion listener |
This method is deprecated.
use openURL(String, BrowserConfig, OnBrowserOpenedListener)
.
Asynchronously open a given URL.
You can use this method to open links to Brands regardless of their partnership status with Button. Please contact your PSM to enable support for non-Button Brands. For such Brands, you may pass a title and subtitle to provide your users with a cohesive experience. N.B. if you provide the subtitle, you must provide the title as well!url | the link to open |
---|---|
title | optional browser title |
subtitle | optional browser subtitle |
listener | optional completion listener |
Asynchronously open a given URL.
You can use this method to open links to Brands regardless of their partnership status with Button. Please contact your PSM to enable support for non-Button Brands.url | the link to open |
---|
Asynchronously open a given URL.
You can use this method to open links to Brands regardless of their partnership status with Button. Please contact your PSM to enable support for non-Button Brands.url | the link to open |
---|---|
config | the configuration object used to change title, set pub-ref etc. |
listener | the completion listener |
Asynchronously open a given URL.
You can use this method to open links to Brands regardless of their partnership status with Button. Please contact your PSM to enable support for non-Button Brands.url | the link to open |
---|---|
listener | the completion listener |
This method is deprecated.
use openURL(String, BrowserConfig, OnBrowserOpenedListener)
.
Asynchronously open a given URL.
You can use this method to open links to Brands regardless of their partnership status with Button. Please contact your PSM to enable support for non-Button Brands.url | the link to open |
---|---|
listener | optional completion listener |
Asynchronously open a given URL.
You can use this method to open links to Brands regardless of their partnership status with Button. Please contact your PSM to enable support for non-Button Brands.url | the link to open |
---|---|
config | the configuration object used to change title, set pub-ref etc. |
Personalize your user's experience.
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);