react-native-acoustic-mobile-push-inbox-beta 3.8.12
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 +45 -0
- package/android/android-react-native-acoustic-mobile-push-inbox.iml +217 -0
- package/android/build.gradle +41 -0
- package/android/react-native-acoustic-mobile-push-inbox.iml +218 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/co/acoustic/mobile/push/plugin/inbox/RNAcousticMobilePushBroadcastReceiver.java +114 -0
- package/android/src/main/java/co/acoustic/mobile/push/plugin/inbox/RNAcousticMobilePushInboxModule.java +630 -0
- package/android/src/main/java/co/acoustic/mobile/push/plugin/inbox/RNAcousticMobilePushInboxPackage.java +37 -0
- package/android/src/main/res/drawable-hdpi/ic_action_back.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_action_forward.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_action_back.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_action_forward.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_action_back.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_action_forward.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_action_back.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_action_forward.png +0 -0
- package/android/src/main/res/layout/activity_action_webview.xml +10 -0
- package/android/src/main/res/menu/menu_action_webview.xml +19 -0
- package/android/src/main/res/values/mce-plugin-displayweb-strings.xml +5 -0
- package/ios/RNAcousticMobilePushInbox.h +22 -0
- package/ios/RNAcousticMobilePushInbox.m +288 -0
- package/ios/RNAcousticMobilePushInbox.xcodeproj/project.pbxproj +278 -0
- package/ios/RNAcousticMobilePushInbox.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNAcousticMobilePushInbox.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNAcousticMobilePushInbox.xcodeproj/project.xcworkspace/xcuserdata/buchmanj.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNAcousticMobilePushInbox.xcodeproj/xcshareddata/xcschemes/RNAcousticMobilePushInbox.xcscheme +67 -0
- package/ios/RNAcousticMobilePushInbox.xcodeproj/xcuserdata/buchmanj.xcuserdatad/xcschemes/xcschememanagement.plist +32 -0
- package/ios/RNAcousticMobilePushInbox.xcworkspace/contents.xcworkspacedata +9 -0
- package/javascript/default-inbox-template.js +67 -0
- package/javascript/full-width-image.js +62 -0
- package/javascript/full-width-video.js +66 -0
- package/javascript/inbox-action.js +68 -0
- package/javascript/inbox-list-item.js +26 -0
- package/javascript/inbox-message-view.js +27 -0
- package/javascript/inbox-template-registry.js +57 -0
- package/javascript/post-inbox-template.js +84 -0
- package/package.json +39 -0
- package/postinstall.js +103 -0
- package/react-native-acoustic-mobile-push-inbox.podspec +23 -0
package/postinstall.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2019, 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
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const xml2js = require('xml2js');
|
|
14
|
+
const chalk = require('chalk');
|
|
15
|
+
|
|
16
|
+
function findInstallDirectory() {
|
|
17
|
+
if(process.env.MCE_RN_DIRECTORY) {
|
|
18
|
+
console.log(chalk.yellow.bold("Using MCE_RN_DIRECTORY override instead of finding the application source directory."))
|
|
19
|
+
return process.env.MCE_RN_DIRECTORY;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Mac
|
|
23
|
+
var currentDirectory = process.argv[ process.argv.length-1 ];
|
|
24
|
+
if(currentDirectory != "$INIT_CWD") {
|
|
25
|
+
return currentDirectory;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Windows
|
|
29
|
+
currentDirectory = process.cwd();
|
|
30
|
+
while(!fs.existsSync(path.join(currentDirectory, "app.json"))) {
|
|
31
|
+
var parentDirectory = path.dirname(currentDirectory);
|
|
32
|
+
console.log("cwd: ", currentDirectory, ", parent: ", parentDirectory);
|
|
33
|
+
if(parentDirectory == currentDirectory) {
|
|
34
|
+
console.error(chalk.red("Could not find installation directory!"));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
currentDirectory = parentDirectory;
|
|
38
|
+
}
|
|
39
|
+
console.log("Install Directory Found:", currentDirectory);
|
|
40
|
+
|
|
41
|
+
return currentDirectory;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function containsStanza(array, stanza, type) {
|
|
45
|
+
for(var i = 0; i < array.length; i++) {
|
|
46
|
+
if(array[i]['$']['android:name'] == stanza[type]['$']['android:name']) {
|
|
47
|
+
return true
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function verifyStanza(array, stanzaString) {
|
|
54
|
+
if(typeof array == "undefined") {
|
|
55
|
+
array = [];
|
|
56
|
+
}
|
|
57
|
+
new xml2js.Parser().parseString(stanzaString, function (err, stanza) {
|
|
58
|
+
const types = Object.getOwnPropertyNames(stanza);
|
|
59
|
+
const type = types[0];
|
|
60
|
+
if( !containsStanza(array, stanza, type) ) {
|
|
61
|
+
console.log("Adding required " + type + " stanza to AndroidManifest.xml");
|
|
62
|
+
array.push( stanza[type] )
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return array;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function modifyManifest(installDirectory) {
|
|
69
|
+
let manifestPath = path.join(installDirectory, "android", "app", "src", "main", "AndroidManifest.xml");
|
|
70
|
+
new xml2js.Parser().parseString(fs.readFileSync(manifestPath), function (err, document) {
|
|
71
|
+
|
|
72
|
+
var services = document.manifest.application[0].service;
|
|
73
|
+
var service = '<service android:name="co.acoustic.mobile.push.sdk.plugin.inbox.InboxUpdateService" />';
|
|
74
|
+
document.manifest.application[0].service = verifyStanza(services, service);
|
|
75
|
+
|
|
76
|
+
var output = new xml2js.Builder().buildObject(document);
|
|
77
|
+
fs.writeFileSync(manifestPath, output);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if(process.env.MCE_RN_NOCONFIG) {
|
|
82
|
+
console.log(chalk.yellow.bold("Acoustic Mobile Push Inbox Plugin installed, but will not be auto configured because MCE_RN_NOCONFIG environment flag detected."));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
console.log(chalk.green.bold("Setting up Acoustic Mobile Push Inbox Plugin"));
|
|
87
|
+
const installDirectory = findInstallDirectory();
|
|
88
|
+
modifyManifest(installDirectory);
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
console.log(chalk.green("Installation Complete!"));
|
|
92
|
+
|
|
93
|
+
console.log(chalk.blue.bold("\nPost Installation Steps\n"));
|
|
94
|
+
console.log(chalk.blue('For react-native 0.59 and lower link the plugin with:'));
|
|
95
|
+
console.log('react-native link react-native-acoustic-mobile-push-inbox\n');
|
|
96
|
+
|
|
97
|
+
console.log(chalk.blue('Application Support:'));
|
|
98
|
+
console.log('Template files in this plugins javascript directory will need to be integrated into your application and the templates will need to be imported so they can register with the SDK at startup like this:');
|
|
99
|
+
console.log("import {DefaultInbox} from './inbox/default-inbox-template';");
|
|
100
|
+
console.log("import {PostInbox} from './inbox/post-inbox-template';");
|
|
101
|
+
console.log("import {InboxAction} from './inbox/inbox-action';");
|
|
102
|
+
console.log("\nAdditionally, you will need to create pages to display the list of messages and the full screen messages. See the sample project's inbox-message-screen.js and inbox-screen.js for examples of how this can be done.\n");
|
|
103
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "react-native-acoustic-mobile-push-inbox"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.description = <<-DESC
|
|
10
|
+
react-native-acoustic-mobile-push-inbox
|
|
11
|
+
DESC
|
|
12
|
+
s.homepage = "https://github.com/Acoustic-Mobile-Push/React-Native"
|
|
13
|
+
s.license = "Copyright (c) 2019. Acoustic, L.P. All rights reserved"
|
|
14
|
+
s.authors = { "Support" => "support@acoustic.co" }
|
|
15
|
+
s.platforms = { :ios => "12.0" }
|
|
16
|
+
s.source = { :git => "https://github.com/Acoustic-Mobile-Push/React-Native.git", :tag => "#{s.version}" }
|
|
17
|
+
|
|
18
|
+
s.source_files = "ios/*.{h,m,swift}"
|
|
19
|
+
s.requires_arc = true
|
|
20
|
+
|
|
21
|
+
s.dependency "React"
|
|
22
|
+
end
|
|
23
|
+
|