pushwoosh-cordova-plugin 6.1.0 → 6.1.1

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 (79) hide show
  1. package/{MIT-LICENSE.txt → LICENSE.md} +0 -0
  2. package/README.md +20 -32
  3. package/README_PGB.md +32 -0
  4. package/package.json +1 -1
  5. package/package_pgb.json +29 -0
  6. package/plugin.xml +71 -85
  7. package/src/android/src/com/pushwoosh/plugin/internal/PhonegapPluginProvider.java +22 -0
  8. package/src/android/src/com/pushwoosh/plugin/pushnotifications/CustomFirebaseMessagingService.java +29 -0
  9. package/src/android/src/com/pushwoosh/plugin/pushnotifications/InboxUiStyleManager.java +136 -0
  10. package/src/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java +339 -388
  11. package/src/android/src/com/pushwoosh/plugin/pushnotifications/PushwooshNotificationServiceExtension.java +38 -0
  12. package/src/ios/PWBackward.h +25 -0
  13. package/src/ios/PWBackward.m +53 -0
  14. package/src/ios/PushNotification.m +409 -158
  15. package/src/ios/Pushwoosh.framework/Modules/module.modulemap +6 -0
  16. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWAppDelegate.h +20 -0
  17. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWGDPRManager.h +46 -0
  18. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWInAppManager.h +174 -0
  19. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWInbox.h +147 -0
  20. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWInlineInAppView.h +26 -0
  21. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWLog.h +23 -0
  22. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWMessaging.h +20 -0
  23. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWNotificationExtensionManager.h +33 -0
  24. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWRichMediaManager.h +118 -0
  25. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWRichMediaStyle.h +122 -0
  26. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PushNotificationManager.h +263 -151
  27. package/src/ios/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h +525 -0
  28. package/src/ios/Pushwoosh.framework/Versions/A/libPushwoosh.a +0 -0
  29. package/src/ios/PushwooshInboxBundle.bundle/Info.plist +0 -0
  30. package/src/ios/PushwooshInboxBundle.bundle/PWIInboxAttachmentViewController.nib +0 -0
  31. package/src/ios/PushwooshInboxBundle.bundle/PWIInboxMessageViewCell.nib +0 -0
  32. package/src/ios/PushwooshInboxBundle.bundle/PWIInboxViewController.nib +0 -0
  33. package/src/ios/PushwooshInboxBundle.bundle/errorMessage@2x.png +0 -0
  34. package/src/ios/PushwooshInboxBundle.bundle/inbox_icon.png +0 -0
  35. package/src/ios/PushwooshInboxBundle.bundle/noMessage@2x.png +0 -0
  36. package/src/ios/PushwooshInboxBundle.bundle/unread.png +0 -0
  37. package/src/ios/PushwooshInboxUI.framework/Modules/module.modulemap +6 -0
  38. package/src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxStyle.h +122 -0
  39. package/src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxUI.h +39 -0
  40. package/src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PushwooshInboxUI.h +19 -0
  41. package/src/ios/PushwooshInboxUI.framework/Versions/A/libPushwooshInboxUI.a +0 -0
  42. package/src/windows/PushSDK/Newtonsoft.Json.dll +0 -0
  43. package/src/windows/PushSDK/PushSDK.winmd +0 -0
  44. package/src/windows/PushwooshPluginProxy.js +88 -74
  45. package/src/wp8/PushNotification.cs +14 -0
  46. package/src/wp8/PushSDK/PushSDK.dll +0 -0
  47. package/www/PushNotification.js +171 -45
  48. package/Documentation/files/PushNotification-js.html +0 -157
  49. package/Documentation/index/Classes.html +0 -33
  50. package/Documentation/index/Functions.html +0 -61
  51. package/Documentation/index/General.html +0 -65
  52. package/Documentation/index.html +0 -1
  53. package/Documentation/javascript/main.js +0 -841
  54. package/Documentation/javascript/prettify.js +0 -1526
  55. package/Documentation/javascript/searchdata.js +0 -92
  56. package/Documentation/search/ClassesP.html +0 -20
  57. package/Documentation/search/FunctionsA.html +0 -20
  58. package/Documentation/search/FunctionsC.html +0 -20
  59. package/Documentation/search/FunctionsG.html +0 -20
  60. package/Documentation/search/FunctionsO.html +0 -20
  61. package/Documentation/search/FunctionsP.html +0 -20
  62. package/Documentation/search/FunctionsR.html +0 -20
  63. package/Documentation/search/FunctionsS.html +0 -20
  64. package/Documentation/search/FunctionsU.html +0 -20
  65. package/Documentation/search/GeneralA.html +0 -20
  66. package/Documentation/search/GeneralC.html +0 -20
  67. package/Documentation/search/GeneralF.html +0 -20
  68. package/Documentation/search/GeneralG.html +0 -20
  69. package/Documentation/search/GeneralO.html +0 -20
  70. package/Documentation/search/GeneralP.html +0 -20
  71. package/Documentation/search/GeneralR.html +0 -20
  72. package/Documentation/search/GeneralS.html +0 -20
  73. package/Documentation/search/GeneralU.html +0 -20
  74. package/Documentation/search/NoResults.html +0 -15
  75. package/Documentation/styles/main.css +0 -828
  76. package/VERSION.md +0 -138
  77. package/push.gradle +0 -21
  78. package/src/android/src/com/pushwoosh/plugin/pushnotifications/NotificationFactory.java +0 -29
  79. package/src/ios/Pushwoosh.framework/Versions/A/Pushwoosh +0 -0
File without changes
package/README.md CHANGED
@@ -1,58 +1,46 @@
1
1
  Cordova Pushwoosh Push Notifications plugin
2
2
  ===================================================
3
3
 
4
+ [![GitHub release](https://img.shields.io/github/release/Pushwoosh/pushwoosh-phonegap-plugin.svg?style=flat-square)](https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/releases)
5
+ [![npm](https://img.shields.io/npm/v/pushwoosh-cordova-plugin.svg)](https://www.npmjs.com/package/pushwoosh-cordova-plugin)
6
+ [![license](https://img.shields.io/npm/l/pushwoosh-cordova-plugin.svg)](https://www.npmjs.com/package/pushwoosh-cordova-plugin)
7
+
8
+ ![platforms](https://img.shields.io/badge/platforms-android%20%7C%20ios%20%7C%20wp8%20%7C%20windows%20-yellowgreen.svg)
9
+
4
10
  Cross-Platform push notifications by Pushwoosh for Cordova / PhoneGap
5
11
 
6
- ### Installation
12
+ #### Cordova
7
13
 
8
- Using npm (requires cordova 5.0+):
14
+ Using npm (requires cordova 7.0+):
9
15
 
10
16
  ```
11
- cordova plugin add pushwoosh-cordova-plugin@6.1.0
17
+ cordova plugin add pushwoosh-cordova-plugin@6.1.1
12
18
  ```
13
19
 
14
20
  Using git:
15
21
 
16
22
  ```
17
- cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#6.1.0
23
+ cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#6.1.1
24
+ ```
25
+
26
+ #### Phonegap
27
+
28
+ Using npm (requires phonegap 7.1+):
29
+
30
+ ```
31
+ cordova plugin add pushwoosh-cordova-plugin@6.1.1
18
32
  ```
19
33
 
20
34
  ### Guide
21
35
 
22
- http://docs.pushwoosh.com/docs/cordova-phonegap
36
+ https://www.pushwoosh.com/platform-docs/pushwoosh-sdk/cross-platform-frameworks/cordova/integrating-cordova-plugin
23
37
 
24
38
  ### Documentation
25
39
 
26
- https://rawgit.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin/master/Documentation/files/PushNotification-js.html
40
+ https://www.pushwoosh.com/platform-docs/pushwoosh-sdk/cross-platform-frameworks/cordova/cordova-plugin-api-reference
27
41
 
28
42
  ### Acknowledgments
29
43
  Plugman support by Platogo
30
44
 
31
45
  HUGE thanks to Eddy Verbruggen for all the help with WP8 Phonegap support!!!
32
46
  https://github.com/EddyVerbruggen
33
-
34
-
35
- ## LICENSE
36
-
37
- The MIT License
38
-
39
- Copyright (c) 2014 Pushwoosh.
40
- http://www.pushwoosh.com
41
-
42
- Permission is hereby granted, free of charge, to any person obtaining a copy
43
- of this software and associated documentation files (the "Software"), to deal
44
- in the Software without restriction, including without limitation the rights
45
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
46
- copies of the Software, and to permit persons to whom the Software is
47
- furnished to do so, subject to the following conditions:
48
-
49
- The above copyright notice and this permission notice shall be included in
50
- all copies or substantial portions of the Software.
51
-
52
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
54
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
55
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
56
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
57
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
58
- THE SOFTWARE.
package/README_PGB.md ADDED
@@ -0,0 +1,32 @@
1
+ Phonegap Pushwoosh Push Notifications plugin
2
+ ===================================================
3
+
4
+ [![GitHub release](https://img.shields.io/github/release/Pushwoosh/pushwoosh-phonegap-plugin.svg?style=flat-square)](https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/releases)
5
+ [![npm](https://img.shields.io/npm/v/pushwoosh-pgb-plugin.svg)](https://www.npmjs.com/package/pushwoosh-pgb-plugin)
6
+ [![license](https://img.shields.io/npm/l/pushwoosh-pgb-plugin.svg)](https://www.npmjs.com/package/pushwoosh-pgb-plugin)
7
+
8
+ ![platforms](https://img.shields.io/badge/platforms-android%20%7C%20ios%20%7C%20wp8%20%7C%20windows%20-yellowgreen.svg)
9
+
10
+ Cross-Platform push notifications by Pushwoosh for PhoneGap
11
+
12
+ ### Installation
13
+
14
+ Using npm (requires cordova 5.0+):
15
+
16
+ ```
17
+ cordova plugin add pushwoosh-pgb-plugin@6.1.1
18
+ ```
19
+
20
+ ### Guide
21
+
22
+ http://docs.pushwoosh.com/docs/phonegap-build
23
+
24
+ ### Documentation
25
+
26
+ http://docs.pushwoosh.com/docs/cordova-api-reference
27
+
28
+ ### Acknowledgments
29
+ Plugman support by Platogo
30
+
31
+ HUGE thanks to Eddy Verbruggen for all the help with WP8 Phonegap support!!!
32
+ https://github.com/EddyVerbruggen
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushwoosh-cordova-plugin",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "\n This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).\n ",
5
5
  "cordova": {
6
6
  "id": "pushwoosh-cordova-plugin",
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "pushwoosh-pgb-plugin",
3
+ "version": "7.0.11",
4
+ "description": "\n This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).\n ",
5
+ "cordova": {
6
+ "id": "pushwoosh-pgb-plugin",
7
+ "platforms": [
8
+ "android",
9
+ "ios",
10
+ "wp8"
11
+ ]
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin.git"
16
+ },
17
+ "keywords": [
18
+ "ecosystem:cordova",
19
+ "cordova-android",
20
+ "cordova-ios",
21
+ "cordova-wp8"
22
+ ],
23
+ "author": "Pushwoosh",
24
+ "license": "MIT",
25
+ "bugs": {
26
+ "url": "https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin/issues"
27
+ },
28
+ "homepage": "https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin#readme"
29
+ }
package/plugin.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="pushwoosh-cordova-plugin" version="6.1.0">
3
-
2
+ <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="pushwoosh-cordova-plugin" version="6.1.1">
3
+
4
4
  <name>Pushwoosh</name>
5
5
 
6
6
  <description>
@@ -12,7 +12,7 @@
12
12
  </engines> -->
13
13
 
14
14
  <license>MIT</license>
15
-
15
+
16
16
  <repo>https://github.com/Pushwoosh/pushwoosh-phonegap-plugin</repo>
17
17
  <issue>https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/issues</issue>
18
18
 
@@ -21,78 +21,29 @@
21
21
  <preference name="ANDROID_FOREGROUND_PUSH" default="false" />
22
22
 
23
23
  <js-module src="www/PushNotification.js" name="PushNotification">
24
- <clobbers target="plugins.pushNotification" />
24
+ <clobbers target="plugins.pushNotification" />
25
25
  </js-module>
26
26
 
27
- <!-- android -->
27
+ <!-- android -->
28
28
  <platform name="android">
29
- <config-file>
30
- <access origin="*.pushwoosh.com" />
31
- </config-file>
32
-
33
- <config-file target="AndroidManifest.xml" parent="/manifest">
34
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
35
-
36
- <uses-permission android:name="android.permission.VIBRATE" />
37
-
38
- <!-- GCM connects to Google Services. -->
39
- <uses-permission android:name="android.permission.INTERNET"/>
40
-
41
- <!-- Keeps the processor from sleeping when a message is received. -->
42
- <uses-permission android:name="android.permission.WAKE_LOCK"/>
43
-
44
- <!-- So the sounds from assets folder could work for notification sounds. -->
45
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
46
-
47
- <!-- For local pushes rescheduling and location service restart -->
48
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
49
-
50
- <!--
51
- Creates a custom permission so only this app can receive its messages.
52
-
53
- NOTE: the permission *must* be called PACKAGE.permission.C2D_MESSAGE,
54
- where PACKAGE is the application's package name.
55
- -->
56
- <permission
57
- android:name="$PACKAGE_NAME.permission.C2D_MESSAGE"
58
- android:protectionLevel="signature"/>
59
- <uses-permission android:name="$PACKAGE_NAME.permission.C2D_MESSAGE"/>
60
-
61
- <!-- This app has permission to register and receive data message. -->
62
- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
63
-
64
- <!-- <badges> -->
65
- <!--for Samsung-->
66
- <uses-permission android:name="com.sec.android.provider.badge.permission.READ"/>
67
- <uses-permission android:name="com.sec.android.provider.badge.permission.WRITE"/>
68
-
69
- <!--for htc-->
70
- <uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
71
- <uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT"/>
72
-
73
- <!--for sony-->
74
- <uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE"/>
75
-
76
- <!--for apex-->
77
- <uses-permission android:name="com.anddoes.launcher.permission.UPDATE_COUNT"/>
78
-
79
- <!--for solid-->
80
- <uses-permission android:name="com.majeur.launcher.permission.UPDATE_BADGE"/>
81
- <!-- </badges> -->
82
- </config-file>
29
+ <config-file target="config.xml" parent="/*">
30
+ <preference name="GradlePluginGoogleServicesEnabled" value="true" />
31
+ <preference name="GradlePluginGoogleServicesVersion" value="4.3.10" />
32
+ </config-file>
83
33
 
84
34
  <config-file target="AndroidManifest.xml" parent="/manifest/application">
85
- <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
86
- <meta-data android:name="PW_LOG_LEVEL" android:value="$LOG_LEVEL" />
87
- <meta-data android:name="PW_NO_BROADCAST_PUSH" android:value="$ANDROID_FOREGROUND_PUSH" />
88
-
89
- <receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
90
- <intent-filter>
91
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
92
- <category android:name="$PACKAGE_NAME" />
93
- </intent-filter>
94
- </receiver>
95
-
35
+ <meta-data android:name="com.pushwoosh.log_level" android:value="$LOG_LEVEL" />
36
+ <meta-data android:name="com.pushwoosh.foreground_push" android:value="$ANDROID_FOREGROUND_PUSH" />
37
+
38
+ <meta-data android:name="com.pushwoosh.notification_service_extension" android:value="com.pushwoosh.plugin.pushnotifications.PushwooshNotificationServiceExtension" />
39
+
40
+ <meta-data android:name="com.pushwoosh.internal.plugin_provider" android:value="com.pushwoosh.plugin.internal.PhonegapPluginProvider" />
41
+
42
+ <!-- <service android:name="com.pushwoosh.plugin.pushnotifications.CustomFirebaseMessagingService" android:exported="false">-->
43
+ <!-- <intent-filter>-->
44
+ <!-- <action android:name="com.google.firebase.MESSAGING_EVENT"/>-->
45
+ <!-- </intent-filter>-->
46
+ <!-- </service>-->
96
47
  </config-file>
97
48
 
98
49
  <config-file target="res/xml/config.xml" parent="/*">
@@ -102,16 +53,37 @@
102
53
  </config-file>
103
54
 
104
55
  <source-file src="src/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java"
105
- target-dir="src/com/pushwoosh/plugin/pushnotifications" />
106
-
107
- <source-file src="src/android/src/com/pushwoosh/plugin/pushnotifications/NotificationFactory.java"
108
- target-dir="src/com/pushwoosh/plugin/pushnotifications" />
109
-
110
- <framework src="com.google.android.gms:play-services-gcm:+" />
111
- <framework src="com.google.android.gms:play-services-location:+" />
112
- <framework src="com.android.support:support-v4:+" />
113
- <framework src="com.pushwoosh:pushwoosh:4.6.3" />
114
- <framework src="push.gradle" custom="true" type="gradleReference" />
56
+ target-dir="src/com/pushwoosh/plugin/pushnotifications" />
57
+
58
+ <source-file src="src/android/src/com/pushwoosh/plugin/pushnotifications/InboxUiStyleManager.java"
59
+ target-dir="src/com/pushwoosh/plugin/pushnotifications" />
60
+
61
+ <source-file src="src/android/src/com/pushwoosh/plugin/pushnotifications/PushwooshNotificationServiceExtension.java"
62
+ target-dir="src/com/pushwoosh/plugin/pushnotifications" />
63
+
64
+ <source-file src="src/android/src/com/pushwoosh/plugin/pushnotifications/CustomFirebaseMessagingService.java"
65
+ target-dir="src/com/pushwoosh/plugin/pushnotifications"/>
66
+
67
+ <source-file src="src/android/src/com/pushwoosh/plugin/internal/PhonegapPluginProvider.java"
68
+ target-dir="src/com/pushwoosh/plugin/internal" />
69
+
70
+ <framework src="com.google.firebase:firebase-core:(+,19.0.99]" />
71
+ <framework src="com.google.firebase:firebase-messaging:(+,22.0.99]" />
72
+
73
+ <framework src="com.android.support:support-v4:27.+" />
74
+ <framework src="com.android.support:appcompat-v7:27.+" />
75
+ <framework src="com.android.support:recyclerview-v7:27.+" />
76
+ <framework src="com.android.support:design:27.+" />
77
+ <framework src="com.android.support.constraint:constraint-layout:1.0.2" />
78
+ <framework src="com.github.bumptech.glide:glide:4.7.1" />
79
+ <framework src="org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60" />
80
+ <framework src="com.pushwoosh:pushwoosh:6.4.4"/>
81
+ <framework src="com.pushwoosh:pushwoosh-amazon:6.4.4"/>
82
+ <framework src="com.pushwoosh:pushwoosh-firebase:6.4.4"/>
83
+ <framework src="com.pushwoosh:pushwoosh-badge:6.4.4"/>
84
+ <framework src="com.pushwoosh:pushwoosh-inbox:6.4.4"/>
85
+ <framework src="com.pushwoosh:pushwoosh-inbox-ui:6.4.4"/>
86
+ <framework src="com.pushwoosh:pushwoosh-huawei:6.4.4"/>
115
87
  </platform>
116
88
 
117
89
  <!-- ios -->
@@ -127,10 +99,6 @@
127
99
  </feature>
128
100
  </config-file>
129
101
 
130
- <config-file>
131
- <access origin="*.pushwoosh.com" />
132
- </config-file>
133
-
134
102
  <config-file target="*-Info.plist" parent="Pushwoosh_LOG_LEVEL">
135
103
  <string>$LOG_LEVEL</string>
136
104
  </config-file>
@@ -139,11 +107,29 @@
139
107
  <string>$IOS_FOREGROUND_ALERT_TYPE</string>
140
108
  </config-file>
141
109
 
110
+ <config-file parent="aps-environment" target="*/Entitlements-Debug.plist">
111
+ <string>development</string>
112
+ </config-file>
113
+ <config-file parent="aps-environment" target="*/Entitlements-Release.plist">
114
+ <string>production</string>
115
+ </config-file>
116
+
142
117
  <header-file src="src/ios/PushNotification.h" target-dir="ios"/>
143
118
  <source-file src="src/ios/PushNotification.m" target-dir="ios"/>
119
+ <header-file src="src/ios/PWBackward.h" target-dir="ios"/>
120
+ <source-file src="src/ios/PWBackward.m" target-dir="ios"/>
144
121
  <header-file src="src/ios/Pushwoosh.framework/Versions/A/Headers/PushNotificationManager.h" target-dir="ios"/>
122
+ <header-file src="src/ios/Pushwoosh.framework/Versions/A/Headers/PWInAppManager.h" target-dir="ios"/>
123
+ <header-file src="src/ios/Pushwoosh.framework/Versions/A/Headers/PWGDPRManager.h" target-dir="ios"/>
145
124
  <header-file src="src/ios/PWLog.h" target-dir="ios"/>
146
- <source-file src="src/ios/Pushwoosh.framework/Versions/A/Pushwoosh" framework="true"/>
125
+ <header-file src="src/ios/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h" target-dir="ios"/>
126
+ <header-file src="src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PushwooshInboxUI.h" target-dir="ios"/>
127
+ <header-file src="src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxStyle.h" target-dir="ios"/>
128
+ <header-file src="src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxUI.h" target-dir="ios"/>
129
+
130
+ <source-file src="src/ios/Pushwoosh.framework/Versions/A/libPushwoosh.a" framework="true"/>
131
+ <source-file src="src/ios/PushwooshInboxUI.framework/Versions/A/libPushwooshInboxUI.a" framework="true"/>
132
+ <resource-file src="src/ios/PushwooshInboxBundle.bundle" />
147
133
  </platform>
148
134
 
149
135
  <!-- wp8 -->
@@ -0,0 +1,22 @@
1
+ package com.pushwoosh.plugin.internal;
2
+
3
+ import com.pushwoosh.internal.PluginProvider;
4
+
5
+ public class PhonegapPluginProvider implements PluginProvider {
6
+ @Override
7
+ public String getPluginType() {
8
+ try {
9
+ //If contains class Cordova than it's cordova plugin
10
+ Class.forName("org.apache.cordova.CordovaPlugin");
11
+ return "Cordova";
12
+ } catch (ClassNotFoundException ignore) {
13
+ //Otherwise this is PhoneGap build
14
+ return "PhoneGap Build";
15
+ }
16
+ }
17
+
18
+ @Override
19
+ public int richMediaStartDelay() {
20
+ return DEFAULT_RICH_MEDIA_START_DELAY;
21
+ }
22
+ }
@@ -0,0 +1,29 @@
1
+ package com.pushwoosh.plugin.pushnotifications;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.google.firebase.messaging.FirebaseMessagingService;
6
+ import com.google.firebase.messaging.RemoteMessage;
7
+ import com.pushwoosh.firebase.PushwooshFcmHelper;
8
+
9
+ public class CustomFirebaseMessagingService extends FirebaseMessagingService {
10
+ @Override
11
+ public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
12
+ if (PushwooshFcmHelper.isPushwooshMessage(remoteMessage)){
13
+ PushwooshFcmHelper.onMessageReceived(this, remoteMessage);
14
+ } else {
15
+ //handle push from a different service here
16
+ }
17
+ }
18
+
19
+ @Override
20
+ public void onNewToken(@NonNull String s) {
21
+ super.onNewToken(s);
22
+ PushwooshFcmHelper.onTokenRefresh(s);
23
+ sendTokenToAnotherService();
24
+ }
25
+
26
+ public void sendTokenToAnotherService() {
27
+ //handle push registration of another service here
28
+ }
29
+ }
@@ -0,0 +1,136 @@
1
+ package com.pushwoosh.plugin.pushnotifications;
2
+
3
+ import android.content.Context;
4
+ import android.content.res.AssetManager;
5
+ import android.graphics.Bitmap;
6
+ import android.graphics.BitmapFactory;
7
+ import android.graphics.Color;
8
+ import android.graphics.drawable.BitmapDrawable;
9
+ import android.graphics.drawable.Drawable;
10
+ import androidx.annotation.Nullable;
11
+
12
+ import com.pushwoosh.inbox.ui.PushwooshInboxStyle;
13
+ import com.pushwoosh.inbox.ui.model.customizing.formatter.InboxDateFormatter;
14
+
15
+ import org.json.JSONObject;
16
+
17
+ import java.io.IOException;
18
+ import java.text.SimpleDateFormat;
19
+ import java.util.Date;
20
+ import java.util.Locale;
21
+
22
+ class InboxUiStyleManager {
23
+
24
+ private static class StyleParser {
25
+ private JSONObject style;
26
+ private Context context;
27
+
28
+ private static Integer parseColor(String colorString) {
29
+ if (colorString == null || colorString.length() == 0) {
30
+ return null;
31
+ }
32
+
33
+ if (!colorString.matches("^(#[0-9A-Fa-f]{3}|(0x|#)([0-9A-Fa-f]{2})?[0-9A-Fa-f]{6})$")) {
34
+ return null;
35
+ }
36
+
37
+ // #FAB to #FFAABB
38
+ if (colorString.startsWith("#") && colorString.length() == 4) {
39
+ String r = colorString.substring(1, 2);
40
+ String g = colorString.substring(2, 3);
41
+ String b = colorString.substring(3, 4);
42
+ colorString = "#" + r + r + g + g + b + b;
43
+ }
44
+
45
+ // 0xRRGGBB to #RRGGBB
46
+ colorString = colorString.replace("0x", "#");
47
+
48
+ return Color.parseColor(colorString);
49
+ }
50
+
51
+ private Integer optColor(String key, Integer defaultValue) {
52
+ Integer color = parseColor(style.optString(key));
53
+ if (color == null)
54
+ return defaultValue;
55
+ return color;
56
+ }
57
+
58
+ private InboxDateFormatter optDateFormatter(String key, InboxDateFormatter defaultValue) {
59
+ String dateFormat = style.optString(key);
60
+ if (dateFormat != null && !dateFormat.isEmpty()) {
61
+ final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat, Locale.getDefault());
62
+ return new InboxDateFormatter() {
63
+ @Override
64
+ public String transform(Date date) {
65
+ return simpleDateFormat.format(date);
66
+ }
67
+ };
68
+ }
69
+ return defaultValue;
70
+ }
71
+
72
+ @Nullable
73
+ private Drawable getDrawable(String assetPath) throws IOException {
74
+ if (context != null) {
75
+ AssetManager assetManager = context.getAssets();
76
+ Bitmap bitmap = BitmapFactory.decodeStream(assetManager.open("www/" + assetPath));
77
+ return new BitmapDrawable(context.getResources(), bitmap);
78
+ }
79
+ return null;
80
+ }
81
+
82
+ private Drawable optImage(String key, Drawable defaultValue) {
83
+ String imagePath = style.optString(key);
84
+ if (imagePath != null && imagePath.length() != 0) {
85
+ try {
86
+ return getDrawable(imagePath);
87
+ }
88
+ catch (IOException e) {
89
+ e.printStackTrace();
90
+ }
91
+
92
+ }
93
+ return defaultValue;
94
+ }
95
+
96
+ public StyleParser(Context context, JSONObject styleObject) {
97
+ this.context = context;
98
+ this.style = styleObject;
99
+ }
100
+
101
+ public void parse() {
102
+ PushwooshInboxStyle style = PushwooshInboxStyle.INSTANCE;
103
+
104
+ style.setBarBackgroundColor(optColor("barBackgroundColor", style.getBarBackgroundColor()));
105
+ style.setBarAccentColor(optColor("barAccentColor", style.getBarAccentColor()));
106
+ style.setBarTextColor(optColor("barTextColor", style.getBarTextColor()));
107
+ style.setBarTitle(this.style.optString("barTitle", style.getBarTitle()));
108
+
109
+ style.setDateFormatter(optDateFormatter("dateFormat", style.getDateFormatter()));
110
+
111
+ style.setListErrorMessage(this.style.optString("listErrorMessage", style.getListErrorMessage() != null ? style.getListErrorMessage().toString() : ""));
112
+ style.setListEmptyText(this.style.optString("listEmptyMessage", style.getListEmptyText() != null ? style.getListEmptyText().toString() : ""));
113
+
114
+ style.setDefaultImageIconDrawable(optImage("defaultImageIcon", style.getDefaultImageIconDrawable()));
115
+ style.setListErrorImageDrawable(optImage("listErrorImage", style.getListErrorImageDrawable()));
116
+ style.setListEmptyImageDrawable(optImage("listEmptyImage", style.getListEmptyImageDrawable()));
117
+
118
+ style.setAccentColor(optColor("accentColor", style.getAccentColor()));
119
+ style.setHighlightColor(optColor("highlightColor", style.getHighlightColor()));
120
+ style.setBackgroundColor(optColor("backgroundColor", style.getBackgroundColor()));
121
+ style.setDividerColor(optColor("dividerColor", style.getDividerColor()));
122
+ style.setDateColor(optColor("dateColor", style.getDateColor()));
123
+ style.setReadDateColor(optColor("readDateColor", style.getReadDateColor()));
124
+ style.setTitleColor(optColor("titleColor", style.getTitleColor()));
125
+ style.setReadTitleColor(optColor("readTitleColor", style.getReadTitleColor()));
126
+ style.setDescriptionColor(optColor("descriptionColor", style.getDescriptionColor()));
127
+ style.setReadDescriptionColor(optColor("readDescriptionColor", style.getReadDescriptionColor()));
128
+ }
129
+ }
130
+
131
+ public static void setStyle(Context context, JSONObject styleObject) {
132
+ if (styleObject != null)
133
+ new StyleParser(context, styleObject).parse();
134
+ }
135
+
136
+ }