react-native-acoustic-mobile-push-snooze-beta 3.9.34 → 3.9.36
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.
package/README.md
CHANGED
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
Optional Campaign plugin for snooze feature.
|
|
1
|
+
# Acoustic Campaign - React-Native Plugin
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
react-native-acoustic-mobile-push-beta
|
|
6
|
-
react-native-acoustic-mobile-push-inapp-beta
|
|
7
|
-
react-native-acoustic-mobile-push-inbox-beta
|
|
8
|
-
----
|
|
3
|
+
Campaign plugin has been published to NPM for React-Native apps. Add the plugin with 'yarn' or 'npm' to start configuring basic or advanced mobile app messaging features using an unified configuration file called 'CampaignConfig.json' for both iOS and Android apps.
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Install
|
|
14
|
-
Add `react-native-acoustic-mobile-push-snooze-beta` to the project.
|
|
15
|
-
|
|
16
|
-
```shell yarn
|
|
17
|
-
yarn add react-native-acoustic-mobile-push-snooze-beta
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
```shell npm
|
|
21
|
-
npm i react-native-acoustic-mobile-push-snooze-beta
|
|
22
|
-
```
|
|
5
|
+
Please review base plugin at https://www.npmjs.com/package/react-native-acoustic-mobile-push-beta for instructions.
|
package/android/build.gradle
CHANGED
|
@@ -1,36 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
buildscript {
|
|
3
|
-
repositories {
|
|
4
|
-
google()
|
|
5
|
-
mavenCentral()
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
dependencies {
|
|
9
|
-
classpath 'com.android.tools.build:gradle:4.1.0'
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
1
|
apply plugin: 'com.android.library'
|
|
14
2
|
|
|
15
3
|
android {
|
|
16
|
-
|
|
4
|
+
compileSdk 34
|
|
17
5
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
defaultConfig {
|
|
7
|
+
minSdkVersion 21
|
|
8
|
+
targetSdkVersion 34
|
|
9
|
+
versionCode 1
|
|
10
|
+
versionName "1.0"
|
|
11
|
+
}
|
|
12
|
+
lintOptions {
|
|
13
|
+
abortOnError false
|
|
14
|
+
}
|
|
27
15
|
}
|
|
28
16
|
|
|
29
17
|
dependencies {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
compileOnly('com.facebook.react:react-native:+') {
|
|
19
|
+
exclude group: 'com.android.support'
|
|
20
|
+
}
|
|
33
21
|
|
|
34
|
-
|
|
22
|
+
implementation "io.github.go-acoustic:acoustic-mobile-push-android-sdk:$campaignSDKVersion"
|
|
35
23
|
}
|
|
36
24
|
|
package/android/src/main/java/co/acoustic/mobile/push/plugin/snooze/SnoozeIntentService.java
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright (C) 2025 Acoustic, L.P. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* NOTICE: This file contains material that is confidential and proprietary to
|
|
5
5
|
* Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
|
|
@@ -29,38 +29,38 @@ import java.util.Calendar;
|
|
|
29
29
|
* This service restores the snoozed notification to the notification bar.
|
|
30
30
|
*/
|
|
31
31
|
public class SnoozeIntentService extends IntentService {
|
|
32
|
-
|
|
32
|
+
private static final String TAG = "SnoozeIntentService";
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
public SnoozeIntentService() {
|
|
35
|
+
super("Snooze");
|
|
36
|
+
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Logger.e(TAG, "Failed to parse notification", jsone);
|
|
49
|
-
}
|
|
38
|
+
@Override
|
|
39
|
+
protected void onHandleIntent(Intent intent) {
|
|
40
|
+
Logger.d(TAG, "Snooze done");
|
|
41
|
+
Bundle extras = new Bundle();
|
|
42
|
+
try {
|
|
43
|
+
extras.putString(Constants.Notifications.ALERT_KEY, intent.getStringExtra(Constants.Notifications.SOURCE_NOTIFICATION_KEY));
|
|
44
|
+
extras.putString(Constants.Notifications.MCE_PAYLOAD_KEY, intent.getStringExtra(Constants.Notifications.SOURCE_MCE_PAYLOAD_KEY));
|
|
45
|
+
AlertProcessor.processAlert(getApplicationContext(), extras);
|
|
46
|
+
} catch (Exception e) {
|
|
47
|
+
Logger.e(TAG, "Failed to process alert", e);
|
|
50
48
|
}
|
|
49
|
+
}
|
|
51
50
|
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
52
|
+
/**
|
|
53
|
+
* This method schedule a notification reappearance
|
|
54
|
+
*
|
|
55
|
+
* @param mgr The alarm manager
|
|
56
|
+
* @param pi The pending intent for the action
|
|
57
|
+
* @param delayInMinutes The number of minutes after which the notification will reappear
|
|
58
|
+
*/
|
|
59
|
+
public void scheduleSnooze(AlarmManager mgr, PendingIntent pi, int delayInMinutes) {
|
|
60
|
+
Calendar alertTime = Calendar.getInstance();
|
|
61
|
+
alertTime.setTimeInMillis(System.currentTimeMillis());
|
|
62
|
+
alertTime.add(Calendar.MINUTE, delayInMinutes);
|
|
63
|
+
mgr.set(AlarmManager.RTC, alertTime.getTimeInMillis(), pi);
|
|
64
|
+
Logger.d(TAG, "Snooze service was scheduled with the date " + alertTime.getTime());
|
|
65
|
+
}
|
|
66
66
|
}
|
package/package.json
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
],
|
|
10
10
|
"author": "Acoustic, L.P.",
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"react-native-acoustic-mobile-push-beta": "3.9.
|
|
12
|
+
"react-native-acoustic-mobile-push-beta": "3.9.36"
|
|
13
13
|
},
|
|
14
14
|
"description": "BETA: Acoustic Mobile Push Snooze Action Plugin",
|
|
15
15
|
"main": "index.js",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
18
|
"directory": "plugins/react-native-acoustic-mobile-push-snooze",
|
|
19
|
-
"url": "https://github.com/
|
|
19
|
+
"url": "https://github.com/go-acoustic/Acoustic-Mobile-Push-React-Native"
|
|
20
20
|
},
|
|
21
|
-
"version": "3.9.
|
|
21
|
+
"version": "3.9.36",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"plist": "^3.0.1",
|
|
24
24
|
"xml2js": "^0.4.19",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"postinstall": "node postinstall.js $INIT_CWD",
|
|
37
37
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
38
38
|
},
|
|
39
|
-
"homepage": "https://
|
|
39
|
+
"homepage": "https://www.acoustic.com/solutions/campaign"
|
|
40
40
|
}
|