Closed wezley98 closed 11 months ago
How are you calling takeOff? If you use Autopilot and don't provide a config or call takeOff without a config, it will load the properties file in the background. You can also define the config programmatically to avoid the properties file read.
How are you calling takeOff? If you use Autopilot and don't provide a config or call takeOff without a config, it will load the properties file in the background. You can also define the config programmatically to avoid the properties file read.
Hi @rlepinski , We call with the following code during application class onCreate()
fun initialise(application: Application, inProduction: Boolean) {
val options = AirshipConfigOptions.Builder()
.applyDefaultProperties(application)
.setInProduction(inProduction)
.build()
val onReadyCallback = OnReadyCallback { airship ->
airship.pushManager.userNotificationsEnabled = true
airship.pushManager.notificationProvider = NotificationProvider(application, options)
val notificationHandler = NotificationHandler(application)
val airshipListener = AirshipListener(notificationHandler)
airship.pushManager.addPushListener(airshipListener)
airship.pushManager.addPushTokenListener(airshipListener)
airship.pushManager.notificationListener = airshipListener
airship.channel.addChannelListener(airshipListener)
}
UAirship.takeOff(application, options, onReadyCallback)
}
We have an assets file in app/src/main/assets/airshipconfig.properties
with our keys.
Should we move to doing this via code instead to avoid this ANR?
This is the problematic line: .applyDefaultProperties(application)
. You have a few options for a quick fix:
This is the problematic line:
.applyDefaultProperties(application)
. You have a few options for a quick fix:
- Create two airshipconfig.properties files, one in release and one in debug that has the inProduction set properly
- Maybe just remove the options in the call completely since we by default will try to detect inProduction based on a debug flag set in the manifest (automatic for most apps)
- Hardcode the config and avoid trying to load the default properties
Thanks we'll look into those options. Feel free to close if no upstream fix is needed.
Preliminary Info
What Airship dependencies are you using?
airship-fcm = { module = "com.urbanairship.android:urbanairship-fcm", version = "17.3.0" }
What are the versions of any relevant development tools you are using?
Firebase Crashlytics Console
Report
What unexpected behavior are you seeing?
ANR reported in Firebase for multiple devices.
What is the expected behavior?
No ANR, Can we move the loading of the assets file onto a background thread in the SDK please?