@ammarahmed/notifee-react-native 7.3.1 → 7.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/android/build.gradle +36 -18
  2. package/android/schemas/app.notifee.core.database.NotifeeCoreDatabase/1.json +46 -0
  3. package/android/schemas/app.notifee.core.database.NotifeeCoreDatabase/2.json +53 -0
  4. package/android/src/main/java/app/notifee/core/AlarmPermissionBroadcastReceiver.java +19 -0
  5. package/android/src/main/java/app/notifee/core/BlockStateBroadcastReceiver.java +164 -0
  6. package/android/src/main/java/app/notifee/core/ChannelManager.java +351 -0
  7. package/android/src/main/java/app/notifee/core/ContextHolder.java +33 -0
  8. package/android/src/main/java/app/notifee/core/EventBus.java +63 -0
  9. package/android/src/main/java/app/notifee/core/EventSubscriber.java +82 -0
  10. package/android/src/main/java/app/notifee/core/ForegroundService.java +125 -0
  11. package/android/src/main/java/app/notifee/core/InitProvider.java +92 -0
  12. package/android/src/main/java/app/notifee/core/KeepForSdk.java +26 -0
  13. package/android/src/main/java/app/notifee/core/Logger.java +68 -0
  14. package/android/src/main/java/app/notifee/core/Notifee.java +533 -0
  15. package/android/src/main/java/app/notifee/core/NotifeeAlarmManager.java +256 -0
  16. package/android/src/main/java/app/notifee/core/NotificationAlarmReceiver.java +32 -0
  17. package/android/src/main/java/app/notifee/core/NotificationManager.java +903 -0
  18. package/android/src/main/java/app/notifee/core/NotificationPendingIntent.java +189 -0
  19. package/android/src/main/java/app/notifee/core/NotificationReceiverActivity.java +38 -0
  20. package/android/src/main/java/app/notifee/core/NotificationReceiverHandler.java +140 -0
  21. package/android/src/main/java/app/notifee/core/Preferences.java +79 -0
  22. package/android/src/main/java/app/notifee/core/RebootBroadcastReceiver.java +38 -0
  23. package/android/src/main/java/app/notifee/core/ReceiverService.java +268 -0
  24. package/android/src/main/java/app/notifee/core/Worker.java +87 -0
  25. package/android/src/main/java/app/notifee/core/database/NotifeeCoreDatabase.java +76 -0
  26. package/android/src/main/java/app/notifee/core/database/WorkDataDao.java +52 -0
  27. package/android/src/main/java/app/notifee/core/database/WorkDataEntity.java +68 -0
  28. package/android/src/main/java/app/notifee/core/database/WorkDataRepository.java +107 -0
  29. package/android/src/main/java/app/notifee/core/event/BlockStateEvent.java +102 -0
  30. package/android/src/main/java/app/notifee/core/event/ForegroundServiceEvent.java +48 -0
  31. package/android/src/main/java/app/notifee/core/event/InitialNotificationEvent.java +50 -0
  32. package/android/src/main/java/app/notifee/core/event/LogEvent.java +74 -0
  33. package/android/src/main/java/app/notifee/core/event/MainComponentEvent.java +33 -0
  34. package/android/src/main/java/app/notifee/core/event/NotificationEvent.java +97 -0
  35. package/android/src/main/java/app/notifee/core/interfaces/EventListener.java +39 -0
  36. package/android/src/main/java/app/notifee/core/interfaces/MethodCallResult.java +27 -0
  37. package/android/src/main/java/app/notifee/core/model/ChannelGroupModel.java +48 -0
  38. package/android/src/main/java/app/notifee/core/model/ChannelModel.java +123 -0
  39. package/android/src/main/java/app/notifee/core/model/IntervalTriggerModel.java +63 -0
  40. package/android/src/main/java/app/notifee/core/model/NotificationAndroidActionModel.java +125 -0
  41. package/android/src/main/java/app/notifee/core/model/NotificationAndroidModel.java +654 -0
  42. package/android/src/main/java/app/notifee/core/model/NotificationAndroidPressActionModel.java +146 -0
  43. package/android/src/main/java/app/notifee/core/model/NotificationAndroidStyleModel.java +341 -0
  44. package/android/src/main/java/app/notifee/core/model/NotificationModel.java +72 -0
  45. package/android/src/main/java/app/notifee/core/model/TimestampTriggerModel.java +163 -0
  46. package/android/src/main/java/app/notifee/core/model/package-info.java +4 -0
  47. package/android/src/main/java/app/notifee/core/utility/AlarmUtils.java +52 -0
  48. package/android/src/main/java/app/notifee/core/utility/Callbackable.java +12 -0
  49. package/android/src/main/java/app/notifee/core/utility/ColorUtils.java +62 -0
  50. package/android/src/main/java/app/notifee/core/utility/ExtendedListenableFuture.java +84 -0
  51. package/android/src/main/java/app/notifee/core/utility/IntentUtils.java +136 -0
  52. package/android/src/main/java/app/notifee/core/utility/ObjectUtils.java +187 -0
  53. package/android/src/main/java/app/notifee/core/utility/PowerManagerUtils.java +334 -0
  54. package/android/src/main/java/app/notifee/core/utility/ResourceUtils.java +309 -0
  55. package/android/src/main/java/app/notifee/core/utility/TextUtils.java +28 -0
  56. package/android/src/main/java/app/notifee/core/utility/package-info.java +4 -0
  57. package/dist/types/Notification.d.ts +8 -1
  58. package/dist/types/Notification.js +6 -0
  59. package/dist/types/Notification.js.map +1 -1
  60. package/dist/version.d.ts +1 -1
  61. package/jest-mock.js +7 -4
  62. package/package.json +1 -3
  63. package/src/types/Notification.ts +8 -0
  64. package/src/version.ts +1 -1
  65. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar +0 -0
  66. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.md5 +0 -1
  67. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.sha1 +0 -1
  68. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.sha256 +0 -1
  69. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.sha512 +0 -1
  70. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom +0 -9
  71. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.md5 +0 -1
  72. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.sha1 +0 -1
  73. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.sha256 +0 -1
  74. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.sha512 +0 -1
  75. package/android/libs/app/notifee/core/maven-metadata.xml +0 -13
  76. package/android/libs/app/notifee/core/maven-metadata.xml.md5 +0 -1
  77. package/android/libs/app/notifee/core/maven-metadata.xml.sha1 +0 -1
  78. package/android/libs/app/notifee/core/maven-metadata.xml.sha256 +0 -1
  79. package/android/libs/app/notifee/core/maven-metadata.xml.sha512 +0 -1
@@ -0,0 +1,92 @@
1
+ package app.notifee.core;
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import android.content.ContentProvider;
21
+ import android.content.ContentValues;
22
+ import android.content.Context;
23
+ import android.content.pm.ProviderInfo;
24
+ import android.database.Cursor;
25
+ import android.net.Uri;
26
+ import androidx.annotation.CallSuper;
27
+ import androidx.annotation.NonNull;
28
+ import androidx.annotation.Nullable;
29
+
30
+ @KeepForSdk
31
+ public class InitProvider extends ContentProvider {
32
+ private static final String PROVIDER_AUTHORITY = "notifee-init-provider";
33
+
34
+ @Override
35
+ public void attachInfo(Context context, ProviderInfo info) {
36
+ if (info != null && !info.authority.endsWith(InitProvider.PROVIDER_AUTHORITY)) {
37
+ throw new IllegalStateException(
38
+ "Incorrect provider authority in manifest. This is most likely due to a missing "
39
+ + "applicationId variable in application's build.gradle.");
40
+ }
41
+
42
+ super.attachInfo(context, info);
43
+ }
44
+
45
+ @CallSuper
46
+ @Override
47
+ public boolean onCreate() {
48
+ if (ContextHolder.getApplicationContext() == null) {
49
+ Context context = getContext();
50
+ if (context != null && context.getApplicationContext() != null) {
51
+ context = context.getApplicationContext();
52
+ }
53
+ ContextHolder.setApplicationContext(context);
54
+ }
55
+
56
+ return false;
57
+ }
58
+
59
+ @Nullable
60
+ @Override
61
+ public Cursor query(
62
+ @NonNull Uri uri,
63
+ String[] projection,
64
+ String selection,
65
+ String[] selectionArgs,
66
+ String sortOrder) {
67
+ return null;
68
+ }
69
+
70
+ @Nullable
71
+ @Override
72
+ public String getType(@NonNull Uri uri) {
73
+ return null;
74
+ }
75
+
76
+ @Nullable
77
+ @Override
78
+ public Uri insert(@NonNull Uri uri, ContentValues values) {
79
+ return null;
80
+ }
81
+
82
+ @Override
83
+ public int delete(@NonNull Uri uri, String selection, String[] selectionArgs) {
84
+ return 0;
85
+ }
86
+
87
+ @Override
88
+ public int update(
89
+ @NonNull Uri uri, ContentValues values, String selection, String[] selectionArgs) {
90
+ return 0;
91
+ }
92
+ }
@@ -0,0 +1,26 @@
1
+ package app.notifee.core;
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import java.lang.annotation.Documented;
21
+ import java.lang.annotation.ElementType;
22
+ import java.lang.annotation.Target;
23
+
24
+ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
25
+ @Documented
26
+ public @interface KeepForSdk {}
@@ -0,0 +1,68 @@
1
+ package app.notifee.core;
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import android.util.Log;
21
+ import androidx.annotation.NonNull;
22
+ import app.notifee.core.event.LogEvent;
23
+
24
+ public class Logger {
25
+ private static final String TAG = "NOTIFEE";
26
+
27
+ private static String tagAndMessage(String tag, String message) {
28
+ return "(" + tag + "): " + message;
29
+ }
30
+
31
+ @KeepForSdk
32
+ public static void v(@NonNull String tag, String message) {
33
+ Log.v(TAG, tagAndMessage(tag, message));
34
+ }
35
+
36
+ @KeepForSdk
37
+ public static void d(@NonNull String tag, String message) {
38
+ Log.d(TAG, tagAndMessage(tag, message));
39
+ }
40
+
41
+ @KeepForSdk
42
+ public static void i(@NonNull String tag, String message) {
43
+ Log.i(TAG, tagAndMessage(tag, message));
44
+ }
45
+
46
+ @KeepForSdk
47
+ public static void w(@NonNull String tag, String message) {
48
+ Log.w(TAG, tagAndMessage(tag, message));
49
+ }
50
+
51
+ @KeepForSdk
52
+ public static void e(@NonNull String tag, String message, Exception e) {
53
+ Log.e(TAG, tagAndMessage(tag, message), e);
54
+ EventBus.post(new LogEvent(LogEvent.LEVEL_ERROR, tag, message, e));
55
+ }
56
+
57
+ @KeepForSdk
58
+ public static void e(@NonNull String tag, String message) {
59
+ Log.e(TAG, tagAndMessage(tag, message));
60
+ EventBus.post(new LogEvent(LogEvent.LEVEL_ERROR, tag, message));
61
+ }
62
+
63
+ @KeepForSdk
64
+ public static void e(@NonNull String tag, String message, Throwable throwable) {
65
+ Log.e(TAG, tagAndMessage(tag, message), throwable);
66
+ EventBus.post(new LogEvent(LogEvent.LEVEL_ERROR, tag, message, throwable));
67
+ }
68
+ }