cordova-plugin-appice 2.0.6 → 2.0.8

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 (35) hide show
  1. package/README.md +122 -122
  2. package/example/config.xml +59 -59
  3. package/example/package.json +38 -38
  4. package/example/res/ai_android.pem +40 -40
  5. package/example/www/css/index.css +116 -116
  6. package/example/www/index.html +62 -62
  7. package/example/www/js/index.js +102 -102
  8. package/libcordova/android-release-aar.gradle +62 -62
  9. package/libcordova/build.gradle +50 -50
  10. package/libcordova/proguard-rules.pro +21 -21
  11. package/libcordova/src/main/AndroidManifest.xml +24 -24
  12. package/libcordova/src/main/java/com/appice/cordova/AppICEPlugin.java +968 -968
  13. package/libcordova/src/main/java/com/appice/cordova/CampaignCampsReceiver.java +95 -95
  14. package/libcordova/src/main/java/com/appice/cordova/NotificationEventService.java +55 -55
  15. package/libcordova/src/main/res/values/strings.xml +3 -3
  16. package/package.json +26 -26
  17. package/plugin.xml +128 -130
  18. package/scripts/BeforeAndroidBuilt.js +126 -112
  19. package/scripts/BeforeIosBuilt.js +38 -38
  20. package/scripts/androidAfterPluginAdd.js +159 -159
  21. package/scripts/androidAfterPluginRm.js +195 -195
  22. package/scripts/iOSAfterPluginAdd.js +98 -98
  23. package/scripts/iOSAfterPluginRm.js +74 -74
  24. package/src/build.gradle +14 -5
  25. package/src/firebase/modified/android/FirebasePluginMessagingService.java +356 -356
  26. package/src/firebase/modified/ios/AppDelegate+FirebasePlugin.m +529 -529
  27. package/src/firebase/modified/modified.iml +10 -10
  28. package/src/firebase/original/android/FirebasePluginMessagingService.java +348 -348
  29. package/src/firebase/original/ios/AppDelegate+FirebasePlugin.m +519 -519
  30. package/src/firebase/original/original.iml +10 -10
  31. package/src/ios/AppDelegate+AppICEPlugin.h +8 -8
  32. package/src/ios/AppDelegate+AppICEPlugin.m +191 -259
  33. package/src/ios/AppICEPlugin.h +90 -90
  34. package/src/ios/AppICEPlugin.m +1062 -1087
  35. package/www/AppICE.js +283 -283
@@ -1,117 +1,117 @@
1
- /*
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. 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,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
- * {
20
- -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
21
- }
22
-
23
- body {
24
- -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
25
- -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
26
- -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
27
- background-color:#E4E4E4;
28
- background-image:linear-gradient(to bottom, #FFFFFF 0%, #E4E4E4 51%);
29
- font-family: system-ui, -apple-system, -apple-system-font, 'Segoe UI', 'Roboto', sans-serif;
30
- font-size:12px;
31
- height:100vh;
32
- margin:0px;
33
- padding:0px;
34
- /* Padding to avoid the "unsafe" areas behind notches in the screen */
35
- padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
36
- text-transform:uppercase;
37
- width:100%;
38
- }
39
-
40
- /* Portrait layout (default) */
41
- .app {
42
- background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
43
- /* position in the center of the screen */
44
-
45
- text-align:center;
46
- padding:224px 0px 55px 53px; /* image height is 200px (bottom 20px are overlapped with text) */
47
- margin:48px 0px 0px -48px; /* offset vertical: half of image height and text area height */
48
- /* offset horizontal: half of text area width */
49
- }
50
-
51
- /* Landscape layout (with min-width) */
52
- /* @media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
53
- .app {
54
- background-position:left center;
55
- padding:75px 0px 75px 170px; padding-top + padding-bottom + text area = image height
56
- margin:-90px 0px 0px -198px; offset vertical: half of image height
57
- offset horizontal: half of image width and text area width
58
- }
59
- } */
60
-
61
- h1 {
62
- font-size:24px;
63
- font-weight:normal;
64
- margin:0px;
65
- overflow:visible;
66
- padding:0px;
67
- text-align:center;
68
- color:#FFFFFF;
69
- }
70
-
71
- .event {
72
- border-radius:4px;
73
- color:#FFFFFF;
74
- font-size:12px;
75
- margin:0px 30px;
76
- padding:2px 0px;
77
- }
78
-
79
- .event.listening {
80
- background-color:#FFFFFF;
81
- display:block;
82
- }
83
-
84
- .event.received {
85
- background-color:#4B946A;
86
- display:none;
87
- }
88
-
89
- #deviceready.ready .event.listening { display: none; }
90
- #deviceready.ready .event.received { display: block; }
91
-
92
- @keyframes fade {
93
- from { opacity: 1.0; }
94
- 50% { opacity: 0.4; }
95
- to { opacity: 1.0; }
96
- }
97
-
98
- .blink {
99
- animation:fade 3000ms infinite;
100
- -webkit-animation:fade 3000ms infinite;
101
- }
102
-
103
-
104
- @media screen and (prefers-color-scheme: dark) {
105
- body {
106
- background-image:linear-gradient(to bottom, #FFFFFF 0%, #FFFFFF 51%);
107
- }
108
- }
109
-
110
- .btn2{
111
- padding-top: 20px;
112
- padding-bottom: 20px;
113
- background-color: #4B946A;
114
- color: #FFFFFF;
115
- width: 139px;
116
-
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. 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,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ * {
20
+ -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
21
+ }
22
+
23
+ body {
24
+ -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
25
+ -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
26
+ -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
27
+ background-color:#E4E4E4;
28
+ background-image:linear-gradient(to bottom, #FFFFFF 0%, #E4E4E4 51%);
29
+ font-family: system-ui, -apple-system, -apple-system-font, 'Segoe UI', 'Roboto', sans-serif;
30
+ font-size:12px;
31
+ height:100vh;
32
+ margin:0px;
33
+ padding:0px;
34
+ /* Padding to avoid the "unsafe" areas behind notches in the screen */
35
+ padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
36
+ text-transform:uppercase;
37
+ width:100%;
38
+ }
39
+
40
+ /* Portrait layout (default) */
41
+ .app {
42
+ background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
43
+ /* position in the center of the screen */
44
+
45
+ text-align:center;
46
+ padding:224px 0px 55px 53px; /* image height is 200px (bottom 20px are overlapped with text) */
47
+ margin:48px 0px 0px -48px; /* offset vertical: half of image height and text area height */
48
+ /* offset horizontal: half of text area width */
49
+ }
50
+
51
+ /* Landscape layout (with min-width) */
52
+ /* @media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
53
+ .app {
54
+ background-position:left center;
55
+ padding:75px 0px 75px 170px; padding-top + padding-bottom + text area = image height
56
+ margin:-90px 0px 0px -198px; offset vertical: half of image height
57
+ offset horizontal: half of image width and text area width
58
+ }
59
+ } */
60
+
61
+ h1 {
62
+ font-size:24px;
63
+ font-weight:normal;
64
+ margin:0px;
65
+ overflow:visible;
66
+ padding:0px;
67
+ text-align:center;
68
+ color:#FFFFFF;
69
+ }
70
+
71
+ .event {
72
+ border-radius:4px;
73
+ color:#FFFFFF;
74
+ font-size:12px;
75
+ margin:0px 30px;
76
+ padding:2px 0px;
77
+ }
78
+
79
+ .event.listening {
80
+ background-color:#FFFFFF;
81
+ display:block;
82
+ }
83
+
84
+ .event.received {
85
+ background-color:#4B946A;
86
+ display:none;
87
+ }
88
+
89
+ #deviceready.ready .event.listening { display: none; }
90
+ #deviceready.ready .event.received { display: block; }
91
+
92
+ @keyframes fade {
93
+ from { opacity: 1.0; }
94
+ 50% { opacity: 0.4; }
95
+ to { opacity: 1.0; }
96
+ }
97
+
98
+ .blink {
99
+ animation:fade 3000ms infinite;
100
+ -webkit-animation:fade 3000ms infinite;
101
+ }
102
+
103
+
104
+ @media screen and (prefers-color-scheme: dark) {
105
+ body {
106
+ background-image:linear-gradient(to bottom, #FFFFFF 0%, #FFFFFF 51%);
107
+ }
108
+ }
109
+
110
+ .btn2{
111
+ padding-top: 20px;
112
+ padding-bottom: 20px;
113
+ background-color: #4B946A;
114
+ color: #FFFFFF;
115
+ width: 139px;
116
+
117
117
  }
@@ -1,62 +1,62 @@
1
- <!DOCTYPE html>
2
- <!--
3
- Licensed to the Apache Software Foundation (ASF) under one
4
- or more contributor license agreements. See the NOTICE file
5
- distributed with this work for additional information
6
- regarding copyright ownership. The ASF licenses this file
7
- to you under the Apache License, Version 2.0 (the
8
- "License"); you may not use this file except in compliance
9
- with the License. You may obtain a copy of the License at
10
-
11
- http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- Unless required by applicable law or agreed to in writing,
14
- software distributed under the License is distributed on an
15
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- KIND, either express or implied. See the License for the
17
- specific language governing permissions and limitations
18
- under the License.
19
- -->
20
- <html>
21
- <head>
22
- <meta charset="utf-8">
23
- <!--
24
- Customize this policy to fit your own app's needs. For more guidance, please refer to the docs:
25
- https://cordova.apache.org/docs/en/latest/
26
- Some notes:
27
- * https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
28
- * Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
29
- * Enable inline JS: add 'unsafe-inline' to default-src
30
- -->
31
- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
32
- <meta name="format-detection" content="telephone=no">
33
- <meta name="msapplication-tap-highlight" content="no">
34
- <meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover">
35
- <meta name="color-scheme" content="light dark">
36
- <link rel="stylesheet" href="css/index.css">
37
- <title>Hello World</title>
38
- </head>
39
- <body>
40
- <div class="app">
41
- <div id="deviceready" class="blink">
42
- <p class="event listening">Connecting to Device</p>
43
- <p class="event received">Device is Ready</p>
44
- </div>
45
-
46
- </div>
47
-
48
- <div style="padding-top:10px ; padding-bottom: 10px; margin-left: 123px;">
49
- <button id="event" class="btn2">Event</button>
50
- </div>
51
-
52
- <div style="padding-top:10px ; padding-bottom: 10px; margin-left: 123px;">
53
- <button id="userid" class="btn2">User ID</button>
54
- </div>
55
-
56
- <div style="padding-top:10px ; padding-bottom: 10px; margin-left: 123px;">
57
- <button id="userinfo" class="btn2">User Info</button>
58
- </div>
59
- <script src="cordova.js"></script>
60
- <script src="js/index.js"></script>
61
- </body>
62
- </html>
1
+ <!DOCTYPE html>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one
4
+ or more contributor license agreements. See the NOTICE file
5
+ distributed with this work for additional information
6
+ regarding copyright ownership. The ASF licenses this file
7
+ to you under the Apache License, Version 2.0 (the
8
+ "License"); you may not use this file except in compliance
9
+ with the License. You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing,
14
+ software distributed under the License is distributed on an
15
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ KIND, either express or implied. See the License for the
17
+ specific language governing permissions and limitations
18
+ under the License.
19
+ -->
20
+ <html>
21
+ <head>
22
+ <meta charset="utf-8">
23
+ <!--
24
+ Customize this policy to fit your own app's needs. For more guidance, please refer to the docs:
25
+ https://cordova.apache.org/docs/en/latest/
26
+ Some notes:
27
+ * https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
28
+ * Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
29
+ * Enable inline JS: add 'unsafe-inline' to default-src
30
+ -->
31
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
32
+ <meta name="format-detection" content="telephone=no">
33
+ <meta name="msapplication-tap-highlight" content="no">
34
+ <meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover">
35
+ <meta name="color-scheme" content="light dark">
36
+ <link rel="stylesheet" href="css/index.css">
37
+ <title>Hello World</title>
38
+ </head>
39
+ <body>
40
+ <div class="app">
41
+ <div id="deviceready" class="blink">
42
+ <p class="event listening">Connecting to Device</p>
43
+ <p class="event received">Device is Ready</p>
44
+ </div>
45
+
46
+ </div>
47
+
48
+ <div style="padding-top:10px ; padding-bottom: 10px; margin-left: 123px;">
49
+ <button id="event" class="btn2">Event</button>
50
+ </div>
51
+
52
+ <div style="padding-top:10px ; padding-bottom: 10px; margin-left: 123px;">
53
+ <button id="userid" class="btn2">User ID</button>
54
+ </div>
55
+
56
+ <div style="padding-top:10px ; padding-bottom: 10px; margin-left: 123px;">
57
+ <button id="userinfo" class="btn2">User Info</button>
58
+ </div>
59
+ <script src="cordova.js"></script>
60
+ <script src="js/index.js"></script>
61
+ </body>
62
+ </html>
@@ -1,102 +1,102 @@
1
- /*
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. 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,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
-
20
- // Wait for the deviceready event before using any of Cordova's device APIs.
21
- // See https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready
22
- document.addEventListener('deviceready', onDeviceReady, false);
23
-
24
- function onDeviceReady() {
25
- // Cordova is now initialized. Have fun!
26
-
27
- console.log('Running cordova-' + cordova.platformId + '@' + cordova.version);
28
- document.getElementById('deviceready').classList.add('ready');
29
- initializesdk();
30
- }
31
-
32
- // initialize appice sdk
33
- //document.getElementById("initsdk").addEventListener("click", initializesdk);
34
- function initializesdk(){
35
- var certs = [];
36
- // certs = ["assets/ai_android.pem"]; this is for enabling ssl pinning if no ssl certificates pass null
37
- console.log("certs : ", certs);
38
- AppICE.initSdk("5bebe93c25d705690ffbc758", "9e9ec60197c8373a11ac15ce4dae80e973608ab2", "d985715d1bb48942d36d5d08de3b6a8c", "",
39
- "US",
40
- "https://a.appice.io",
41
- certs,
42
- function (success) {
43
- console.log("init success", success);
44
- }, function (error) {
45
- console.log("init Failed", error);
46
- });
47
-
48
-
49
- AppICE.setSessionTimeout(1800,
50
- function(success){
51
- console.log("Session success " + success);
52
- },function(error){
53
- console.log("Session Failed "+ error);
54
- }
55
- );
56
- }
57
-
58
-
59
- //set user id
60
- document.getElementById("userid").addEventListener("click", userid);
61
- function userid(){
62
- const userid = ["987"];
63
- AppICE.setUserId(userid,
64
- function (success) {
65
- console.log("Set user id success", success);
66
- }, function (error) {
67
- console.log("Set user id Failed", error);
68
- });
69
-
70
- }
71
-
72
-
73
-
74
- //set user details
75
- document.getElementById("userinfo").addEventListener("click", userinfo);
76
- function userinfo(){
77
- AppICE.setUser("Jhon Doe", "9876543210", "a@gmail.com", function (success) {
78
- console.log("Set user success",success);
79
- }, function (error) {
80
- console.log("Set user error",error);
81
- });
82
- }
83
-
84
-
85
- //get event
86
- document.getElementById("event").addEventListener("click", allevent);
87
- function allevent(){
88
- console.log("inside event method");
89
- var dataObj = {
90
- "ClickedMenuBtn":"false",
91
- "CLickedSubmitBtn":"false",
92
- "AppName":"SampleApp"
93
- };
94
- AppICE.tagEvent("SampleApp", dataObj,
95
- function(success) {
96
- console.log("tagEvent success: " + JSON.stringify(success));
97
-
98
- }, function(error) {
99
- console.error("tagEvent Error : " + error);
100
- });
101
- }
102
-
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. 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,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ // Wait for the deviceready event before using any of Cordova's device APIs.
21
+ // See https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready
22
+ document.addEventListener('deviceready', onDeviceReady, false);
23
+
24
+ function onDeviceReady() {
25
+ // Cordova is now initialized. Have fun!
26
+
27
+ console.log('Running cordova-' + cordova.platformId + '@' + cordova.version);
28
+ document.getElementById('deviceready').classList.add('ready');
29
+ initializesdk();
30
+ }
31
+
32
+ // initialize appice sdk
33
+ //document.getElementById("initsdk").addEventListener("click", initializesdk);
34
+ function initializesdk(){
35
+ var certs = [];
36
+ // certs = ["assets/ai_android.pem"]; this is for enabling ssl pinning if no ssl certificates pass null
37
+ console.log("certs : ", certs);
38
+ AppICE.initSdk("5bebe93c25d705690ffbc758", "9e9ec60197c8373a11ac15ce4dae80e973608ab2", "d985715d1bb48942d36d5d08de3b6a8c", "",
39
+ "US",
40
+ "https://a.appice.io",
41
+ certs,
42
+ function (success) {
43
+ console.log("init success", success);
44
+ }, function (error) {
45
+ console.log("init Failed", error);
46
+ });
47
+
48
+
49
+ AppICE.setSessionTimeout(1800,
50
+ function(success){
51
+ console.log("Session success " + success);
52
+ },function(error){
53
+ console.log("Session Failed "+ error);
54
+ }
55
+ );
56
+ }
57
+
58
+
59
+ //set user id
60
+ document.getElementById("userid").addEventListener("click", userid);
61
+ function userid(){
62
+ const userid = ["987"];
63
+ AppICE.setUserId(userid,
64
+ function (success) {
65
+ console.log("Set user id success", success);
66
+ }, function (error) {
67
+ console.log("Set user id Failed", error);
68
+ });
69
+
70
+ }
71
+
72
+
73
+
74
+ //set user details
75
+ document.getElementById("userinfo").addEventListener("click", userinfo);
76
+ function userinfo(){
77
+ AppICE.setUser("Jhon Doe", "9876543210", "a@gmail.com", function (success) {
78
+ console.log("Set user success",success);
79
+ }, function (error) {
80
+ console.log("Set user error",error);
81
+ });
82
+ }
83
+
84
+
85
+ //get event
86
+ document.getElementById("event").addEventListener("click", allevent);
87
+ function allevent(){
88
+ console.log("inside event method");
89
+ var dataObj = {
90
+ "ClickedMenuBtn":"false",
91
+ "CLickedSubmitBtn":"false",
92
+ "AppName":"SampleApp"
93
+ };
94
+ AppICE.tagEvent("SampleApp", dataObj,
95
+ function(success) {
96
+ console.log("tagEvent success: " + JSON.stringify(success));
97
+
98
+ }, function(error) {
99
+ console.error("tagEvent Error : " + error);
100
+ });
101
+ }
102
+