react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

LED indicator still doesn't work (Android 7.1)

Open xdarkleonx opened this issue 4 years ago • 1 comments

I changed some files like Android manual Installation says...

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.notifications">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>

       <!-- Change the value to true to enable pop-up for in foreground on receiving remote notifications 
      (for prevent duplicating while showing local notifications set this to false) -->
      <meta-data  android:name="com.dieam.reactnativepushnotification.notification_foreground"
          android:value="false"/>
      <!-- Change the resource name to your App's accent color - or any other color you want -->
      <meta-data  android:name="com.dieam.reactnativepushnotification.notification_color"
          android:resource="@color/white"/>

      <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" />
      <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
      <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
        <intent-filter>
          <action android:name="android.intent.action.BOOT_COMPLETED" />
          <action android:name="android.intent.action.QUICKBOOT_POWERON" />
          <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
        </intent-filter>
      </receiver>

      <service
        android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
        android:exported="false" >
          <intent-filter>
              <action android:name="com.google.firebase.MESSAGING_EVENT" />
          </intent-filter>
      </service>

    </application>
</manifest>

android/app/src/main/res/values/colors.xml

<resources>
    <color name="white">#FFF</color>
</resources>

My package.json dependencies

 "dependencies": {
    "react": "17.0.1",
    "react-native": "0.64.1",
    "react-native-push-notification": "^7.3.1"
  },

For test I created Pressable with this on press event

const onPress = () => {
    PushNotification.localNotificationSchedule({
      color: 'blue',
      subText: 'Food',
      title: 'Meal',
      message: 'Its time to get some food',
      date: new Date(Date.now() + 300 * 1000),
      allowWhileIdle: true,
    })
  }

But led indicator not working on device Redmi 4A (android 7.1.2 N2G47H).

xdarkleonx avatar May 15 '21 13:05 xdarkleonx

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 16 '22 00:05 github-actions[bot]