X-SLAYER / notification_listener_service

Flutter plugin to listen to all incoming notifications (posted or removed) with the possibility to reply to them
https://pub.dev/packages/notification_listener_service
MIT License
21 stars 25 forks source link

It doesn't work in production mode - Android #5

Closed jack1230 closed 2 years ago

jack1230 commented 2 years ago

It doesn't work for me when I compile and upload it to play console and test it internally

flutter build appbundle --obfuscate --split-debug-info=debug-info

Package: notification_listener_service: ^0.3.1 flutter_foreground_task: ^3.8.1

Flutter: v3.0.5 minSdkVersion 23 targetSdkVersion 31

AndroidManifest.xml `<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.testerInter">

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE " />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>

<application android:label="TesterInter" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_channel_id"
        android:value="@string/default_notification_channel_id"/>

    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="ca-app-pub-xxxxxxxxx~xxxxxxxxxxx"/>

    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:launchMode="singleTop"
        android:theme="@style/NormalTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize">
        <!-- android:theme="@style/LaunchTheme" -->
        <!-- Specifies an Android theme to apply to this Activity as soon as
             the Android process has started. This theme is visible to the user
             while the Flutter UI initializes. After that, this theme continues
             to determine the Window background behind the Flutter UI. -->
        <meta-data
          android:name="io.flutter.embedding.android.NormalTheme"
          android:resource="@style/NormalTheme"
          />

        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

        <intent-filter>
            <action android:name="FLUTTER_NOTIFICATION_CLICK"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>

    <!-- Don't delete the meta-data below.
         This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data
        android:name="flutterEmbedding"
        android:value="2" />

    <meta-data
        android:name="com.google.firebase.messaging.default_notificacion_icon"
        android:resource="@mipmap/ic_launcher" />

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_color"
        android:resource="@color/colorPrimary" />

    <!-- Notification Service -->
    <service
        android:label="TesterInter"
        android:name="notification.listener.service.NotificationListener"
        android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
        android:exported="false">
        <intent-filter>
            <action android:name="android.service.notification.NotificationListenerService" />
        </intent-filter>
    </service>
    <service android:name="com.pravera.flutter_foreground_task.service.ForegroundService" />
    <!-- Notification Service -->
</application>

`

jack1230 commented 2 years ago

The plugin stops working when using the command --obfuscate