java.lang.Object | |
↳ | com.urbanairship.UAirship |
UAirship manages the shared state for all Airship
services. UAirship.takeOff() should be called to initialize
the class during Application.onCreate()
or
by using Autopilot
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | UAirship.OnReadyCallback | Callback interface used to notify app when UAirship is ready. | |||||||||
@interface | UAirship.Platform |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTION_AIRSHIP_READY | Broadcast that is sent when UAirship is finished taking off. | |||||||||
int | AMAZON_PLATFORM | Amazon platform type. | |||||||||
int | ANDROID_PLATFORM | Android platform type. | |||||||||
String | EXTRA_AIRSHIP_DEEP_LINK_SCHEME | ||||||||||
String | EXTRA_APP_KEY_KEY | ||||||||||
String | EXTRA_CHANNEL_ID_KEY | ||||||||||
String | EXTRA_PAYLOAD_VERSION_KEY | ||||||||||
int | UNKNOWN_PLATFORM | Unknown platform. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static boolean | LOG_TAKE_OFF_STACKTRACE | Flag to enable printing take off's stacktrace. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
deepLink(String deepLink)
Deep links.
| ||||||||||
ActionRegistry |
getActionRegistry()
The default Action Registry.
| ||||||||||
AirshipConfigOptions |
getAirshipConfigOptions()
Returns the current configuration options.
| ||||||||||
Analytics |
getAnalytics()
Returns the UAirship
Analytics instance. | ||||||||||
static int |
getAppIcon()
Returns the drawable ID for the current Application's icon.
| ||||||||||
static ApplicationInfo |
getAppInfo()
Returns the current Application's ApplicationInfo.
| ||||||||||
static String |
getAppName()
Returns the current Application's name.
| ||||||||||
static long |
getAppVersion()
Returns the current Application version.
| ||||||||||
static Context |
getApplicationContext()
Returns the current Application's context.
| ||||||||||
ApplicationMetrics |
getApplicationMetrics()
Returns the
ApplicationMetrics instance. | ||||||||||
AirshipChannel |
getChannel()
Returns the com.urbanairship.channel.AirshipChannel instance.
| ||||||||||
ChannelCapture |
getChannelCapture()
Returns the
ChannelCapture instance. | ||||||||||
Contact |
getContact()
Returns the Contact instance.
| ||||||||||
DeepLinkListener |
getDeepLinkListener()
Returns the deep link listener if one has been set, otherwise null.
| ||||||||||
Locale |
getLocale()
Get the locale stored in UAirship.
| ||||||||||
static PackageInfo |
getPackageInfo()
Returns the Application's
PackageInfo | ||||||||||
static PackageManager |
getPackageManager()
Returns the Application's package manager.
| ||||||||||
static String |
getPackageName()
Returns the Application's package name.
| ||||||||||
PermissionsManager |
getPermissionsManager()
Returns the UAirship
PermissionsManager instance. | ||||||||||
int |
getPlatformType()
Returns the platform type.
| ||||||||||
PrivacyManager |
getPrivacyManager()
Returns the privacy manager.
| ||||||||||
PushManager |
getPushManager()
Returns the
PushManager instance. | ||||||||||
UrlAllowList |
getUrlAllowList()
The URL allow list is used to determine if a URL is allowed to be used for various features, including:
Airship JS interface, open external URL action, wallet action, HTML in-app messages, and landing pages.
| ||||||||||
static String |
getVersion()
Returns the current Airship version.
| ||||||||||
boolean |
isDataCollectionEnabled()
This method is deprecated.
Enable/disable by using
PrivacyManager .
This will call through to the privacy manager to check if any features are enabled.
| ||||||||||
static boolean |
isFlying()
Tests if UAirship has been initialized and is ready for use.
| ||||||||||
static boolean |
isMainProcess()
Tests if the current process is the main process.
| ||||||||||
static boolean |
isTakingOff()
Tests if UAirship is currently taking off.
| ||||||||||
void |
setDataCollectionEnabled(boolean enabled)
This method is deprecated.
Enable/disable by using
PrivacyManager .
This will enable or disable FEATURE_ALL features.
| ||||||||||
void |
setDeepLinkListener(DeepLinkListener listener)
Sets the deep link listener.
| ||||||||||
void |
setImageLoader(ImageLoader imageLoader)
Sets the image loader.
| ||||||||||
void |
setLocaleOverride(Locale locale)
Sets a locale to be stored in UAirship.
| ||||||||||
static UAirship |
shared()
Returns the shared UAirship singleton instance.
| ||||||||||
static Cancelable |
shared(Looper looper, UAirship.OnReadyCallback callback)
Requests the airship instance asynchronously.
| ||||||||||
static Cancelable |
shared(UAirship.OnReadyCallback callback)
Requests the airship instance asynchronously.
| ||||||||||
static void |
takeOff(Application application)
Take off with config loaded from the
airshipconfig.properties file in the
assets directory. | ||||||||||
static void |
takeOff(Application application, UAirship.OnReadyCallback readyCallback)
Take off with a callback to perform airship configuration after
takeoff.
| ||||||||||
static void |
takeOff(Application application, AirshipConfigOptions options)
Take off with defined AirshipConfigOptions.
| ||||||||||
static void |
takeOff(Application application, AirshipConfigOptions options, UAirship.OnReadyCallback readyCallback)
Take off with a callback to perform airship configuration after takeoff.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Broadcast that is sent when UAirship is finished taking off.
Amazon platform type. Only ADM transport will be allowed.
Android platform type. Only FCM/HMS transport will be allowed.
Unknown platform. Returns if all features have been disabled in PrivacyManager
.
Flag to enable printing take off's stacktrace. Useful when debugging exceptions related to take off not being called first.
Deep links. If the deep link is an `uairship://` it will be handled internally by the SDK. All other deep links will be forwarded to the deep link listener.
deepLink | The deep link. |
---|
true
if the deep link was handled, otherwise false
.
The default Action Registry.
Returns the current configuration options.
Returns the drawable ID for the current Application's icon.
IllegalStateException | if takeOff has not been called. |
---|
Returns the current Application's ApplicationInfo. Wraps
PackageManager's getApplicationInfo()
method.
IllegalStateException | if takeOff has not been called. |
---|
Returns the current Application's name. Wraps
PackageManager's getApplicationLabel()
method.
IllegalStateException | if takeOff has not been called. |
---|
Returns the current Application version.
Returns the current Application's context.
IllegalStateException | if takeOff has not been called. |
---|
Returns the ApplicationMetrics
instance.
ApplicationMetrics
instance.
Returns the com.urbanairship.channel.AirshipChannel instance.
Returns the ChannelCapture
instance.
ChannelCapture
instance.
Returns the Contact instance.
Returns the deep link listener if one has been set, otherwise null.
IllegalStateException | if takeOff has not been called. |
---|
Get the locale stored in UAirship.
Returns the Application's PackageInfo
IllegalStateException | if takeOff has not been called. |
---|
Returns the Application's package manager.
IllegalStateException | if takeOff has not been called. |
---|
Returns the Application's package name.
IllegalStateException | if takeOff has not been called. |
---|
Returns the UAirship PermissionsManager
instance.
PermissionsManager
instance.
Returns the platform type.
AMAZON_PLATFORM
for Amazon, ANDROID_PLATFORM
for Android (FCM/HMS),
or UNKNOWN_PLATFORM
if the platform has not been resolved in the past and all features
in the SDK are opted out.
Returns the privacy manager.
Returns the PushManager
instance.
PushManager
instance.
The URL allow list is used to determine if a URL is allowed to be used for various features, including: Airship JS interface, open external URL action, wallet action, HTML in-app messages, and landing pages.
Returns the current Airship version.
This method is deprecated.
Enable/disable by using PrivacyManager
.
This will call through to the privacy manager to check if any features are enabled.
Deprecated. Use PrivacyManager
instead.
Checks if any features are enabled in the privacy manager.
true
if any feature is enabled, otherwise `false`.Tests if UAirship has been initialized and is ready for use.
true
if UAirship is ready for use; false
otherwise
Tests if the current process is the main process.
true
if currently within the main process; false
otherwise.
Tests if UAirship is currently taking off.
true
if UAirship is taking off; false
otherwise
This method is deprecated.
Enable/disable by using PrivacyManager
.
This will enable or disable FEATURE_ALL
features.
Deprecated. Use PrivacyManager
instead.
When enabled it will enable all privacy manager features. When disabled it will disable
all.
enabled | true to enable, false to disable. |
---|
Sets the deep link listener.
listener | the deep link listener. |
---|
Sets the image loader.
imageLoader | The image loader. |
---|
Sets a locale to be stored in UAirship.
locale | The new locale to use. |
---|
Returns the shared UAirship singleton instance. This method will block until airship is ready.
IllegalStateException | if takeoff is not called prior to this method. |
---|
Requests the airship instance asynchronously.
If airship is ready, the callback will not be called immediately, the callback is still dispatched to the specified looper. The blocking shared may unblock before any of the asynchronous callbacks are executed.
looper | A Looper object whose message queue will be used for the callback, or null to make callbacks on the calling thread or main thread if the current thread does not have a looper associated with it. |
---|---|
callback | An optional callback |
Requests the airship instance asynchronously.
This method calls through to shared(android.os.Looper, com.urbanairship.UAirship.OnReadyCallback)
with a null looper.
callback | An optional callback |
---|
Take off with config loaded from the airshipconfig.properties
file in the
assets directory. See applyDefaultProperties(Context)
.
application | The application (required) |
---|
Take off with a callback to perform airship configuration after
takeoff. The ready callback will be executed before the UAirship instance is returned by any
of the shared methods. The config will be loaded from airshipconfig.properties
file in the
assets directory. See applyDefaultProperties(Context)
.
application | The application (required) |
---|---|
readyCallback | Optional ready callback. The callback will be triggered on a background thread
that performs takeOff . If the callback takes longer than ~5 seconds it could cause ANRs within
the application.
|
Take off with defined AirshipConfigOptions.
application | The application (required) |
---|---|
options | The launch options. If not null, the options passed in here
will override the options loaded from the .properties file. This parameter
is useful for specifying options at runtime.
|
Take off with a callback to perform airship configuration after takeoff. The ready callback will be executed before the UAirship instance is returned by any of the shared methods.
application | The application (required) |
---|---|
options | The launch options. If not null, the options passed in here
will override the options loaded from the .properties file. This parameter
is useful for specifying options at runtime. |
readyCallback | Optional ready callback. The callback will be triggered on a background thread
that performs takeOff . If the callback takes longer than ~5 seconds it could cause ANRs within
the application.
|