Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (push): also catch RuntimeExecutionException for google play store device use case #2562

Merged
merged 5 commits into from
Aug 21, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import com.amplifyframework.pinpoint.core.data.AndroidAppDetails
import com.amplifyframework.pinpoint.core.data.AndroidDeviceDetails
import com.amplifyframework.pinpoint.core.database.PinpointDatabase
import com.amplifyframework.pinpoint.core.util.getUniqueId
import com.google.android.gms.tasks.RuntimeExecutionException
import com.google.firebase.messaging.FirebaseMessaging
import java.io.IOException
import java.util.concurrent.ConcurrentHashMap
Expand Down Expand Up @@ -163,17 +164,17 @@ class AWSPinpointPushNotificationsPlugin : PushNotificationsPlugin<PinpointClien
try {
if (!task.isSuccessful) {
LOG.error("Fetching FCM registration token failed: ${task.exception}")
} else {
val token = task.result
registerDevice(token, {
LOG.info("Registering push notifications token: $token")
}) {
throw it
}
}
val token = task.result
registerDevice(token, {
LOG.info("Registering push notifications token: $token")
}, {
throw it
})
} catch (exception: IOException) {
} catch (exception: Exception) {
LOG.error(
"Fetching token failed, this is a known issue in emulators, " +
"rerun the app: https://github.com/firebase/firebase-android-sdk/issues/3040",
"Fetching token failed",
exception
)
}
Expand Down
Loading