fix(auth): initialize AuthManager in custom application class (#172)
Closes #68. Redundant initialization in MainActivity has been removed.
This commit is contained in:
3 files changed
+12
-2
No files matched your search
@@ -8,6 +8,7 @@
|
|||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
android:name=".HermesControlApp"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.m57.hermescontrol
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import com.m57.hermescontrol.data.local.AuthManager
|
||||||
|
|
||||||
|
class HermesControlApp : Application() {
|
||||||
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
AuthManager.init(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,8 +16,6 @@ class MainActivity : ComponentActivity() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
AuthManager.init(this)
|
|
||||||
|
|
||||||
// Read notification tap sessionId (if any) from the intent that launched us
|
// Read notification tap sessionId (if any) from the intent that launched us
|
||||||
val notificationSessionId = intent?.getStringExtra(NotificationReplyReceiver.EXTRA_SESSION_ID)
|
val notificationSessionId = intent?.getStringExtra(NotificationReplyReceiver.EXTRA_SESSION_ID)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user