pushwoosh-cordova-plugin 8.3.55 → 8.3.57

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 (33) hide show
  1. package/README.md +2 -2
  2. package/example_voip/LICENSE +21 -0
  3. package/example_voip/README.md +156 -0
  4. package/example_voip/Screenshots/Android.png +0 -0
  5. package/example_voip/Screenshots/iOS.png +0 -0
  6. package/example_voip/Screenshots/xcode_appgroups.png +0 -0
  7. package/example_voip/demovoip/README.md +181 -0
  8. package/example_voip/demovoip/config.xml +22 -0
  9. package/example_voip/demovoip/google-services.json +86 -0
  10. package/example_voip/demovoip/hooks/after_platform_add/010_install_plugin.js +46 -0
  11. package/example_voip/demovoip/hooks/after_prepare/010_setup_gradle_wrapper.js +34 -0
  12. package/example_voip/demovoip/hooks/after_prepare/015_fix_agp_version.js +36 -0
  13. package/example_voip/demovoip/hooks/after_prepare/020_copy_google_services.js +23 -0
  14. package/example_voip/demovoip/hooks/after_prepare/025_add_voip_pod.js +43 -0
  15. package/example_voip/demovoip/hooks/after_prepare.js +28 -0
  16. package/example_voip/demovoip/package-lock.json +1104 -0
  17. package/example_voip/demovoip/package.json +34 -0
  18. package/example_voip/demovoip/www/css/index.css +605 -0
  19. package/example_voip/demovoip/www/img/logo.png +0 -0
  20. package/example_voip/demovoip/www/index.html +175 -0
  21. package/example_voip/demovoip/www/js/index.js +419 -0
  22. package/package.json +1 -1
  23. package/plugin.xml +12 -9
  24. package/src/android/add-android-voip.gradle +1 -1
  25. package/src/android/src/com/pushwoosh/plugin/pushnotifications/CallsAdapter.java +0 -1
  26. package/src/android/src/com/pushwoosh/plugin/pushnotifications/NoopCallsAdapter.java +0 -5
  27. package/src/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java +123 -42
  28. package/src/android/src/com/pushwoosh/plugin/pushnotifications/VoIPEventStorage.java +130 -0
  29. package/src/android/src/com/pushwoosh/plugin/pushnotifications/calls/PWCordovaCallEventListener.java +61 -34
  30. package/src/android/src/com/pushwoosh/plugin/pushnotifications/calls/PushwooshCallsAdapter.java +18 -13
  31. package/src/ios/PushNotification.m +0 -5
  32. package/types/PushNotification.d.ts +0 -1
  33. package/www/PushNotification.js +0 -4
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "com.pushwoosh.demovoip",
3
+ "displayName": "demovoip",
4
+ "version": "1.0.0",
5
+ "description": "Pushwoosh VoIP Sample App",
6
+ "main": "index.js",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "keywords": [
11
+ "ecosystem:cordova",
12
+ "pushwoosh",
13
+ "voip",
14
+ "callkit"
15
+ ],
16
+ "author": "Pushwoosh Team",
17
+ "license": "Apache-2.0",
18
+ "devDependencies": {
19
+ "cordova-android": "^14.0.1",
20
+ "cordova-ios": "^7.1.1",
21
+ "pushwoosh-cordova-plugin": "file:../.."
22
+ },
23
+ "cordova": {
24
+ "platforms": [
25
+ "ios",
26
+ "android"
27
+ ],
28
+ "plugins": {
29
+ "pushwoosh-cordova-plugin": {
30
+ "PW_VOIP_ANDROID_ENABLED": "true"
31
+ }
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,605 @@
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
+ /* Global box-sizing to prevent horizontal scroll */
21
+ * {
22
+ box-sizing: border-box;
23
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
24
+ }
25
+
26
+ html, body {
27
+ width: 100%;
28
+ height: 100vh;
29
+ height: -webkit-fill-available;
30
+ margin: 0;
31
+ padding: 0;
32
+ overflow: hidden;
33
+ position: fixed;
34
+ }
35
+
36
+ body {
37
+ -webkit-touch-callout: none;
38
+ -webkit-text-size-adjust: none;
39
+ background-color: #f5f5f5;
40
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
41
+ font-size: 16px;
42
+ color: #333;
43
+ }
44
+
45
+ /* Welcome Screen */
46
+ .welcome-overlay {
47
+ position: fixed;
48
+ top: 0;
49
+ left: 0;
50
+ width: 100%;
51
+ height: 100%;
52
+ background-color: rgba(0, 0, 0, 0.8);
53
+ z-index: 1000;
54
+ display: flex;
55
+ align-items: center;
56
+ justify-content: center;
57
+ padding: 20px;
58
+ }
59
+
60
+ .welcome-overlay.hidden {
61
+ display: none;
62
+ }
63
+
64
+ .welcome-content {
65
+ background: white;
66
+ border-radius: 16px;
67
+ padding: 30px;
68
+ max-width: 500px;
69
+ width: 100%;
70
+ max-height: 80vh;
71
+ overflow-y: auto;
72
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
73
+ }
74
+
75
+ .welcome-content h2 {
76
+ margin: 0 0 20px 0;
77
+ font-size: 24px;
78
+ font-weight: 700;
79
+ color: #667eea;
80
+ text-align: center;
81
+ }
82
+
83
+ .welcome-instructions {
84
+ margin-bottom: 25px;
85
+ line-height: 1.6;
86
+ }
87
+
88
+ .welcome-instructions p {
89
+ margin: 15px 0;
90
+ }
91
+
92
+ .welcome-instructions strong {
93
+ color: #667eea;
94
+ font-weight: 600;
95
+ }
96
+
97
+ .welcome-instructions ol {
98
+ margin: 10px 0;
99
+ padding-left: 20px;
100
+ }
101
+
102
+ .welcome-instructions li {
103
+ margin: 8px 0;
104
+ color: #555;
105
+ }
106
+
107
+ .welcome-footer {
108
+ border-top: 1px solid #e0e0e0;
109
+ padding-top: 20px;
110
+ display: flex;
111
+ flex-direction: column;
112
+ gap: 15px;
113
+ }
114
+
115
+ .welcome-checkbox {
116
+ display: flex;
117
+ align-items: center;
118
+ cursor: pointer;
119
+ user-select: none;
120
+ }
121
+
122
+ .welcome-checkbox input[type="checkbox"] {
123
+ width: 18px;
124
+ height: 18px;
125
+ margin-right: 8px;
126
+ cursor: pointer;
127
+ }
128
+
129
+ .welcome-checkbox span {
130
+ font-size: 14px;
131
+ color: #666;
132
+ }
133
+
134
+ .app {
135
+ width: 100%;
136
+ height: 100vh;
137
+ height: -webkit-fill-available;
138
+ display: flex;
139
+ flex-direction: column;
140
+ overflow: hidden;
141
+ }
142
+
143
+ /* Scrollable Content */
144
+ .scroll-content {
145
+ flex: 1;
146
+ overflow-y: auto;
147
+ overflow-x: hidden;
148
+ -webkit-overflow-scrolling: touch;
149
+ padding: 20px;
150
+ padding-top: max(20px, env(safe-area-inset-top));
151
+ padding-bottom: 60px;
152
+ }
153
+
154
+ /* Device Status */
155
+ .status-indicator {
156
+ position: sticky;
157
+ top: 0;
158
+ z-index: 100;
159
+ background-color: #f5f5f5;
160
+ padding: 15px 0;
161
+ margin-bottom: 10px;
162
+ text-align: center;
163
+ }
164
+
165
+ .status {
166
+ padding: 12px 24px;
167
+ border-radius: 25px;
168
+ font-size: 15px;
169
+ font-weight: 600;
170
+ display: none;
171
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
172
+ }
173
+
174
+ .status.listening {
175
+ background-color: #ff9800;
176
+ color: white;
177
+ display: block;
178
+ animation: pulse 1.5s ease-in-out infinite;
179
+ }
180
+
181
+ .status.ready {
182
+ background-color: #4caf50;
183
+ color: white;
184
+ animation: pulse-green 2s ease-in-out infinite;
185
+ }
186
+
187
+ #deviceready.ready .status.listening {
188
+ display: none;
189
+ }
190
+
191
+ #deviceready.ready .status.ready {
192
+ display: block;
193
+ }
194
+
195
+ @keyframes pulse {
196
+ 0%, 100% {
197
+ opacity: 1;
198
+ transform: scale(1);
199
+ }
200
+ 50% {
201
+ opacity: 0.7;
202
+ transform: scale(0.98);
203
+ }
204
+ }
205
+
206
+ @keyframes pulse-green {
207
+ 0%, 100% {
208
+ box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
209
+ transform: scale(1);
210
+ }
211
+ 50% {
212
+ box-shadow: 0 4px 20px rgba(76, 175, 80, 0.8);
213
+ transform: scale(1.02);
214
+ }
215
+ }
216
+
217
+ /* Section Styling */
218
+ .section {
219
+ background: white;
220
+ border-radius: 12px;
221
+ padding: 20px;
222
+ margin-bottom: 20px;
223
+ box-shadow: 0 2px 8px rgba(0,0,0,0.08);
224
+ }
225
+
226
+ .section h2 {
227
+ margin: 0 0 15px 0;
228
+ font-size: 18px;
229
+ font-weight: 600;
230
+ color: #667eea;
231
+ }
232
+
233
+ /* Form Elements */
234
+ .form-group {
235
+ margin-bottom: 15px;
236
+ }
237
+
238
+ .form-group label {
239
+ display: block;
240
+ margin-bottom: 8px;
241
+ font-size: 14px;
242
+ font-weight: 500;
243
+ color: #555;
244
+ }
245
+
246
+ .form-group input[type="text"],
247
+ .form-group select {
248
+ width: 100%;
249
+ padding: 12px;
250
+ border: 1px solid #ddd;
251
+ border-radius: 8px;
252
+ font-size: 16px;
253
+ background-color: #f9f9f9;
254
+ transition: border-color 0.2s;
255
+ }
256
+
257
+ .form-group input[type="text"]:focus,
258
+ .form-group select:focus {
259
+ outline: none;
260
+ border-color: #667eea;
261
+ background-color: white;
262
+ }
263
+
264
+ .checkbox-label {
265
+ display: flex;
266
+ align-items: center;
267
+ cursor: pointer;
268
+ user-select: none;
269
+ }
270
+
271
+ .checkbox-label input[type="checkbox"] {
272
+ width: 20px;
273
+ height: 20px;
274
+ margin-right: 10px;
275
+ cursor: pointer;
276
+ }
277
+
278
+ .checkbox-label span {
279
+ font-size: 16px;
280
+ color: #333;
281
+ }
282
+
283
+ /* Buttons */
284
+ .btn {
285
+ width: 100%;
286
+ padding: 14px 20px;
287
+ border: none;
288
+ border-radius: 8px;
289
+ font-size: 16px;
290
+ font-weight: 600;
291
+ cursor: pointer;
292
+ transition: all 0.3s;
293
+ margin-bottom: 10px;
294
+ text-transform: none;
295
+ -webkit-user-select: none;
296
+ user-select: none;
297
+ touch-action: manipulation;
298
+ pointer-events: auto;
299
+ position: relative;
300
+ z-index: 10;
301
+ }
302
+
303
+ .btn:last-child {
304
+ margin-bottom: 0;
305
+ }
306
+
307
+ .btn:active {
308
+ transform: scale(0.98);
309
+ }
310
+
311
+ .btn-primary {
312
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
313
+ color: white;
314
+ box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
315
+ }
316
+
317
+ .btn-primary:active {
318
+ box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
319
+ }
320
+
321
+ .btn-secondary {
322
+ background-color: #6c757d;
323
+ color: white;
324
+ box-shadow: 0 2px 6px rgba(0,0,0,0.15);
325
+ }
326
+
327
+ .btn-secondary:active {
328
+ background-color: #5a6268;
329
+ }
330
+
331
+ .btn-danger {
332
+ background-color: #dc3545;
333
+ color: white;
334
+ box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
335
+ }
336
+
337
+ .btn-danger:active {
338
+ background-color: #c82333;
339
+ box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
340
+ }
341
+
342
+ .btn-small {
343
+ padding: 8px 16px;
344
+ font-size: 14px;
345
+ width: auto;
346
+ float: right;
347
+ margin-bottom: 10px;
348
+ }
349
+
350
+ /* Status Text */
351
+ .status-text {
352
+ margin-top: 10px;
353
+ padding: 10px;
354
+ border-radius: 6px;
355
+ font-size: 14px;
356
+ background-color: #f0f0f0;
357
+ color: #333;
358
+ min-height: 20px;
359
+ }
360
+
361
+ .status-text:empty {
362
+ display: none;
363
+ }
364
+
365
+ /* Event Log */
366
+ .event-log {
367
+ clear: both;
368
+ background-color: #1e1e1e;
369
+ color: #d4d4d4;
370
+ border-radius: 8px;
371
+ padding: 15px;
372
+ font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
373
+ font-size: 13px;
374
+ line-height: 1.6;
375
+ max-height: 400px;
376
+ overflow-y: auto;
377
+ overflow-x: hidden;
378
+ word-wrap: break-word;
379
+ min-height: 100px;
380
+ }
381
+
382
+ .event-log:empty::before {
383
+ content: 'No events yet...';
384
+ color: #808080;
385
+ font-style: italic;
386
+ }
387
+
388
+ .log-entry {
389
+ margin-bottom: 8px;
390
+ padding: 6px 10px;
391
+ border-left: 3px solid #667eea;
392
+ background-color: rgba(102, 126, 234, 0.1);
393
+ border-radius: 4px;
394
+ }
395
+
396
+ .log-entry .timestamp {
397
+ color: #858585;
398
+ font-size: 11px;
399
+ margin-right: 8px;
400
+ }
401
+
402
+ .log-entry .event-name {
403
+ color: #4ec9b0;
404
+ font-weight: 600;
405
+ }
406
+
407
+ .log-entry .event-data {
408
+ color: #ce9178;
409
+ margin-left: 10px;
410
+ }
411
+
412
+ /* Dark mode support */
413
+ @media screen and (prefers-color-scheme: dark) {
414
+ body {
415
+ background-color: #1a1a1a;
416
+ color: #e0e0e0;
417
+ }
418
+
419
+ .welcome-content {
420
+ background: #2a2a2a;
421
+ color: #e0e0e0;
422
+ }
423
+
424
+ .welcome-content h2 {
425
+ color: #8b9bea;
426
+ }
427
+
428
+ .welcome-instructions li {
429
+ color: #b0b0b0;
430
+ }
431
+
432
+ .welcome-instructions strong {
433
+ color: #8b9bea;
434
+ }
435
+
436
+ .welcome-footer {
437
+ border-top-color: #404040;
438
+ }
439
+
440
+ .welcome-checkbox span {
441
+ color: #b0b0b0;
442
+ }
443
+
444
+ .status-indicator {
445
+ background-color: #1a1a1a;
446
+ }
447
+
448
+ .section {
449
+ background: #2a2a2a;
450
+ box-shadow: 0 2px 8px rgba(0,0,0,0.3);
451
+ }
452
+
453
+ .section h2 {
454
+ color: #8b9bea;
455
+ }
456
+
457
+ .form-group label {
458
+ color: #b0b0b0;
459
+ }
460
+
461
+ .form-group input[type="text"],
462
+ .form-group select {
463
+ background-color: #1e1e1e;
464
+ border-color: #3a3a3a;
465
+ color: #e0e0e0;
466
+ }
467
+
468
+ .form-group input[type="text"]:focus,
469
+ .form-group select:focus {
470
+ background-color: #2a2a2a;
471
+ border-color: #667eea;
472
+ }
473
+
474
+ .checkbox-label span {
475
+ color: #e0e0e0;
476
+ }
477
+
478
+ .status-text {
479
+ background-color: #1e1e1e;
480
+ color: #e0e0e0;
481
+ }
482
+
483
+ .scroll-content {
484
+ background-color: #1a1a1a;
485
+ }
486
+
487
+ .call-modal-content {
488
+ background-color: #2a2a2a;
489
+ border: 1px solid #444;
490
+ }
491
+
492
+ .call-modal-subtitle {
493
+ color: #b0b0b0;
494
+ }
495
+
496
+ .call-detail-label {
497
+ color: #888;
498
+ }
499
+
500
+ .call-detail-value {
501
+ color: #e0e0e0;
502
+ }
503
+
504
+ .call-details {
505
+ background-color: #1e1e1e;
506
+ border: 1px solid #444;
507
+ }
508
+ }
509
+
510
+ /* Call Cancelled Modal */
511
+ .call-modal {
512
+ position: fixed;
513
+ top: 0;
514
+ left: 0;
515
+ width: 100%;
516
+ height: 100%;
517
+ background-color: rgba(0, 0, 0, 0.7);
518
+ display: flex;
519
+ align-items: center;
520
+ justify-content: center;
521
+ z-index: 2000;
522
+ opacity: 1;
523
+ transition: opacity 0.3s ease;
524
+ }
525
+
526
+ .call-modal.hidden {
527
+ display: none;
528
+ opacity: 0;
529
+ }
530
+
531
+ .call-modal-content {
532
+ background-color: #ffffff;
533
+ border-radius: 16px;
534
+ padding: 32px 24px;
535
+ max-width: 400px;
536
+ width: 90%;
537
+ text-align: center;
538
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
539
+ animation: slideUp 0.3s ease;
540
+ }
541
+
542
+ @keyframes slideUp {
543
+ from {
544
+ transform: translateY(50px);
545
+ opacity: 0;
546
+ }
547
+ to {
548
+ transform: translateY(0);
549
+ opacity: 1;
550
+ }
551
+ }
552
+
553
+ .call-modal-icon {
554
+ font-size: 64px;
555
+ margin-bottom: 16px;
556
+ line-height: 1;
557
+ }
558
+
559
+ .call-modal-content h2 {
560
+ font-size: 24px;
561
+ margin: 0 0 8px 0;
562
+ color: #333;
563
+ }
564
+
565
+ .call-modal-subtitle {
566
+ font-size: 16px;
567
+ color: #666;
568
+ margin: 0 0 24px 0;
569
+ }
570
+
571
+ .call-details {
572
+ background-color: #f8f8f8;
573
+ border-radius: 12px;
574
+ padding: 16px;
575
+ margin-bottom: 24px;
576
+ text-align: left;
577
+ border: 1px solid #e0e0e0;
578
+ }
579
+
580
+ .call-detail-item {
581
+ display: flex;
582
+ justify-content: space-between;
583
+ align-items: center;
584
+ padding: 12px 0;
585
+ border-bottom: 1px solid #e8e8e8;
586
+ }
587
+
588
+ .call-detail-item:last-child {
589
+ border-bottom: none;
590
+ }
591
+
592
+ .call-detail-label {
593
+ font-size: 14px;
594
+ color: #666;
595
+ font-weight: 500;
596
+ }
597
+
598
+ .call-detail-value {
599
+ font-size: 14px;
600
+ color: #333;
601
+ font-weight: 600;
602
+ max-width: 60%;
603
+ text-align: right;
604
+ word-break: break-all;
605
+ }