diff --git a/urbanairship-cordova/plugin.xml b/urbanairship-cordova/plugin.xml index c4a9da09..47bc9782 100644 --- a/urbanairship-cordova/plugin.xml +++ b/urbanairship-cordova/plugin.xml @@ -133,7 +133,7 @@ - + diff --git a/urbanairship-cordova/src/android/AirshipCordova.kt b/urbanairship-cordova/src/android/AirshipCordova.kt index 7608ca43..ca6c5a9a 100644 --- a/urbanairship-cordova/src/android/AirshipCordova.kt +++ b/urbanairship-cordova/src/android/AirshipCordova.kt @@ -204,6 +204,14 @@ class AirshipCordova : CordovaPlugin() { } } "push#android#setNotificationConfig" -> callback.resolveResult(method) { proxy.push.setNotificationConfig(arg) } + "push#android#setForegroundNotificationsEnabled" -> callback.resolveResult(method) { + proxy.push.isForegroundNotificationsEnabled = arg.requireBoolean() + return@resolveResult Unit + } + "push#android#isForegroundNotificationsEnabled" -> callback.resolveResult(method) { + proxy.push.isForegroundNotificationsEnabled + } + // In-App "inApp#setPaused" -> callback.resolveResult(method) { proxy.inApp.setPaused(arg.getBoolean(false)) } "inApp#isPaused" -> callback.resolveResult(method) { proxy.inApp.isPaused() } @@ -214,10 +222,10 @@ class AirshipCordova : CordovaPlugin() { "analytics#trackScreen" -> callback.resolveResult(method) { proxy.analytics.trackScreen(arg.optString()) } "analytics#addEvent" -> callback.resolveResult(method) { proxy.analytics.addEvent(arg) } "analytics#associateIdentifier" -> { - val args = arg.requireStringList() + val associatedIdentifierArgs = arg.requireStringList() proxy.analytics.associateIdentifier( - args[0], - args.getOrNull(1) + associatedIdentifierArgs[0], + associatedIdentifierArgs.getOrNull(1) ) } @@ -227,16 +235,17 @@ class AirshipCordova : CordovaPlugin() { } "messageCenter#dismiss" -> callback.resolveResult(method) { proxy.messageCenter.dismiss() } "messageCenter#display" -> callback.resolveResult(method) { proxy.messageCenter.display(arg.optString()) } + "messageCenter#showMessageView" -> callback.resolveResult(method) { proxy.messageCenter.showMessageView(arg.requireString()) } "messageCenter#markMessageRead" -> callback.resolveResult(method) { proxy.messageCenter.markMessageRead(arg.requireString()) } "messageCenter#deleteMessage" -> callback.resolveResult(method) { proxy.messageCenter.deleteMessage(arg.requireString()) } "messageCenter#getUnreadMessageCount" -> callback.resolveResult(method) { proxy.messageCenter.getUnreadMessagesCount() } "messageCenter#setAutoLaunch" -> callback.resolveResult(method) { proxy.messageCenter.setAutoLaunchDefaultMessageCenter(arg.requireBoolean()) } - "messageCenter#refreshMessages" -> callback.resolveDeferred(method) { callback -> + "messageCenter#refreshMessages" -> callback.resolveDeferred(method) { resolveCallback -> proxy.messageCenter.refreshInbox().addResultCallback { if (it == true) { - callback(null, null) + resolveCallback(null, null) } else { - callback(null, Exception("Failed to refresh")) + resolveCallback(null, Exception("Failed to refresh")) } } } @@ -245,10 +254,10 @@ class AirshipCordova : CordovaPlugin() { "preferenceCenter#display" -> callback.resolveResult(method) { proxy.preferenceCenter.displayPreferenceCenter(arg.requireString()) } "preferenceCenter#getConfig" -> callback.resolvePending(method) { proxy.preferenceCenter.getPreferenceCenterConfig(arg.requireString()) } "preferenceCenter#setAutoLaunch" -> callback.resolveResult(method) { - val args = arg.requireList() + val autoLaunchArgs = arg.requireList() proxy.preferenceCenter.setAutoLaunchPreferenceCenter( - args.get(0).requireString(), - args.get(1).getBoolean(false) + autoLaunchArgs.get(0).requireString(), + autoLaunchArgs.get(1).getBoolean(false) ) } @@ -265,7 +274,7 @@ class AirshipCordova : CordovaPlugin() { "locale#clearLocaleOverride" -> callback.resolveResult(method) { proxy.locale.clearLocale() } // Actions - "actions#run" -> callback.resolveDeferred(method) { callback -> + "actions#run" -> callback.resolveDeferred(method) { resolveCallback -> val actionArgs = arg.requireList() val name= actionArgs.get(0).requireString() val value: JsonValue? = if (actionArgs.size() == 2) { actionArgs.get(1) } else { null } @@ -273,34 +282,34 @@ class AirshipCordova : CordovaPlugin() { proxy.actions.runAction(name, value) .addResultCallback { actionResult -> if (actionResult != null && actionResult.status == ActionResult.STATUS_COMPLETED) { - callback(actionResult.value, null) + resolveCallback(actionResult.value, null) } else { - callback(null, Exception("Action failed ${actionResult?.status}")) + resolveCallback(null, Exception("Action failed ${actionResult?.status}")) } } } // Feature Flag - "featureFlagManager#flag" -> callback.resolveDeferred(method) { callback -> + "featureFlagManager#flag" -> callback.resolveDeferred(method) { resolveCallback -> scope.launch { try { val flag = proxy.featureFlagManager.flag(arg.requireString()) - callback(flag, null) + resolveCallback(flag, null) } catch (e: Exception) { - callback(null, e) + resolveCallback(null, e) } } } "featureFlagManager#trackInteraction" -> { - callback.resolveDeferred(method) { callback -> + callback.resolveDeferred(method) { resolveCallback -> scope.launch { try { val featureFlagProxy = FeatureFlagProxy(arg) proxy.featureFlagManager.trackInteraction(flag = featureFlagProxy) - callback(null, null) + resolveCallback(null, null) } catch (e: Exception) { - callback(null, e) + resolveCallback(null, e) } } } diff --git a/urbanairship-cordova/src/android/AirshipCordovaVersion.kt b/urbanairship-cordova/src/android/AirshipCordovaVersion.kt index 5c137f23..ebdb0a3e 100644 --- a/urbanairship-cordova/src/android/AirshipCordovaVersion.kt +++ b/urbanairship-cordova/src/android/AirshipCordovaVersion.kt @@ -3,5 +3,5 @@ package com.urbanairship.cordova object AirshipCordovaVersion { - var version = "16.0.0" + var version = "15.0.0" } \ No newline at end of file diff --git a/urbanairship-cordova/src/android/CordovaAutopilot.kt b/urbanairship-cordova/src/android/CordovaAutopilot.kt index a518f85d..f21ffbdc 100644 --- a/urbanairship-cordova/src/android/CordovaAutopilot.kt +++ b/urbanairship-cordova/src/android/CordovaAutopilot.kt @@ -12,13 +12,11 @@ import com.urbanairship.UAirship import com.urbanairship.analytics.Analytics import com.urbanairship.android.framework.proxy.BaseAutopilot import com.urbanairship.android.framework.proxy.ProxyStore -import com.urbanairship.android.framework.proxy.proxies.AirshipProxy - class CordovaAutopilot : BaseAutopilot() { companion object { - private val PREFERENCE_FILE = "com.urbanairship.ua_plugin_shared_preferences" + private const val PREFERENCE_FILE = "com.urbanairship.ua_plugin_shared_preferences" private const val PROCESSED_NOTIFICATIONS_OPTED_OUT_FLAG = "com.urbanairship.PROCESSED_NOTIFICATIONS_OPTED_OUT_FLAG" } @@ -70,11 +68,8 @@ class CordovaAutopilot : BaseAutopilot() { override fun onMigrateData(context: Context, proxyStore: ProxyStore) { val settings = settings(context) - val migrator = ProxyDataMigrator(preferences(context)) - migrator.migrate(proxyStore, settings) - - // TODO -// proxyStore.defaultAutoLaunchMessageCenter = settings?.autoLaunchMessageCenter ?: true + ProxyDataMigrator(preferences(context)).migrate(proxyStore, settings) + proxyStore.defaultAutoLaunchMessageCenter = settings.autoLaunchMessageCenter ?: true } override fun createConfigBuilder(context: Context): AirshipConfigOptions.Builder { diff --git a/urbanairship-cordova/src/android/ProxyDataMigrator.kt b/urbanairship-cordova/src/android/ProxyDataMigrator.kt index c707089d..29a0687c 100644 --- a/urbanairship-cordova/src/android/ProxyDataMigrator.kt +++ b/urbanairship-cordova/src/android/ProxyDataMigrator.kt @@ -8,7 +8,7 @@ import com.urbanairship.android.framework.proxy.NotificationConfig import com.urbanairship.android.framework.proxy.ProxyConfig import com.urbanairship.android.framework.proxy.ProxyStore -internal class ProxyDataMigrator(val preferences: SharedPreferences) { +internal class ProxyDataMigrator(private val preferences: SharedPreferences) { companion object { private const val PRODUCTION_KEY = "com.urbanairship.production_app_key" @@ -65,8 +65,7 @@ internal class ProxyDataMigrator(val preferences: SharedPreferences) { if (development != null || production != null) { store.airshipConfig = ProxyConfig( productionEnvironment = production, - developmentEnvironment = development, - site = settings.cloudSite + developmentEnvironment = development ) preferences.edit { @@ -92,8 +91,7 @@ internal class ProxyDataMigrator(val preferences: SharedPreferences) { return } - // TODO -// store.showForegroundNotifications = preferences.getBoolean(FOREGROUND_NOTIFICATIONS, true) + store.isForegroundNotificationsEnabled = preferences.getBoolean(FOREGROUND_NOTIFICATIONS, true) preferences.edit { this.remove(FOREGROUND_NOTIFICATIONS) } } diff --git a/urbanairship-cordova/src/android/build-extras.gradle b/urbanairship-cordova/src/android/build-extras.gradle index 1f64853c..e037ae19 100644 --- a/urbanairship-cordova/src/android/build-extras.gradle +++ b/urbanairship-cordova/src/android/build-extras.gradle @@ -1,6 +1,5 @@ dependencies { - ext.airship_framework_proxy_version = '5.2.0' - api "com.urbanairship.android:airship-framework-proxy:$airship_framework_proxy_version" + api "com.urbanairship.android:airship-framework-proxy:5.2.1" } cdvPluginPostBuildExtras.push({ diff --git a/urbanairship-cordova/src/ios/AirshipCordova.swift b/urbanairship-cordova/src/ios/AirshipCordova.swift index b7cbdb53..b289229e 100644 --- a/urbanairship-cordova/src/ios/AirshipCordova.swift +++ b/urbanairship-cordova/src/ios/AirshipCordova.swift @@ -28,7 +28,6 @@ public final class AirshipCordova: CDVPlugin { .notificationStatusChanged: "airship.event.notification_status_changed" ] - @MainActor public override func pluginInitialize() { let settings = AirshipCordovaPluginSettings.from( @@ -417,6 +416,16 @@ public final class AirshipCordova: CDVPlugin { ) return nil + case "messageCenter#showMessageView": + try AirshipProxy.shared.messageCenter.showMessageView( + messageID: try command.requireStringArg() + ) + return nil + + case "messageCenter#dismiss": + try AirshipProxy.shared.messageCenter.dismiss() + return nil + case "messageCenter#markMessageRead": try await AirshipProxy.shared.messageCenter.markMessageRead( messageID: command.requireStringArg() diff --git a/urbanairship-cordova/src/ios/AirshipCordovaAutopilot.swift b/urbanairship-cordova/src/ios/AirshipCordovaAutopilot.swift index f07a8554..954b395d 100644 --- a/urbanairship-cordova/src/ios/AirshipCordovaAutopilot.swift +++ b/urbanairship-cordova/src/ios/AirshipCordovaAutopilot.swift @@ -26,18 +26,14 @@ final class AirshipCordovaAutopilot { launchOptions: self.launchOptions ) } + } extension AirshipCordovaAutopilot: AirshipProxyDelegate { public func migrateData(store: AirshipFrameworkProxy.ProxyStore) { - AirshipCordovaProxyDataMigrator().migrateData( - store: store, - settings: settings - ) - - /// TODO update proxy to set defaults -// store.defaultPresentationOptions = settings?.presentationOptions ?? [] -// store.defaultAutoLaunchMessageCenter = settings?.autoLaunchMessageCenter ?? true + AirshipCordovaProxyDataMigrator().migrateData(store: store) + store.defaultPresentationOptions = settings?.presentationOptions ?? [] + store.defaultAutoDisplayMessageCenter = settings?.autoLaunchMessageCenter ?? true } public func loadDefaultConfig() -> AirshipConfig { diff --git a/urbanairship-cordova/src/ios/AirshipCordovaPluginSettings.swift b/urbanairship-cordova/src/ios/AirshipCordovaPluginSettings.swift index cd22f82f..329ad709 100644 --- a/urbanairship-cordova/src/ios/AirshipCordovaPluginSettings.swift +++ b/urbanairship-cordova/src/ios/AirshipCordovaPluginSettings.swift @@ -56,6 +56,7 @@ struct AirshipCordovaPluginSettings: Decodable, Sendable { var initialConfigURL: String? var presentationOptions: UNNotificationPresentationOptions var autoLaunchMessageCenter: Bool? + var messageCenterStyleConfig: String? enum CodingKeys: String, CodingKey, CaseIterable { case productionAppKey = "com.urbanairship.production_app_key" @@ -74,8 +75,9 @@ struct AirshipCordovaPluginSettings: Decodable, Sendable { case badgePresentationOption = "com.urbanairship.ios_foreground_notification_presentation_badge" case soundPresentationOption = "com.urbanairship.ios_foreground_notification_presentation_sound" case autoLaunchMessageCenter = "com.urbanairship.auto_launch_message_center" + case messageCenterStyleConfig = "com.urbanairship.message.center.style.file" } - + static func from(settings: [AnyHashable: Any]?) -> AirshipCordovaPluginSettings? { guard let settings = settings else { return nil } let knownKeys = CodingKeys.allCases.map { $0.rawValue } @@ -108,6 +110,7 @@ struct AirshipCordovaPluginSettings: Decodable, Sendable { self.initialConfigURL = try container.decodeIfPresent(String.self, forKey: .initialConfigURL) self.analyticsEnabled = try container.decodeIfPresent(String.self, forKey: .analyticsEnabled)?.asBool self.autoLaunchMessageCenter = try container.decodeIfPresent(String.self, forKey: .autoLaunchMessageCenter)?.asBool + self.messageCenterStyleConfig = try container.decodeIfPresent(String.self, forKey: .messageCenterStyleConfig) let alert = try container.decodeIfPresent(String.self, forKey: .alertPresentationOption)?.asBool @@ -172,6 +175,9 @@ struct AirshipCordovaPluginSettings: Decodable, Sendable { config.isAnalyticsEnabled = analyticsEnabled } + if let messageCenterStyleConfig = self.messageCenterStyleConfig { + config.messageCenterStyleConfig = messageCenterStyleConfig + } } } diff --git a/urbanairship-cordova/src/ios/AirshipCordovaProxyDataMigrator.swift b/urbanairship-cordova/src/ios/AirshipCordovaProxyDataMigrator.swift index 30d5b5e5..43b7d8fc 100644 --- a/urbanairship-cordova/src/ios/AirshipCordovaProxyDataMigrator.swift +++ b/urbanairship-cordova/src/ios/AirshipCordovaProxyDataMigrator.swift @@ -14,7 +14,10 @@ struct AirshipCordovaProxyDataMigrator { private static let site = "com.urbanairship.site" private static let developmentAppKey = "com.urbanairship.development_app_key" private static let developmentAppSecret = "com.urbanairship.development_app_secret" + + private static let messageCenterStyleConfigKey = "com.urbanairship.message.center.style.file" private static let autoLaunchMessageCenterKey = "com.urbanairship.auto_launch_message_center" + private static let autoLaunchPreferenceCenterPrefix = "com.urbanairship.preference_" private static let autoLaunchPreferenceCenterSuffix = "_custom_ui" @@ -22,19 +25,22 @@ struct AirshipCordovaProxyDataMigrator { private static let notificationPresentationBadgeKey = "com.urbanairship.ios_foreground_notification_presentation_badge" private static let notificationPresentationSoundKey = "com.urbanairship.ios_foreground_notification_presentation_sound" - func migrateData(store: ProxyStore, settings: AirshipCordovaPluginSettings?) { - migrateConfig(store: store, settings: settings) + + func migrateData(store: ProxyStore) { + migrateConfig(store: store) migrateAutoLaunchMessageCenter(store: store) migrateAutoLaunchPreferenceCenter(store: store) migratePresentationOptions(store: store) } - private func migrateConfig(store: ProxyStore, settings: AirshipCordovaPluginSettings?) { + private func migrateConfig(store: ProxyStore) { let productionAppKey = defaults.string(forKey: Self.productionAppKey) let productionAppSecret = defaults.string(forKey: Self.productionAppSecret) let developmentAppKey = defaults.string(forKey: Self.developmentAppKey) let developmentAppSecret = defaults.string(forKey: Self.developmentAppSecret) + let messageCenterStyleConfig = defaults.string(forKey: Self.messageCenterStyleConfigKey) + let site: ProxyConfig.Site? = if let string = defaults.string(forKey: Self.site) { AirshipCordovaSite(rawValue: string)?.proxyValue } else { @@ -44,7 +50,7 @@ struct AirshipCordovaProxyDataMigrator { var production: ProxyConfig.Environment? if let productionAppKey, let productionAppSecret { production = ProxyConfig.Environment( - logLevel: settings?.productionLogLevel?.proxyValue, + logLevel: nil, appKey: productionAppKey, appSecret: productionAppSecret ) @@ -53,7 +59,7 @@ struct AirshipCordovaProxyDataMigrator { var development: ProxyConfig.Environment? if let developmentAppKey, let developmentAppSecret { development = ProxyConfig.Environment( - logLevel: settings?.developmentLogLevel?.proxyValue, + logLevel: nil, appKey: developmentAppKey, appSecret: developmentAppSecret ) @@ -63,11 +69,15 @@ struct AirshipCordovaProxyDataMigrator { store.config = ProxyConfig( productionEnvironment: production, developmentEnvironment: development, - site: site ?? settings?.site?.proxyValue ?? .us + ios: ProxyConfig.PlatformConfig( + messageCenterStyleConfig: messageCenterStyleConfig + ), + site: site ) } [ + Self.messageCenterStyleConfigKey, Self.productionAppKey, Self.productionAppSecret, Self.developmentAppKey, diff --git a/urbanairship-cordova/www/Airship.js b/urbanairship-cordova/www/Airship.js index cf9d5a22..e039b9ec 100644 --- a/urbanairship-cordova/www/Airship.js +++ b/urbanairship-cordova/www/Airship.js @@ -11,9 +11,9 @@ var cordova = require("cordova"), messageCenter: {}, featureFlagManager: {}, preferenceCenter: {}, - push: { - ios: {}, - android: {} + push: { + ios: {}, + android: {} }, privacyManager: {}, actions: {}, @@ -40,14 +40,14 @@ function registerListener(name, callback) { let subCallbackId = callbackId callbackId += 1 - exec(function(event) { + exec(function (event) { if (!isCancelled) { callback(event) } }, {}, "AirshipCordova", "addListener", [name, subCallbackId]) let subscription = {} - subscription.cancel = function() { + subscription.cancel = function () { isCancelled = true exec({}, {}, "AirshipCordova", "removeListener", [name, subCallbackId]) } @@ -58,25 +58,25 @@ function TagEditor(methodPrefix, nativeMethod) { var operations = [] var editor = {} - editor.addTags = function(tags) { - argscheck.checkArgs('a', methodPrefix + "#addTags", arguments) - var operation = { "operationType": "add", "tags": tags } - operations.push(operation) - return editor + editor.addTags = function (tags) { + argscheck.checkArgs('a', methodPrefix + "#addTags", arguments) + var operation = { "operationType": "add", "tags": tags } + operations.push(operation) + return editor } - editor.removeTags = function(tags) { - argscheck.checkArgs('a', methodPrefix + "#removeTags", arguments) - var operation = { "operationType": "remove", "tags": tags } - operations.push(operation) - return editor + editor.removeTags = function (tags) { + argscheck.checkArgs('a', methodPrefix + "#removeTags", arguments) + var operation = { "operationType": "remove", "tags": tags } + operations.push(operation) + return editor } - editor.apply = function(success, failure) { - argscheck.checkArgs('FF', methodPrefix + "#apply", arguments) - perform(nativeMethod, operations, success, failure) - operations = [] - return editor + editor.apply = function (success, failure) { + argscheck.checkArgs('FF', methodPrefix + "#apply", arguments) + perform(nativeMethod, operations, success, failure) + operations = [] + return editor } return editor @@ -86,32 +86,32 @@ function TagGroupEditor(methodPrefix, nativeMethod) { var operations = [] var editor = {} - editor.addTags = function(tagGroup, tags) { - argscheck.checkArgs('sa', methodPrefix + "#addTags", arguments) - var operation = { "operationType": "add", "group": tagGroup, "tags": tags } - operations.push(operation) - return editor + editor.addTags = function (tagGroup, tags) { + argscheck.checkArgs('sa', methodPrefix + "#addTags", arguments) + var operation = { "operationType": "add", "group": tagGroup, "tags": tags } + operations.push(operation) + return editor } - editor.removeTags = function(tagGroup, tags) { - argscheck.checkArgs('sa', methodPrefix + "#removeTags", arguments) - var operation = { "operationType": "remove", "group": tagGroup, "tags": tags } - operations.push(operation) - return editor + editor.removeTags = function (tagGroup, tags) { + argscheck.checkArgs('sa', methodPrefix + "#removeTags", arguments) + var operation = { "operationType": "remove", "group": tagGroup, "tags": tags } + operations.push(operation) + return editor } - editor.setTags = function(tagGroup, tags) { + editor.setTags = function (tagGroup, tags) { argscheck.checkArgs('sa', methodPrefix + "#setTags", arguments) var operation = { "operationType": "set", "group": tagGroup, "tags": tags } operations.push(operation) return editor - } + } - editor.apply = function(success, failure) { - argscheck.checkArgs('FF', methodPrefix + "#apply", arguments) - perform(nativeMethod, operations, success, failure) - operations = [] - return editor + editor.apply = function (success, failure) { + argscheck.checkArgs('FF', methodPrefix + "#apply", arguments) + perform(nativeMethod, operations, success, failure) + operations = [] + return editor } return editor @@ -121,21 +121,21 @@ function ScopedSubscriptionListEditor(methodPrefix, nativeMethod) { var operations = [] var editor = {} - editor.subscribe = function(listId, scope) { + editor.subscribe = function (listId, scope) { argscheck.checkArgs('ss', methodPrefix + "#subscribe", arguments) - var operation = { "action": "subscribe", "listId": contactSubscriptionListID, "scope": contactScope} + var operation = { "action": "subscribe", "listId": listId, "scope": scope } operations.push(operation) return editor } - - editor.unsubscribe = function(listId, scope) { + + editor.unsubscribe = function (listId, scope) { argscheck.checkArgs('ss', methodPrefix + "#unsubscribe", arguments) - var operation = { "action": "unsubscribe", "listId": contactSubscriptionListID, "scope": contactScope} + var operation = { "action": "unsubscribe", "listId": listId, "scope": scope } operations.push(operation) return editor } - editor.apply = function(success, failure) { + editor.apply = function (success, failure) { argscheck.checkArgs('FF', methodPrefix + "#apply", arguments) perform(nativeMethod, operations, success, failure) operations = [] @@ -150,21 +150,21 @@ function SubscriptionListEditor(methodPrefix, nativeMethod) { var operations = [] var editor = {} - editor.subscribe = function(listId) { + editor.subscribe = function (listId) { argscheck.checkArgs('s', methodPrefix + "#subscribe", arguments) var operation = { "action": "subscribe", "listId": listId } operations.push(operation) return editor } - - editor.unsubscribe = function(listId) { + + editor.unsubscribe = function (listId) { argscheck.checkArgs('s', methodPrefix + "#unsubscribe", arguments) var operation = { "action": "unsubscribe", "listId": listId } operations.push(operation) return editor } - editor.apply = function(success, failure) { + editor.apply = function (success, failure) { argscheck.checkArgs('FF', methodPrefix + "#apply", arguments) perform(nativeMethod, operations, success, failure) operations = [] @@ -178,11 +178,11 @@ function AttributesEditor(methodPrefix, nativeMethod) { var operations = []; var editor = {}; - editor.setAttribute = function(name, value) { + editor.setAttribute = function (name, value) { argscheck.checkArgs('s*', methodPrefix + "#setAttribute", arguments) var operation = { "action": "set", "value": value, "key": name } - + if (typeof value === "string") { operation["type"] = "string" } else if (typeof value === "number") { @@ -196,240 +196,261 @@ function AttributesEditor(methodPrefix, nativeMethod) { operation["type"] = "date" operation["value"] = value.getTime() } else { - throw("Unsupported attribute type: " + typeof value) + throw ("Unsupported attribute type: " + typeof value) } - + operations.push(operation) - + return editor } - - editor.removeAttribute = function(name) { + + editor.removeAttribute = function (name) { argscheck.checkArgs('s', methodPrefix + "#removeAttribute", arguments) var operation = { "action": "remove", "key": name } operations.push(operation) return editor } - - editor.apply = function(success, failure) { + + editor.apply = function (success, failure) { argscheck.checkArgs('FF', methodPrefix + "#apply", arguments) perform(nativeMethod, operations, success, failure) operations = [] return editor } - + return editor } -airship.takeOff = function(config, success, failure) { +airship.takeOff = function (config, success, failure) { argscheck.checkArgs("*FF", "Airship.takeOff", arguments); perform("takeOff", config, success, failure) } -airship.isFlying = function(success, failure) { +airship.isFlying = function (success, failure) { argscheck.checkArgs("fF", "Airship.isFlying", arguments); - perform("isFlying", config, success, failure) + perform("isFlying", null, success, failure) } -airship.onDeepLink = function(callback) { +airship.onDeepLink = function (callback) { argscheck.checkArgs('F', 'Airship.onDeepLink', arguments) return registerListener("airship.event.deep_link_received", callback) } // Channel -airship.channel.getChannelId = function(success, failure) { +airship.channel.getChannelId = function (success, failure) { argscheck.checkArgs('fF', 'Airship.channel.getChannelId', arguments) perform("channel#getChannelId", null, success, failure) } -airship.channel.getSubscriptionLists = function(success, failure) { +airship.channel.getSubscriptionLists = function (success, failure) { argscheck.checkArgs('fF', 'Airship.channel.getSubscriptionLists', arguments) perform("channel#getSubscriptionLists", null, success, failure) } -airship.channel.getTags = function(success, failure) { +airship.channel.getTags = function (success, failure) { argscheck.checkArgs('fF', 'Airship.channel.getTags', arguments) perform("channel#getTags", null, success, failure) } -airship.channel.setTags = function(tags, success, failure) { +airship.channel.setTags = function (tags, success, failure) { argscheck.checkArgs('aFF', 'Airship.channel.setTags', arguments) - perform("channel#getTags", null, success, failure) + perform("channel#setTags", tags, success, failure) } -airship.channel.editTags = function() { +airship.channel.editTags = function () { return new TagEditor('Airship.channel.editTags', 'channel#editTags') } -airship.channel.editTagGroups = function() { +airship.channel.editTagGroups = function () { return new TagGroupEditor('Airship.channel.editTagGroups', 'channel#editTagGroups') } -airship.channel.editAttributes = function() { +airship.channel.editAttributes = function () { return new AttributesEditor('Airship.channel.editAttributes', 'channel#editAttributes') } -airship.channel.editSubscriptionLists = function() { +airship.channel.editSubscriptionLists = function () { return new SubscriptionListEditor('Airship.channel.editSubscriptionLists', 'channel#editSubscriptionLists') } -airship.channel.onChannelCreated = function(callback) { +airship.channel.onChannelCreated = function (callback) { argscheck.checkArgs('F', 'Airship.channel.channel_created', arguments) return registerListener("airship.event.channel_created", callback) } // Contact -airship.contact.getNamedUser = function(success, failure) { +airship.contact.getNamedUser = function (success, failure) { argscheck.checkArgs('fF', 'Airship.contact.getNamedUser', arguments) perform("contact#getNamedUser", null, success, failure) } -airship.contact.identify = function(namedUserId, success, failure) { +airship.contact.identify = function (namedUserId, success, failure) { argscheck.checkArgs('SFF', 'Airship.contact.getNamedUser', arguments) perform("contact#identify", namedUserId, success, failure) } -airship.contact.reset = function(success, failure) { +airship.contact.reset = function (success, failure) { argscheck.checkArgs('FF', 'Airship.contact.reset', arguments) perform("contact#reset", null, success, failure) } -airship.contact.notifyRemoteLogin = function(success, failure) { +airship.contact.notifyRemoteLogin = function (success, failure) { argscheck.checkArgs('FF', 'Airship.contact.notifyRemoteLogin', arguments) perform("contact#notifyRemoteLogin", null, success, failure) } -airship.contact.getSubscriptionLists = function(success, failure) { +airship.contact.getSubscriptionLists = function (success, failure) { argscheck.checkArgs('fF', 'Airship.contact.getSubscriptionLists', arguments) perform("contact#getSubscriptionLists", null, success, failure) } -airship.contact.editTagGroups = function() { +airship.contact.editTagGroups = function () { return new TagGroupEditor('Airship.contact.editTagGroups', 'contact#editTagGroups') } -airship.contact.editAttributes = function() { +airship.contact.editAttributes = function () { return new AttributesEditor('Airship.contact.editAttributes', 'contact#editAttributes') } -airship.contact.editSubscriptionLists = function() { +airship.contact.editSubscriptionLists = function () { return new ScopedSubscriptionListEditor('Airship.contact.editSubscriptionLists', 'contact#editSubscriptionLists') } // Push -airship.push.enableUserNotifications = function(success, failure) { +airship.push.enableUserNotifications = function (success, failure) { argscheck.checkArgs('fF', 'Airship.push.enableUserNotifications', arguments) - perform("push#enableUserNotifications", null, success, failure) + perform("push#enableUserNotifications", null, success, failure) } -airship.push.isUserNotificationsEnabled = function(success, failure) { +airship.push.isUserNotificationsEnabled = function (success, failure) { argscheck.checkArgs('fF', 'Airship.push.isUserNotificationsEnabled', arguments) - perform("push#isUserNotificationsEnabled", null, success, failure) + perform("push#isUserNotificationsEnabled", null, success, failure) } -airship.push.setUserNotificationsEnabled = function(enabled, success, failure) { +airship.push.setUserNotificationsEnabled = function (enabled, success, failure) { argscheck.checkArgs('*FF', 'Airship.push.setUserNotificationsEnabled', arguments) - perform("push#setUserNotificationsEnabled", !!enabled, success, failure) + perform("push#setUserNotificationsEnabled", !!enabled, success, failure) } -airship.push.getNotificationStatus = function(success, failure) { +airship.push.getNotificationStatus = function (success, failure) { argscheck.checkArgs('fF', 'Airship.push.getNotificationStatus', arguments) - perform("push#getNotificationStatus", null, success, failure) + perform("push#getNotificationStatus", null, success, failure) } -airship.push.getRegistrationToken = function(success, failure) { +airship.push.getRegistrationToken = function (success, failure) { argscheck.checkArgs('fF', 'Airship.push.getRegistrationToken', arguments) - perform("push#getRegistrationToken", null, success, failure) + perform("push#getRegistrationToken", null, success, failure) } -airship.push.clearNotifications = function(success, failure) { +airship.push.clearNotifications = function (success, failure) { argscheck.checkArgs('FF', 'Airship.push.clearNotifications', arguments) - perform("push#clearNotifications", null, success, failure) + perform("push#clearNotifications", null, success, failure) } -airship.push.clearNotification = function(id, success, failure) { +airship.push.clearNotification = function (id, success, failure) { argscheck.checkArgs('sFF', 'Airship.push.clearNotification', arguments) - perform("push#clearNotification", id, success, failure) + perform("push#clearNotification", id, success, failure) } -airship.push.getActiveNotifications = function(success, failure) { +airship.push.getActiveNotifications = function (success, failure) { argscheck.checkArgs('fF', 'Airship.push.getActiveNotifications', arguments) - perform("push#getActiveNotifications", null, success, failure) + perform("push#getActiveNotifications", null, success, failure) } -airship.push.onNotificationStatusChanged = function(callback) { +airship.push.onNotificationStatusChanged = function (callback) { argscheck.checkArgs('F', 'Airship.push.onNotificationStatusChanged', arguments) return registerListener("airship.event.notification_status_changed", callback) } -airship.push.onPushTokenReceived = function(callback) { +airship.push.onPushTokenReceived = function (callback) { argscheck.checkArgs('F', 'Airship.push.onPushTokenReceived', arguments) return registerListener("airship.event.push_token_received", callback) } -airship.push.onPushReceived = function(callback) { +airship.push.onPushReceived = function (callback) { argscheck.checkArgs('F', 'Airship.push.onPushReceived', arguments) return registerListener("airship.event.push_received", callback) } -airship.push.onNotificationResponse = function(callback) { +airship.push.onNotificationResponse = function (callback) { argscheck.checkArgs('F', 'Airship.push.onNotificationResponse', arguments) return registerListener("airship.event.notification_response", callback) } +// Push Android + +airship.push.android.setForegroundNotificationsEnabled = function (enabled, success, failure) { + argscheck.checkArgs('*FF', 'Airship.push.android.setForegroundNotificationsEnabled', arguments) + perform("push#android#setForegroundNotificationsEnabled", !!enabled, success, failure) +} + +airship.push.android.isForegroundNotificationsEnabled = function (success, failure) { + argscheck.checkArgs('fF', 'Airship.push.android.isForegroundNotificationsEnabled', arguments) + perform("push#android#isForegroundNotificationsEnabled", null, success, failure) +} + +airship.push.android.isNotificationChannelEnabled = function (channel, success, failure) { + argscheck.checkArgs('sfF', 'Airship.push.android.isNotificationChannelEnabled', arguments) + perform("push#android#isNotificationChannelEnabled", channel, success, failure) +} + +airship.push.android.setNotificationConfig = function (config, success, failure) { + argscheck.checkArgs('*FF', 'Airship.push.android.isNotificationChannelEnabled', arguments) + perform("push#android#setNotificationConfig", config, success, failure) +} // Push iOS -airship.push.ios.isAutobadgeEnabled = function(success, failure) { - argscheck.checkArgs('fF', 'Airship.push.isAutobadgeEnabled', arguments) - perform("push#ios#isAutobadgeEnabled", null, success, failure) +airship.push.ios.isAutobadgeEnabled = function (success, failure) { + argscheck.checkArgs('fF', 'Airship.push.ios.isAutobadgeEnabled', arguments) + perform("push#ios#isAutobadgeEnabled", null, success, failure) } -airship.push.ios.setAutobadgeEnabled = function(enabled, success, failure) { - argscheck.checkArgs('*FF', 'Airship.push.setAutobadgeEnabled', arguments) - perform("push#ios#setAutobadgeEnabled", !!enabled, success, failure) +airship.push.ios.setAutobadgeEnabled = function (enabled, success, failure) { + argscheck.checkArgs('*FF', 'Airship.push.ios.setAutobadgeEnabled', arguments) + perform("push#ios#setAutobadgeEnabled", !!enabled, success, failure) } -airship.push.ios.setForegroundPresentationOptions = function(options, success, failure) { - argscheck.checkArgs('*FF', 'Airship.push.setForegroundPresentationOptions', arguments) - perform("push#ios#setForegroundPresentationOptions", options, success, failure) +airship.push.ios.setForegroundPresentationOptions = function (options, success, failure) { + argscheck.checkArgs('*FF', 'Airship.push.ios.setForegroundPresentationOptions', arguments) + perform("push#ios#setForegroundPresentationOptions", options, success, failure) } -airship.push.ios.setNotificationOptions = function(options, success, failure) { - argscheck.checkArgs('*FF', 'Airship.push.setNotificationOptions', arguments) - perform("push#ios#setNotificationOptions", options, success, failure) +airship.push.ios.setNotificationOptions = function (options, success, failure) { + argscheck.checkArgs('*FF', 'Airship.push.ios.setNotificationOptions', arguments) + perform("push#ios#setNotificationOptions", options, success, failure) } -airship.push.ios.setBadgeNumber = function(badge, success, failure) { - argscheck.checkArgs('nFF', 'Airship.push.setBadgeNumber', arguments) - perform("push#ios#setBadgeNumber", badge, success, failure) +airship.push.ios.setBadgeNumber = function (badge, success, failure) { + argscheck.checkArgs('nFF', 'Airship.push.ios.setBadgeNumber', arguments) + perform("push#ios#setBadgeNumber", badge, success, failure) } -airship.push.ios.getBadgeNumber = function(success, failure) { - argscheck.checkArgs('fF', 'Airship.push.getBadgeNumber', arguments) - perform("push#ios#getBadgeNumber", null, success, failure) +airship.push.ios.getBadgeNumber = function (success, failure) { + argscheck.checkArgs('fF', 'Airship.push.ios.getBadgeNumber', arguments) + perform("push#ios#getBadgeNumber", null, success, failure) } -airship.push.ios.getAuthorizedNotificationSettings = function(success, failure) { - argscheck.checkArgs('fF', 'Airship.push.getAuthorizedNotificationSettings', arguments) - perform("push#ios#getAuthorizedNotificationSettings", null, success, failure) +airship.push.ios.getAuthorizedNotificationSettings = function (success, failure) { + argscheck.checkArgs('fF', 'Airship.push.ios.getAuthorizedNotificationSettings', arguments) + perform("push#ios#getAuthorizedNotificationSettings", null, success, failure) } -airship.push.ios.getAuthorizedNotificationStatus = function(success, failure) { - argscheck.checkArgs('fF', 'Airship.push.getAuthorizedNotificationStatus', arguments) - perform("push#ios#getAuthorizedNotificationStatus", null, success, failure) +airship.push.ios.getAuthorizedNotificationStatus = function (success, failure) { + argscheck.checkArgs('fF', 'Airship.push.ios.getAuthorizedNotificationStatus', arguments) + perform("push#ios#getAuthorizedNotificationStatus", null, success, failure) } -airship.push.ios.resetBadge = function(success, failure) { +airship.push.ios.resetBadge = function (success, failure) { argscheck.checkArgs('*FF', 'Airship.push.resetBadge', arguments) - perform("push#ios#resetBadge", null, success, failure) + perform("push#ios#resetBadge", null, success, failure) } -airship.push.ios.onAuthorizedSettingsChanged = function(callback) { +airship.push.ios.onAuthorizedSettingsChanged = function (callback) { argscheck.checkArgs('F', 'Airship.push.ios.onAuthorizedSettingsChanged', arguments) return registerListener("airship.event.ios_authorized_notification_settings_changed", callback) } @@ -437,79 +458,84 @@ airship.push.ios.onAuthorizedSettingsChanged = function(callback) { // Privacy Manager -airship.privacyManager.isFeaturesEnabled = function(features, success, failure) { +airship.privacyManager.isFeaturesEnabled = function (features, success, failure) { argscheck.checkArgs('afF', 'Airship.push.isFeaturesEnabled', arguments) - perform("privacyManager#isFeaturesEnabled", features, success, failure) + perform("privacyManager#isFeaturesEnabled", features, success, failure) } -airship.privacyManager.setEnabledFeatures = function(features, success, failure) { +airship.privacyManager.setEnabledFeatures = function (features, success, failure) { argscheck.checkArgs('aFF', 'Airship.push.setEnabledFeatures', arguments) - perform("privacyManager#setEnabledFeatures", features, success, failure) + perform("privacyManager#setEnabledFeatures", features, success, failure) } -airship.privacyManager.enableFeatures = function(features, success, failure) { +airship.privacyManager.enableFeatures = function (features, success, failure) { argscheck.checkArgs('aFF', 'Airship.push.enableFeatures', arguments) - perform("privacyManager#enableFeatures", features, success, failure) + perform("privacyManager#enableFeatures", features, success, failure) } -airship.privacyManager.disableFeatures = function(features, success, failure) { +airship.privacyManager.disableFeatures = function (features, success, failure) { argscheck.checkArgs('aFF', 'Airship.push.disableFeatures', arguments) - perform("privacyManager#disableFeatures", features, success, failure) + perform("privacyManager#disableFeatures", features, success, failure) } -airship.privacyManager.getEnabledFeatures = function(success, failure) { +airship.privacyManager.getEnabledFeatures = function (success, failure) { argscheck.checkArgs('fF', 'Airship.push.getEnabledFeatures', arguments) - perform("privacyManager#getEnabledFeatures", null, success, failure) + perform("privacyManager#getEnabledFeatures", null, success, failure) } // Message Center -airship.messageCenter.getUnreadCount = function(success, failure) { +airship.messageCenter.getUnreadCount = function (success, failure) { argscheck.checkArgs('fF', 'Airship.messageCenter.getUnreadCount', arguments) - perform("messageCenter#getUnreadCount", null, success, failure) + perform("messageCenter#getUnreadCount", null, success, failure) } -airship.messageCenter.getMessages = function(success, failure) { +airship.messageCenter.getMessages = function (success, failure) { argscheck.checkArgs('fF', 'Airship.messageCenter.getMessages', arguments) - perform("messageCenter#getMessages", null, success, failure) + perform("messageCenter#getMessages", null, success, failure) } -airship.messageCenter.markMessageRead = function(messageId, success, failure) { +airship.messageCenter.markMessageRead = function (messageId, success, failure) { argscheck.checkArgs('sFF', 'Airship.messageCenter.markMessageRead', arguments) - perform("messageCenter#markMessageRead", messageId, success, failure) + perform("messageCenter#markMessageRead", messageId, success, failure) } -airship.messageCenter.deleteMessage = function(messageId, success, failure) { +airship.messageCenter.deleteMessage = function (messageId, success, failure) { argscheck.checkArgs('sFF', 'Airship.messageCenter.deleteMessage', arguments) - perform("messageCenter#deleteMessage", messageId, success, failure) + perform("messageCenter#deleteMessage", messageId, success, failure) } -airship.messageCenter.dismiss = function(success, failure) { - argscheck.checkArgs('sFF', 'Airship.messageCenter.dismiss', arguments) - perform("messageCenter#dismiss", null, success, failure) +airship.messageCenter.dismiss = function (success, failure) { + argscheck.checkArgs('FF', 'Airship.messageCenter.dismiss', arguments) + perform("messageCenter#dismiss", null, success, failure) } -airship.messageCenter.display = function(messageId, success, failure) { +airship.messageCenter.display = function (messageId, success, failure) { argscheck.checkArgs('SFF', 'Airship.messageCenter.display', arguments) - perform("messageCenter#display", messageId, success, failure) + perform("messageCenter#display", messageId, success, failure) +} + +airship.messageCenter.showMessageView = function (messageId, success, failure) { + argscheck.checkArgs('sFF', 'Airship.messageCenter.showMessageView', arguments) + perform("messageCenter#showMessageView", messageId, success, failure) } -airship.messageCenter.refreshMessages = function(success, failure) { +airship.messageCenter.refreshMessages = function (success, failure) { argscheck.checkArgs('FF', 'Airship.messageCenter.refreshMessages', arguments) perform("messageCenter#refreshMessages", null, success, failure) } -airship.messageCenter.setAutoLaunchDefaultMessageCenter = function(autoLaunch, success, failure) { +airship.messageCenter.setAutoLaunchDefaultMessageCenter = function (autoLaunch, success, failure) { argscheck.checkArgs('*FF', 'Airship.messageCenter.setAutoLaunchDefaultMessageCenter', arguments) - perform("messageCenter#setAutoLaunchDefaultMessageCenter", !!autoLaunch, success, failure) + perform("messageCenter#setAutoLaunchDefaultMessageCenter", !!autoLaunch, success, failure) } -airship.messageCenter.onUpdated = function(callback) { +airship.messageCenter.onUpdated = function (callback) { argscheck.checkArgs('F', 'Airship.messageCenter.onUpdated', arguments) return registerListener("airship.event.message_center_updated", callback) } -airship.messageCenter.onDisplay = function(callback) { +airship.messageCenter.onDisplay = function (callback) { argscheck.checkArgs('F', 'Airship.messageCenter.onDisplay', arguments) return registerListener("airship.event.display_message_center", callback) } @@ -517,101 +543,101 @@ airship.messageCenter.onDisplay = function(callback) { // Preference Center -airship.preferenceCenter.display = function(preferenceCenterId, success, failure) { +airship.preferenceCenter.display = function (preferenceCenterId, success, failure) { argscheck.checkArgs('sFF', 'Airship.preferenceCenter.display', arguments) - perform("preferenceCenter#display", preferenceCenterId, success, failure) + perform("preferenceCenter#display", preferenceCenterId, success, failure) } -airship.preferenceCenter.getConfig = function(preferenceCenterId, success, failure) { +airship.preferenceCenter.getConfig = function (preferenceCenterId, success, failure) { argscheck.checkArgs('sfF', 'Airship.preferenceCenter.getConfig', arguments) - perform("preferenceCenter#getConfig", preferenceCenterId, success, failure) + perform("preferenceCenter#getConfig", preferenceCenterId, success, failure) } -airship.preferenceCenter.setAutoLaunchDefaultPreferenceCenter = function(preferenceCenterId, autoLaunch, success, failure) { +airship.preferenceCenter.setAutoLaunchDefaultPreferenceCenter = function (preferenceCenterId, autoLaunch, success, failure) { argscheck.checkArgs('s*FF', 'Airship.preferenceCenter.getConfig', arguments) - perform("preferenceCenter#getConfig", [preferenceCenterId, !!autoLaunch], success, failure) + perform("preferenceCenter#getConfig", [preferenceCenterId, !!autoLaunch], success, failure) } -airship.preferenceCenter.onDisplay = function(callback) { +airship.preferenceCenter.onDisplay = function (callback) { argscheck.checkArgs('F', 'Airship.preferenceCenter.onDisplay', arguments) return registerListener("airship.event.display_preference_center", callback) } // Analytics -airship.analytics.trackScreen = function(screen, success, failure) { +airship.analytics.trackScreen = function (screen, success, failure) { argscheck.checkArgs('SFF', 'Airship.analytics.trackScreen', arguments) - perform("analytics#trackScreen", features, success, failure) + perform("analytics#trackScreen", screen, success, failure) } -airship.analytics.associateIdentifier = function(key, value, success, failure) { +airship.analytics.associateIdentifier = function (key, value, success, failure) { argscheck.checkArgs('sSFF', 'Airship.analytics.associateIdentifier', arguments) - perform("analytics#associateIdentifier", [key, value], success, failure) + perform("analytics#associateIdentifier", [key, value], success, failure) } -airship.analytics.addCustomEvent = function(event, success, failure) { +airship.analytics.addCustomEvent = function (event, success, failure) { argscheck.checkArgs('*FF', 'Airship.analytics.addCustomEvent', arguments) - perform("analytics#addCustomEvent", event, success, failure) + perform("analytics#addCustomEvent", event, success, failure) } // Actions -airship.actions.run = function(name, value, success, failure) { +airship.actions.run = function (name, value, success, failure) { argscheck.checkArgs('s*FF', 'Airship.actions.run', arguments) - perform("actions#run", [name, value], success, failure) + perform("actions#run", [name, value], success, failure) } /// Feature Flags -airship.featureFlagManager.flag = function(name, success, failure) { +airship.featureFlagManager.flag = function (name, success, failure) { argscheck.checkArgs('sfF', 'Airship.featureFlagManager.flag', arguments) - perform("featureFlagManager#flag", name, success, failure) + perform("featureFlagManager#flag", name, success, failure) } -airship.featureFlagManager.trackInteraction = function(flag, success, failure) { +airship.featureFlagManager.trackInteraction = function (flag, success, failure) { argscheck.checkArgs('*FF', 'Airship.featureFlagManager.trackInteraction', arguments) - perform("featureFlagManager#trackInteraction", flag, success, failure) + perform("featureFlagManager#trackInteraction", flag, success, failure) } /// In App -airship.inApp.setPaused = function(paused, success, failure) { +airship.inApp.setPaused = function (paused, success, failure) { argscheck.checkArgs('sFF', 'Airship.inApp.setPaused', arguments) - perform("inApp#setPaused", !!paused, success, failure) + perform("inApp#setPaused", !!paused, success, failure) } -airship.privacyManager.isPaused = function(success, failure) { +airship.inApp.isPaused = function (success, failure) { argscheck.checkArgs('fF', 'Airship.inApp.isPaused', arguments) - perform("inApp#isPaused", features, success, failure) + perform("inApp#isPaused", null, success, failure) } -airship.inApp.setDisplayInterval = function(interval, success, failure) { +airship.inApp.setDisplayInterval = function (interval, success, failure) { argscheck.checkArgs('nFF', 'Airship.inApp.setDisplayInterval', arguments) - perform("inApp#setDisplayInterval", interval, success, failure) + perform("inApp#setDisplayInterval", interval, success, failure) } -airship.privacyManager.getDisplayInterval = function(success, failure) { +airship.privacyManager.getDisplayInterval = function (success, failure) { argscheck.checkArgs('fF', 'Airship.inApp.getDisplayInterval', arguments) - perform("inApp#getDisplayInterval", features, success, failure) + perform("inApp#getDisplayInterval", null, success, failure) } /// Locale -airship.locale.setLocaleOverride = function(locale, success, failure) { - argscheck.checkArgs('sFF', 'Airship.inApp.setPaused', arguments) - perform("inApp#setLocaleOverride", locale, success, failure) +airship.locale.setLocaleOverride = function (locale, success, failure) { + argscheck.checkArgs('sFF', 'Airship.inApp.setLocaleOverride', arguments) + perform("locale#setLocaleOverride", locale, success, failure) } -airship.locale.clearLocaleOverride = function(success, failure) { +airship.locale.clearLocaleOverride = function (success, failure) { argscheck.checkArgs('FF', 'Airship.inApp.clearLocaleOverride', arguments) - perform("inApp#clearLocaleOverride", null, success, failure) + perform("locale#clearLocaleOverride", null, success, failure) } -airship.locale.getLocale = function(success, failure) { - argscheck.checkArgs('fF', 'Airship.push.getLocale', arguments) - perform("inApp#getLocale", null, success, failure) +airship.locale.getLocale = function (success, failure) { + argscheck.checkArgs('fF', 'Airship.locale.getLocale', arguments) + perform("locale#getLocale", null, success, failure) } module.exports = airship; \ No newline at end of file