Compare commits

..
Author SHA1 Message Date
Daniel Sogl 667d31fa80 feat(airship): add Live Activities/Live Updates and other 19.1.0 additions
Sync the wrapper with @ua/cordova-airship 19.1.0: Live Activity manager
(iOS), Live Update manager (Android), contact email/SMS registration,
JSON attribute editing, push enableUserNotifications, iOS badge reset,
and new Feature enum values.
2026-07-27 22:22:13 +02:00
2 changed files with 492 additions and 197 deletions
@@ -35,7 +35,7 @@ declare const window: Window & { Airship: any };
pluginName: 'Airship',
plugin: '@ua/cordova-airship',
pluginRef: 'Airship',
repo: 'https://www.npmjs.com/package/@ua/cordova-airship',
repo: 'https://github.com/urbanairship/urbanairship-cordova',
install: 'ionic cordova plugin add @ua/cordova-airship',
platforms: ['Android', 'iOS'],
})
@@ -52,6 +52,14 @@ export class Airship extends AwesomeCordovaNativePlugin {
public preferenceCenter: AirshipPreferenceCenter;
public privacyManager: AirshipPrivacyManager;
public push: AirshipPush;
/**
* Live Activity manager. iOS only.
*/
public liveActivityManager: AirshipLiveActivityManager;
/**
* Live Update manager. Android only.
*/
public liveUpdateManager: AirshipLiveUpdateManager;
/**
* Call after platform ready
@@ -257,6 +265,252 @@ export interface DisplayPreferenceCenterEvent {
preferenceCenterId: string;
}
/**
* Event fired when Live Activities are updated. iOS only.
*/
export interface LiveActivitiesUpdatedEvent {
/**
* The Live Activities.
*/
activities: LiveActivity[];
}
/**
* Live Activity info. iOS only.
*/
export interface LiveActivity {
/**
* The activity ID.
*/
id: string;
/**
* The attribute types.
*/
attributeTypes: string;
/**
* The content.
*/
content: LiveActivityContent;
/**
* The attributes.
*/
attributes: JsonObject;
}
/**
* Live Activity content. iOS only.
*/
export interface LiveActivityContent {
/**
* The content state.
*/
state: JsonObject;
/**
* Optional ISO 8601 date string that defines when the Live Activity will be stale.
*/
staleDate?: string;
/**
* The relevance score.
*/
relevanceScore: number;
}
/**
* Base Live Activity request. iOS only.
*/
export interface LiveActivityRequest {
/**
* Attributes type. This should match the Activity type of your Live Activity.
*/
attributesType: string;
}
/**
* Live Activity list request. iOS only.
*/
export type LiveActivityListRequest = LiveActivityRequest;
/**
* Live Activity start request. iOS only.
*/
export interface LiveActivityStartRequest extends LiveActivityRequest {
/**
* Dynamic content.
*/
content: LiveActivityContent;
/**
* Fixed attributes.
*/
attributes: JsonObject;
}
/**
* Live Activity update request. iOS only.
*/
export interface LiveActivityUpdateRequest extends LiveActivityRequest {
/**
* The Live Activity ID to update.
*/
activityId: string;
/**
* Dynamic content.
*/
content: LiveActivityContent;
}
/**
* Live Activity end request. iOS only.
*/
export interface LiveActivityEndRequest extends LiveActivityRequest {
/**
* The Live Activity ID to end.
*/
activityId: string;
/**
* Dynamic content.
*/
content?: LiveActivityContent;
/**
* Dismissal policy. Defaults to `LiveActivityDismissalPolicyDefault`.
*/
dismissalPolicy?: LiveActivityDismissalPolicy;
}
export type LiveActivityDismissalPolicy =
LiveActivityDismissalPolicyImmediate | LiveActivityDismissalPolicyDefault | LiveActivityDismissalPolicyAfterDate;
/**
* Dismissal policy to immediately dismiss the Live Activity on end.
*/
export interface LiveActivityDismissalPolicyImmediate {
type: 'immediate';
}
/**
* Dismissal policy to dismiss the Live Activity after the expiration.
*/
export interface LiveActivityDismissalPolicyDefault {
type: 'default';
}
/**
* Dismissal policy to dismiss the Live Activity after a given date.
*/
export interface LiveActivityDismissalPolicyAfterDate {
type: 'after';
/**
* ISO 8601 date string.
*/
date: string;
}
/**
* Live Update info. Android only.
*/
export interface LiveUpdate {
/**
* The Live Update name.
*/
name: string;
/**
* The Live Update type.
*/
type: string;
/**
* Dynamic content.
*/
content: JsonObject;
/**
* ISO 8601 date string of the last content update.
*/
lastContentUpdateTimestamp: string;
/**
* ISO 8601 date string of the last state update.
*/
lastStateChangeTimestamp: string;
/**
* Optional ISO 8601 date string that defines when to end this Live Update.
*/
dismissTimestamp?: string;
}
/**
* Live Update list request. Android only.
*/
export interface LiveUpdateListRequest {
type: string;
}
/**
* Live Update start request. Android only.
*/
export interface LiveUpdateStartRequest {
/**
* The Live Update name.
*/
name: string;
/**
* The Live Update type.
*/
type: string;
/**
* Dynamic content.
*/
content: JsonObject;
/**
* Optional ISO 8601 date string, used to filter out of order updates.
*/
timestamp?: string;
/**
* Optional ISO 8601 date string that defines when to end this Live Update.
*/
dismissTimestamp?: string;
}
/**
* Live Update update request. Android only.
*/
export interface LiveUpdateUpdateRequest {
/**
* The Live Update name.
*/
name: string;
/**
* Dynamic content.
*/
content: JsonObject;
/**
* Optional ISO 8601 date string, used to filter out of order updates.
*/
timestamp?: string;
/**
* Optional ISO 8601 date string that defines when to end this Live Update.
*/
dismissTimestamp?: string;
}
/**
* Live Update end request. Android only.
*/
export interface LiveUpdateEndRequest {
/**
* The Live Update name.
*/
name: string;
/**
* Dynamic content.
*/
content?: JsonObject;
/**
* Optional ISO 8601 date string, used to filter out of order updates.
*/
timestamp?: string;
/**
* Optional ISO 8601 date string that defines when to end this Live Update.
*/
dismissTimestamp?: string;
}
/**
* iOS options
*/
@@ -448,6 +702,18 @@ export interface ConfigEnvironment {
* Optional log level.
*/
logLevel?: LogLevel;
/**
* Optional iOS config.
*/
ios?: {
/**
* Log privacy level. By default it logs at `private`, not logging anything lower than info to the console
* and redacting logs with string interpolation. `public` will log all configured log levels to the console
* without redacting any of the log lines.
*/
logPrivacyLevel?: 'private' | 'public';
};
}
/**
@@ -619,12 +885,14 @@ export namespace Android {
* Enum of authorized Features.
*/
export enum Feature {
All = 'all',
InAppAutomation = 'in_app_automation',
MessageCenter = 'message_center',
Push = 'push',
Analytics = 'analytics',
TagsAndAttributes = 'tags_and_attributes',
Contacts = 'contacts',
FeatureFlags = 'feature_flags',
}
/**
@@ -996,6 +1264,17 @@ export interface AttributeEditor {
*/
setAttribute(name: string, value: string | number | boolean | Date): AttributeEditor;
/**
* Adds a JSON attribute.
*
* @param name The attribute name.
* @param instanceId The instance ID.
* @param json The json value. Must not contain `exp` as top level key.
* @param expiration Optional expiration.
* @return The attribute editor instance.
*/
setJsonAttribute(name: string, instanceId: string, json: Record<string, any>, expiration?: Date): AttributeEditor;
/**
* Removes an attribute.
* @param name The name of the attribute to remove.
@@ -1003,6 +1282,14 @@ export interface AttributeEditor {
*/
removeAttribute(name: string): AttributeEditor;
/**
* Removes a JSON attribute.
* @param name The name of the attribute to remove.
* @param instanceId The instance ID.
* @return The attribute editor instance.
*/
removeJsonAttribute(name: string, instanceId: string): AttributeEditor;
/**
* Applies the attribute operations.
* @param success Success callback.
@@ -1044,6 +1331,15 @@ class AirshipPush {
return;
}
/**
* Enables user notifications and prompts the user for permission, if needed.
* @returns Whether user notifications are enabled after the request.
*/
@CordovaInstance()
enableUserNotifications(): Promise<boolean> {
return;
}
/**
* Gets the notification status.
*/
@@ -1186,6 +1482,13 @@ export interface AirshipPushIOS {
*/
getBadgeNumber(success: (badge: number) => void, error?: (err: string) => void): void;
/**
* Resets the badge number to zero.
* @param success Success callback.
* @param error Error callback.
*/
resetBadge(success?: () => void, error?: (err: string) => void): void;
/**
* Gets the list of authorized notification settings.
* @param success Success callback.
@@ -1550,6 +1853,41 @@ export interface AirshipFeatureFlagManager {
trackInteraction(flag: FeatureFlag, success?: () => void, error?: (err: string) => void): void;
}
/**
* Options for email channel registration.
*/
export interface EmailRegistrationOptions {
/**
* Transactional opt-in date as milliseconds since epoch.
*/
transactionalOptedIn?: number;
/**
* Commercial opt-in date as milliseconds since epoch.
*/
commercialOptedIn?: number;
/**
* Custom properties for the email channel.
*/
properties?: Record<string, string>;
/**
* Request double opt-in for commercial messages when `commercialOptedIn` is not set.
*/
doubleOptIn?: boolean;
}
/**
* Options for SMS channel registration.
*/
export interface SmsRegistrationOptions {
/**
* The sender ID.
*/
senderId: string;
}
/**
* Airship contact.
*/
@@ -1620,6 +1958,26 @@ class AirshipContact {
reset(): Promise<void> {
return;
}
/**
* Registers an email channel for the contact.
* @param email The email address.
* @param options Registration options.
*/
@CordovaInstance()
registerEmail(email: string, options: EmailRegistrationOptions): Promise<void> {
return;
}
/**
* Registers an SMS channel for the contact.
* @param msisdn The MSISDN, including country code.
* @param options Registration options.
*/
@CordovaInstance()
registerSMS(msisdn: string, options: SmsRegistrationOptions): Promise<void> {
return;
}
}
/**
@@ -1765,3 +2123,114 @@ export interface AirshipActions {
error?: (err: string) => void
): void;
}
/**
* Live Activity manager. iOS only.
*/
export interface AirshipLiveActivityManager {
/**
* Lists any Live Activities for the request.
* @param request The request options.
* @param success Success callback with the list.
* @param error Error callback.
*/
list(
request: LiveActivityListRequest,
success: (activities: LiveActivity[]) => void,
error?: (err: string) => void
): void;
/**
* Lists all Live Activities.
* @param success Success callback with the list.
* @param error Error callback.
*/
listAll(success: (activities: LiveActivity[]) => void, error?: (err: string) => void): void;
/**
* Starts a Live Activity.
* @param request The request options.
* @param success Success callback with the started activity.
* @param error Error callback.
*/
start(
request: LiveActivityStartRequest,
success: (activity: LiveActivity) => void,
error?: (err: string) => void
): void;
/**
* Updates a Live Activity.
* @param request The request options.
* @param success Success callback.
* @param error Error callback.
*/
update(request: LiveActivityUpdateRequest, success?: () => void, error?: (err: string) => void): void;
/**
* Ends a Live Activity.
* @param request The request options.
* @param success Success callback.
* @param error Error callback.
*/
end(request: LiveActivityEndRequest, success?: () => void, error?: (err: string) => void): void;
/**
* Live Activities updated listener.
*
* @param callback The callback.
* @return A cancellable that can be used to cancel the listener.
*/
onLiveActivitiesUpdated(callback: (event: LiveActivitiesUpdatedEvent) => void): Cancellable;
}
/**
* Live Update manager. Android only.
*/
export interface AirshipLiveUpdateManager {
/**
* Lists any Live Updates for the request.
* @param request The request options.
* @param success Success callback with the list.
* @param error Error callback.
*/
list(request: LiveUpdateListRequest, success: (updates: LiveUpdate[]) => void, error?: (err: string) => void): void;
/**
* Lists all Live Updates.
* @param success Success callback with the list.
* @param error Error callback.
*/
listAll(success: (updates: LiveUpdate[]) => void, error?: (err: string) => void): void;
/**
* Starts a Live Update.
* @param request The request options.
* @param success Success callback.
* @param error Error callback.
*/
start(request: LiveUpdateStartRequest, success?: () => void, error?: (err: string) => void): void;
/**
* Updates a Live Update.
* @param request The request options.
* @param success Success callback.
* @param error Error callback.
*/
update(request: LiveUpdateUpdateRequest, success?: () => void, error?: (err: string) => void): void;
/**
* Ends a Live Update.
* @param request The request options.
* @param success Success callback.
* @param error Error callback.
*/
end(request: LiveUpdateEndRequest, success?: () => void, error?: (err: string) => void): void;
/**
* Clears all Live Updates.
* @param success Success callback.
* @param error Error callback.
*/
clearAll(success?: () => void, error?: (err: string) => void): void;
}
@@ -32,13 +32,6 @@ import { Cordova, CordovaProperty, AwesomeCordovaNativePlugin, Plugin } from '@a
*
* ```
*/
export interface DiagnosticLocalNetworkAuthorizationOptions {
/**
* Override the default fallback timeout (2000ms) before treating a slow response as indeterminate (`UNKNOWN`).
*/
timeoutMs?: number;
}
@Plugin({
pluginName: 'Diagnostic',
plugin: 'cordova.plugins.diagnostic',
@@ -53,7 +46,6 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
ACCESS_BACKGROUND_LOCATION: 'ACCESS_BACKGROUND_LOCATION',
ACCESS_COARSE_LOCATION: 'ACCESS_COARSE_LOCATION',
ACCESS_FINE_LOCATION: 'ACCESS_FINE_LOCATION',
ACCESS_LOCAL_NETWORK: 'ACCESS_LOCAL_NETWORK',
ACCESS_MEDIA_LOCATION: 'ACCESS_MEDIA_LOCATION',
ACTIVITY_RECOGNITION: 'ACTIVITY_RECOGNITION',
ADD_VOICEMAIL: 'ADD_VOICEMAIL',
@@ -69,7 +61,6 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
NEARBY_WIFI_DEVICES: 'NEARBY_WIFI_DEVICES',
POST_NOTIFICATIONS: 'POST_NOTIFICATIONS',
PROCESS_OUTGOING_CALLS: 'PROCESS_OUTGOING_CALLS',
RANGING: 'RANGING',
READ_CALENDAR: 'READ_CALENDAR',
READ_CALL_LOG: 'READ_CALL_LOG',
READ_CONTACTS: 'READ_CONTACTS',
@@ -77,7 +68,6 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
READ_MEDIA_AUDIO: 'READ_MEDIA_AUDIO',
READ_MEDIA_IMAGES: 'READ_MEDIA_IMAGES',
READ_MEDIA_VIDEO: 'READ_MEDIA_VIDEO',
READ_MEDIA_VISUAL_USER_SELECTED: 'READ_MEDIA_VISUAL_USER_SELECTED',
READ_PHONE_NUMBERS: 'READ_PHONE_NUMBERS',
READ_PHONE_STATE: 'READ_PHONE_STATE',
READ_SMS: 'READ_SMS',
@@ -109,11 +99,6 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
EPHEMERAL: string;
PROVISIONAL: string;
LIMITED: string;
/**
* Returned when the underlying OS has not yet provided a concrete status (for example, if an iOS
* Local Network probe timed out). Treat this as a transient state and retry before surfacing a denial to the user.
*/
UNKNOWN: string;
};
locationAuthorizationMode = {
@@ -125,22 +110,8 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
* Location accuracy authorization
*/
locationAccuracyAuthorization = {
/** Alias for BEST. On iOS, sets `kCLLocationAccuracyBest`. */
FULL: 'full',
/** On iOS, sets `kCLLocationAccuracyReduced` - approximate location, no GPS. */
REDUCED: 'reduced',
/** On iOS, sets `kCLLocationAccuracyBest`. May engage GPS hardware. */
BEST: 'best',
/** On iOS, sets `kCLLocationAccuracyBestForNavigation`. Highest accuracy using additional sensor data. */
BEST_FOR_NAVIGATION: 'bestForNavigation',
/** On iOS, sets `kCLLocationAccuracyNearestTenMeters`. */
NEAREST_TEN_METERS: 'nearestTenMeters',
/** On iOS, sets `kCLLocationAccuracyHundredMeters`. */
HUNDRED_METERS: 'hundredMeters',
/** On iOS, sets `kCLLocationAccuracyKilometer`. */
KILOMETER: 'kilometer',
/** On iOS, sets `kCLLocationAccuracyThreeKilometers`. */
THREE_KILOMETERS: 'threeKilometers',
};
permissionGroups = {
@@ -161,7 +132,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
SENSORS: ['BODY_SENSORS'],
SMS: ['SEND_SMS', 'RECEIVE_SMS', 'READ_SMS', 'RECEIVE_WAP_PUSH', 'RECEIVE_MMS'],
STORAGE: ['READ_EXTERNAL_STORAGE', 'WRITE_EXTERNAL_STORAGE'],
NEARBY_DEVICES: ['BLUETOOTH_ADVERTISE', 'BLUETOOTH_SCAN', 'BLUETOOTH_CONNECT'],
NEARBY_DEVICES: ["BLUETOOTH_ADVERTISE", "BLUETOOTH_SCAN", "BLUETOOTH_CONNECT"],
};
locationMode = {
@@ -193,21 +164,21 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
@CordovaProperty()
cpuArchitecture: {
MIPS: string;
MIPS_64: string;
UNKNOWN: string;
ARMv6: string;
ARMv7: string;
ARMv8: string;
X86: string;
X86_64: string;
MIPS: string;
MIPS_64: string;
UNKNOWN: string;
ARMv6: string;
ARMv7: string;
ARMv8: string;
X86: string;
X86_64: string;
};
@CordovaProperty()
remoteNotificationType: {
ALERT: string;
SOUND: string;
BADGE: string;
ALERT: string;
SOUND: string;
BADGE: string;
};
@CordovaProperty()
@@ -336,6 +307,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
return;
}
// ANDROID AND IOS ONLY
/**
@@ -388,6 +360,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
return;
}
/**
* Returns the location authorization status for the application.
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
@@ -605,7 +578,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
@Cordova({ platforms: ['Android', 'iOS'] })
getArchitecture(): Promise<any> {
return;
}
}
/**
* Returns the current battery level of the device as a percentage.
@@ -615,62 +588,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
@Cordova({ platforms: ['Android', 'iOS'] })
getCurrentBatteryLevel(): Promise<any> {
return;
}
/**
* Checks if low power mode is currently enabled on the device.
*
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
isLowPowerModeEnabled(): Promise<boolean> {
return;
}
/**
* Registers a function to be called whenever the device low power mode status changes.
*
* @param {Function} handler
*/
@Cordova({ platforms: ['Android', 'iOS'], sync: true })
onLowPowerModeChange(handler: Function): void {}
/**
* Checks if currently running app build is a debug build.
*
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
isDebugBuild(): Promise<boolean> {
return;
}
/**
* Checks if Accessibility Mode (Talkback on Android, VoiceOver on iOS) is currently enabled on the device.
*
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
isAccessibilityModeEnabled(): Promise<boolean> {
return;
}
/**
* Checks if app is able to access device heading.
*
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
isCompassAvailable(): Promise<boolean> {
return;
}
/**
* Opens notification settings for your app.
* On Android versions lower than O and on iOS versions lower than 15.4, this will open the same page as `switchToSettings()`.
*/
@Cordova({ platforms: ['Android', 'iOS'], sync: true })
switchToNotificationSettings(): void {}
}
// ANDROID ONLY
@@ -687,6 +605,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
return;
}
/**
* Checks if high-accuracy locations are available to the app from GPS hardware.
* Returns true if Location mode is enabled and is set to "Device only" or "High accuracy" AND if the app is authorized to use location.
@@ -745,7 +664,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
return;
}
/**
/**
* Checks if mobile data is enabled on device.
*
* @returns {Promise<any>}
@@ -755,37 +674,6 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
return;
}
/**
* Checks if the app is currently ignoring battery optimizations.
*
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isIgnoringBatteryOptimizations(): Promise<boolean> {
return;
}
/**
* Prompts the user to allow the app to ignore battery optimizations.
* Requires permission `<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />`
*
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'] })
requestIgnoreBatteryOptimizations(): Promise<any> {
return;
}
/**
* Checks if touch exploration (in accessibility mode) is currently enabled on the device.
*
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isTouchExplorationEnabled(): Promise<boolean> {
return;
}
/**
* Returns the current location mode setting for the device.
*
@@ -801,7 +689,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
*
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
@Cordova({ platforms: ['Android'] })
getDeviceOSVersion(): Promise<any> {
return;
}
@@ -811,7 +699,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
*
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
@Cordova({ platforms: ['Android'] })
getBuildOSVersion(): Promise<any> {
return;
}
@@ -938,7 +826,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
getBluetoothAuthorizationStatus(): Promise<any> {
return;
}
/**
* Returns the individual authorization status for each Bluetooth run-time permission on Android 12+ / API 31+
* On Android 11 / API 30 and below, all will be returned as GRANTED if the manifest has BLUETOOTH since they are implicitly granted at build-time.
@@ -950,19 +838,6 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
return;
}
/**
* Returns the individual camera authorization statuses for each of the relevant permissions.
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5.1 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
*
* @param {boolean} [storage] Android only: If true, requests storage permissions in addition to CAMERA run-time permission.
* cordova-plugin-camera@2.2+ requires both of these permissions. Defaults to true.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
getCameraAuthorizationStatuses(storage?: boolean): Promise<any> {
return;
}
/**
* Checks if the application is authorized to use external storage.
*
@@ -1156,7 +1031,7 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
return;
}
/**
/**
* Presents limited library picker UI on iOS 14+
*
* @returns {Promise<any>}
@@ -1362,53 +1237,4 @@ export class Diagnostic extends AwesomeCordovaNativePlugin {
*/
@Cordova({ platforms: ['iOS'], sync: true })
registerLocationAccuracyAuthorizationChangeHandler(handler: Function): void {}
/**
* Checks if mobile data is authorized for this app.
* Returns true if the per-app Mobile Data setting is set to enabled (regardless of whether the device is currently connected to a cellular network)
*
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['iOS'] })
isMobileDataAuthorized(): Promise<boolean> {
return;
}
/**
* Checks if the app is authorised to access devices on the local network (iOS 14+).
* On iOS versions prior to 14 this will always return TRUE as no local network authorization is required.
*
* @param {DiagnosticLocalNetworkAuthorizationOptions} [options] Optional timeout control - provide `timeoutMs` to override the default 2000ms timeout.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['iOS'], callbackOrder: 'reverse' })
isLocalNetworkAuthorized(options?: DiagnosticLocalNetworkAuthorizationOptions): Promise<boolean> {
return;
}
/**
* Returns the app's Local Network authorization status (iOS 14+).
* On iOS 14+ this returns one of: NOT_REQUESTED, GRANTED, DENIED_ALWAYS, UNKNOWN (this.permissionStatus).
* `UNKNOWN` indicates that iOS did not return a definitive answer before the timeout elapsed, so the app can retry before warning the user.
* On iOS versions prior to 14 this will always return GRANTED as no authorization is required.
*
* @param {DiagnosticLocalNetworkAuthorizationOptions} [options] Optional timeout override (defaults to 2000ms).
* @returns {Promise<string>}
*/
@Cordova({ platforms: ['iOS'], callbackOrder: 'reverse' })
getLocalNetworkAuthorizationStatus(options?: DiagnosticLocalNetworkAuthorizationOptions): Promise<string> {
return;
}
/**
* Requests the user to authorise the app to access devices on the local network (iOS 14+).
* On iOS versions prior to 14 this does nothing and will return success as no authorization is required.
* May return UNKNOWN if iOS does not respond before the native APIs time out, allowing the app to retry.
*
* @returns {Promise<string>}
*/
@Cordova({ platforms: ['iOS'] })
requestLocalNetworkAuthorization(): Promise<string> {
return;
}
}