aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/google/java/org/traccar/manager/GoogleMainApplication.kt2
-rw-r--r--app/src/main/java/org/traccar/manager/MainFragment.kt4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/src/google/java/org/traccar/manager/GoogleMainApplication.kt b/app/src/google/java/org/traccar/manager/GoogleMainApplication.kt
index cfeaf6e..1c28987 100644
--- a/app/src/google/java/org/traccar/manager/GoogleMainApplication.kt
+++ b/app/src/google/java/org/traccar/manager/GoogleMainApplication.kt
@@ -49,7 +49,7 @@ class GoogleMainApplication : Application() {
private val broadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
FirebaseMessaging.getInstance().token.addOnCompleteListener {
- if (it.isComplete) {
+ if (it.isSuccessful) {
broadcastToken(it.result)
}
}
diff --git a/app/src/main/java/org/traccar/manager/MainFragment.kt b/app/src/main/java/org/traccar/manager/MainFragment.kt
index 8aa0c15..2675d0c 100644
--- a/app/src/main/java/org/traccar/manager/MainFragment.kt
+++ b/app/src/main/java/org/traccar/manager/MainFragment.kt
@@ -102,9 +102,9 @@ class MainFragment : WebViewFragment() {
private var openFileCallback: ValueCallback<Uri?>? = null
private var openFileCallback2: ValueCallback<Array<Uri>>? = null
- override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
+ override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == REQUEST_FILE_CHOOSER) {
- val result = if (resultCode != Activity.RESULT_OK) null else data.data
+ val result = if (resultCode != Activity.RESULT_OK) null else data?.data
if (openFileCallback != null) {
openFileCallback?.onReceiveValue(result)
openFileCallback = null