Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Fix/remove review exception cast (#1564)
Browse files Browse the repository at this point in the history
* Replaced cast to ReviewException with a modal

---------

Co-authored-by: ctsk <[email protected]>
  • Loading branch information
CommanderStorm and ctsk authored Jun 11, 2023
1 parent 4d27542 commit c7eceb7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import androidx.work.WorkManager
import com.google.android.material.snackbar.Snackbar
import com.google.android.play.core.review.ReviewException
import com.google.android.play.core.review.ReviewManagerFactory
import com.google.android.play.core.review.model.ReviewErrorCode
import com.zhuinden.fragmentviewbindingdelegatekt.viewBinding
import de.tum.`in`.tumcampusapp.R
import de.tum.`in`.tumcampusapp.component.other.generic.adapter.EqualSpacingItemDecoration
Expand Down Expand Up @@ -187,7 +185,8 @@ class MainFragment : BaseFragment<Unit>(
}
} else {
// There was some problem, log or handle the error code.
@ReviewErrorCode val reviewErrorCode = (task.exception as ReviewException).errorCode
Utils.showToast(requireContext(), R.string.in_app_review_failed_to_start)
task.exception?.let { Utils.log(it) }
}
}
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -818,4 +818,5 @@ Signatur: %5$s</string>
<string name="starts_now">Startet jetzt</string>
<string name="tomorrow_time">Morgen %1$s</string>
<string name="IN_capitalized">In</string>
<string name="in_app_review_failed_to_start">In App ReviewFlow konnte nicht gestartet werden</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -873,4 +873,5 @@ Signature: %5$s</string>
<string name="starts_now">Starts now</string>
<string name="tomorrow_time">Tomorrow %1$s</string>
<string name="IN_capitalized">In</string>
<string name="in_app_review_failed_to_start">In App ReviewFlow failed to start</string>
</resources>

0 comments on commit c7eceb7

Please sign in to comment.