<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" package="hu.refilc.naplo">
    <application android:name="${applicationName}" android:label="Firka" tools:replace="android:label" android:icon="@mipmap/ic_launcher"
        android:requestLegacyExternalStorage="true" android:enableOnBackInvokedCallback="false">

        <!-- Force OpenGL -->
        <meta-data
            android:name="flutter.embedding.android.SurfaceView"
            android:value="true" />

        <activity android:exported="true" android:name="hu.refilc.naplo.MainActivity"
            android:launchMode="singleTop" android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"
            android:showWhenLocked="false"
            android:turnScreenOn="true">
            <meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable"
                android:resource="@drawable/launch_background" />
            <meta-data android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme" />
            <intent-filter>
                <!-- commented bc of dynamic app icons -->
                <action android:name="android.intent.action.MAIN" /> 
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <!-- Deep Links -->
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- Accepts URIs that begin with YOUR_SCHEME://YOUR_HOST -->
                <data
                    android:scheme="refilcapp"
                    android:host="refilc.hu" />
            </intent-filter>
            <!-- <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!- Accepts URIs that begin with https://api.refilc.hu ->
                <data
                    android:scheme="https"
                    android:host="api.refilc.hu"
                    android:pathPrefix="/v2/rf-plus/auth/finish" />
            </intent-filter> --> 
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- Accepts URIs that begin with https://refilc.hu -->
                <data
                    android:scheme="https"
                    android:host="refilc.hu"
                    android:pathPrefix="/app" />
            </intent-filter>
        </activity>
        <meta-data android:name="flutterEmbedding" android:value="2" />

        <receiver android:name="hu.refilc.naplo.widget_timetable.WidgetTimetable"
            android:exported="true">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
                <action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_LEFT" />
                <action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_RIGHT" />
                <action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_TODAY" />
                <action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_REFRESH" />
                <action android:name="list_widget.ACTION_WIDGET_CLICK_BUY_PREMIUM" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/home_widget_test_info" />
        </receiver>

        <service android:name="hu.refilc.naplo.widget_timetable.WidgetTimetableService"
            android:permission="android.permission.BIND_REMOTEVIEWS" />

        <receiver android:name="es.antonborri.home_widget.HomeWidgetBackgroundReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="es.antonborri.home_widget.action.BACKGROUND" />
            </intent-filter>
        </receiver>

        <service android:name="es.antonborri.home_widget.HomeWidgetBackgroundService"
            android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true" />
    </application>

    <meta-data android:name="flutterEmbedding" android:value="2" />

    <!-- Permissions -->
    <uses-permission
        android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:maxSdkVersion="32"
        tools:node="remove" />
    <uses-permission
        android:name="android.permission.READ_MEDIA_IMAGES"
        tools:node="remove" />
    <uses-permission
        android:name="android.permission.READ_MEDIA_VIDEO"
        tools:node="remove" />
    <uses-permission
        android:name="android.permission.READ_MEDIA_AUDIO"
        tools:node="remove" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</manifest>
