react-native-acoustic-mobile-push-textinput-beta 3.8.19

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 ADDED
@@ -0,0 +1,45 @@
1
+ # react-native-acoustic-mobile-push-textinput-beta
2
+ ### Plugins
3
+ Contains Android/iOS native SDKs + the wrapper code to create plugins for React Native
4
+
5
+ ----
6
+
7
+ [Overview](https://developer.goacoustic.com/acoustic-campaign/docs/add-the-react-native-plug-in-to-your-app#overview)
8
+ ---
9
+
10
+ # SampleApp
11
+ Contains iOS / Android native applications that build the shared react views [`/screens`] & the sdk plugin(s)
12
+
13
+ ## Build
14
+ - Please see React Native's Guide(s) on how to setup your environment: https://reactnative.dev/docs/environment-setup
15
+ - Once your environment is setup install the packages - including sdk plugins:
16
+ * `cd SampleApp`
17
+ * `yarn install`
18
+
19
+ ### Run Android
20
+ * `brew install android-platform-tools`
21
+ * `npx react-native run-android`
22
+
23
+ ### Run iOS
24
+ * `cd ios`
25
+ * `pod install`
26
+ * open `.xcworkspace` file in xcode
27
+ * build to device or simulator
28
+
29
+ ### Testing the Sample app
30
+ Tests are stored in the `SampleApp/e2e` directory. All test files of the form `*.spec.js` will be automatically picked up and run by the CI pipeline.
31
+
32
+ To run tests, first build the app using the desired configuration using `detox -c [config name] build`, then run the tests using `detox -c [config name] run`.
33
+
34
+ Available configurations are:
35
+ * ios-15
36
+ * ios-14
37
+ * ios-13
38
+ * android-31
39
+ * android-30
40
+ * android-29
41
+ * android-28
42
+ * android-27
43
+ * android-25
44
+
45
+ Test results will be placed in `SampleApp/test-results.xml`.
@@ -0,0 +1,39 @@
1
+
2
+ buildscript {
3
+ repositories {
4
+ jcenter()
5
+ }
6
+
7
+ dependencies {
8
+ classpath 'com.android.tools.build:gradle:1.3.1'
9
+ }
10
+ }
11
+
12
+ apply plugin: 'com.android.library'
13
+
14
+ android {
15
+ compileSdkVersion 26
16
+
17
+ defaultConfig {
18
+ minSdkVersion 16
19
+ targetSdkVersion 26
20
+ versionCode 1
21
+ versionName "1.0"
22
+ }
23
+ lintOptions {
24
+ abortOnError false
25
+ }
26
+ }
27
+
28
+ repositories {
29
+ mavenCentral()
30
+ }
31
+
32
+ dependencies {
33
+ compileOnly('com.facebook.react:react-native:+') {
34
+ exclude group: 'com.android.support'
35
+ }
36
+
37
+ compileOnly fileTree(dir: '../../react-native-acoustic-mobile-push/android/libs', include: ['*.aar'])
38
+ }
39
+
@@ -0,0 +1,3 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="co.acoustic.mobile.push.plugin.textinput">
3
+ </manifest>
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright © 2022, 2023 Acoustic, L.P. All rights reserved.
3
+ *
4
+ * NOTICE: This file contains material that is confidential and proprietary to
5
+ * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
6
+ * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
7
+ * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
8
+ * prohibited.
9
+ */
10
+
11
+ package co.acoustic.mobile.push.plugin.textinput;
12
+
13
+ import com.facebook.react.bridge.LifecycleEventListener;
14
+ import com.facebook.react.bridge.ReactApplicationContext;
15
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
16
+
17
+ import co.acoustic.mobile.push.sdk.api.notification.MceNotificationActionRegistry;
18
+
19
+ public class RNAcousticMobilePushTextInputModule extends ReactContextBaseJavaModule implements LifecycleEventListener {
20
+ private static String TAG = "RNAcousticMobilePushTextInputModule";
21
+ private static final String TYPE = "textinput";
22
+
23
+ private final ReactApplicationContext reactContext;
24
+
25
+ public RNAcousticMobilePushTextInputModule(ReactApplicationContext reactContext) {
26
+ super(reactContext);
27
+ this.reactContext = reactContext;
28
+ reactContext.addLifecycleEventListener(this);
29
+ }
30
+
31
+ @Override
32
+ public String getName() {
33
+ return "RNAcousticMobilePushTextInput";
34
+ }
35
+
36
+ @Override
37
+ public void onHostResume() {
38
+ MceNotificationActionRegistry.registerNotificationAction(reactContext, TYPE, new TextInputAction());
39
+ }
40
+
41
+ @Override
42
+ public void onHostPause() {
43
+ }
44
+
45
+ @Override
46
+ public void onHostDestroy() {
47
+
48
+ }
49
+ }
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Copyright © 2022, 2023 Acoustic, L.P. All rights reserved.
3
+ *
4
+ * NOTICE: This file contains material that is confidential and proprietary to
5
+ * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
6
+ * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
7
+ * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
8
+ * prohibited.
9
+ */
10
+
11
+ package co.acoustic.mobile.push.plugin.textinput;
12
+
13
+ import java.util.Arrays;
14
+ import java.util.Collections;
15
+ import java.util.List;
16
+
17
+ import com.facebook.react.ReactPackage;
18
+ import com.facebook.react.bridge.NativeModule;
19
+ import com.facebook.react.bridge.ReactApplicationContext;
20
+ import com.facebook.react.uimanager.ViewManager;
21
+ import com.facebook.react.bridge.JavaScriptModule;
22
+ public class RNAcousticMobilePushTextInputPackage implements ReactPackage {
23
+ @Override
24
+ public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
25
+ return Arrays.<NativeModule>asList(new RNAcousticMobilePushTextInputModule(reactContext));
26
+ }
27
+
28
+ // Deprecated from RN 0.47
29
+ public List<Class<? extends JavaScriptModule>> createJSModules() {
30
+ return Collections.emptyList();
31
+ }
32
+
33
+ @Override
34
+ public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
35
+ return Collections.emptyList();
36
+ }
37
+ }
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Copyright © 2022, 2023 Acoustic, L.P. All rights reserved.
3
+ *
4
+ * NOTICE: This file contains material that is confidential and proprietary to
5
+ * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
6
+ * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
7
+ * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
8
+ * prohibited.
9
+ */
10
+
11
+ package co.acoustic.mobile.push.plugin.textinput;
12
+
13
+ import android.content.Context;
14
+ import android.os.Bundle;
15
+ import android.util.Log;
16
+ import android.widget.Toast;
17
+
18
+ import org.json.JSONObject;
19
+
20
+ import java.util.Map;
21
+
22
+ import co.acoustic.mobile.push.sdk.api.notification.MceCustomNotificationInput;
23
+ import co.acoustic.mobile.push.sdk.api.notification.MceInputNotificationAction;
24
+ import co.acoustic.mobile.push.sdk.api.notification.MceNotificationAction;
25
+ import co.acoustic.mobile.push.sdk.api.notification.NotificationDetails;
26
+
27
+ /**
28
+ *
29
+ */
30
+ public class TextInputAction implements MceInputNotificationAction {
31
+
32
+ private static final String TAG = "TextInputAction";
33
+
34
+ @Override
35
+ public void handleAction(Context context, String type, String name, String attribution, String mailingId, Map<String, String> payload, boolean fromNotification) {
36
+
37
+ }
38
+
39
+ @Override
40
+ public void init(Context context, JSONObject initOptions) {
41
+ }
42
+
43
+ @Override
44
+ public void update(Context context, JSONObject updateOptions) {
45
+
46
+ }
47
+
48
+ @Override
49
+ public boolean shouldDisplayNotification(Context context, NotificationDetails notificationDetails, Bundle sourceBundle) {
50
+ return true;
51
+ }
52
+
53
+ @Override
54
+ public boolean shouldSendDefaultEvent(Context context) {
55
+ return true;
56
+ }
57
+
58
+ @Override
59
+ public void handleAction(Context context, String input, String type, String name, String attribution, String mailingId, Map<String, String> payload, boolean fromNotification) {
60
+ Toast.makeText(context, input, Toast.LENGTH_LONG).show();
61
+ }
62
+
63
+ @Override
64
+ public MceCustomNotificationInput getCustomInput() {
65
+ return null;
66
+ }
67
+
68
+ }
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "author": "Acoustic, L.P.",
3
+ "dependencies": {
4
+ "chalk": "^2.4.2",
5
+ "ncp": "^2.0.0",
6
+ "plist": "^3.0.1",
7
+ "xcode": "^2.0.0",
8
+ "xml2js": "^0.4.19"
9
+ },
10
+ "description": "BETA: Acoustic Mobile Push Text Input Action Plugin",
11
+ "devDependencies": {
12
+ "jetifier": "^1.6.3"
13
+ },
14
+ "homepage": "https://github.com/aipoweredmarketer/ca-mce-react-native",
15
+ "keywords": [
16
+ "react-native",
17
+ "ios",
18
+ "android",
19
+ "mobile push text input action",
20
+ "Campaign"
21
+ ],
22
+ "license": "See license in ../../../license.txt",
23
+ "main": "index.js",
24
+ "name": "react-native-acoustic-mobile-push-textinput-beta",
25
+ "peerDependencies": {
26
+ "react-native-acoustic-mobile-push-beta": "3.8.19"
27
+ },
28
+ "repository": {
29
+ "directory": "plugins/react-native-acoustic-mobile-push-textinput",
30
+ "type": "git",
31
+ "url": "https://github.com/aipoweredmarketer/ca-mce-react-native"
32
+ },
33
+ "scripts": {
34
+ "test": "echo \"Error: no test specified\" && exit 1"
35
+ },
36
+ "summary": "react-native ios android mobile push Campaign",
37
+ "version": "3.8.19"
38
+ }