emekalites / react-native-alarm-notification

schedule alarm and local notification in react-native
https://www.npmjs.com/package/react-native-alarm-notification
MIT License
225 stars 95 forks source link

Alarm are not working when we close the app #161

Open komailabbas12 opened 2 years ago

komailabbas12 commented 2 years ago

Android minifiest file

`<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.reminderapp">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<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>

    <receiver
        android:name="com.emekalites.react.alarm.notification.AlarmReceiver"
        android:enabled="true"
        android:exported="true">
        <intent-filter>
            <action android:name="ACTION_DISMISS" />
            <action android:name="ACTION_SNOOZE" />
        </intent-filter>
    </receiver>

    <receiver
        android:name="com.emekalites.react.alarm.notification.AlarmDismissReceiver"
        android:enabled="true"
        android:exported="true" />

    <receiver
        android:name="com.emekalites.react.alarm.notification.AlarmBootReceiver"
        android:directBootAware="true"
        android:enabled="false"
        android:exported="true">
        <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" />
            <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
        </intent-filter>
    </receiver>
</application>

`

Dependancies

"@react-native-community/async-storage": "^1.12.1", "@react-native-community/datetimepicker": "^5.1.0", "@react-native-firebase/app": "^14.2.2", "@react-native-firebase/auth": "^14.2.2", "@react-native-firebase/database": "^14.2.2", "@react-native-firebase/messaging": "^14.2.2", "@react-navigation/native": "^6.0.6", "@react-navigation/stack": "^6.0.11", "axios": "^0.24.0", "install": "^0.13.0", "npm": "^8.3.0", "react": "17.0.2", "react-native": "0.66.4", "react-native-alarm-notification": "^1.8.0", "react-native-gesture-handler": "^2.1.0", "react-native-modal-datetime-picker": "^13.0.1", "react-native-modal-selector": "^2.1.0", "react-native-push-notification": "^8.1.1", "react-native-safe-area-context": "^3.3.2"