There was an error while loading. Please reload this page.
1 parent e320666 commit aa2d314Copy full SHA for aa2d314
1 file changed
app/src/main/java/com/cornellappdev/coursegrab/LoginActivity.kt
@@ -271,16 +271,16 @@ class LoginActivity : AppCompatActivity() {
271
sendRegistrationToServer(token)
272
}
273
274
- enableNotificationsStatus()
+ setNotificationsStatus(preferencesHelper.mobileAlertSetting)
275
276
val intent = Intent(this@LoginActivity, MainActivity::class.java)
277
startActivity(intent)
278
279
280
- private fun enableNotificationsStatus() {
+ private fun setNotificationsStatus(enabled: Boolean) {
281
val setNotifs = Endpoint.setNotification(
282
accessToken = preferencesHelper.sessionToken.toString(),
283
- notifSetting = "ANDROID"
+ notifSetting = if (enabled) "ANDROID" else "NONE"
284
)
285
286
lifecycleScope.launch {
0 commit comments