pushwoosh-cordova-plugin 8.3.57 → 8.3.59

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 CHANGED
@@ -14,13 +14,13 @@ Cross-Platform push notifications by Pushwoosh for Cordova / PhoneGap
14
14
  Using npm:
15
15
 
16
16
  ```
17
- cordova plugin add pushwoosh-cordova-plugin@8.3.57
17
+ cordova plugin add pushwoosh-cordova-plugin@8.3.59
18
18
  ```
19
19
 
20
20
  Using git:
21
21
 
22
22
  ```
23
- cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#8.3.57
23
+ cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#8.3.59
24
24
  ```
25
25
 
26
26
  ### Guide
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushwoosh-cordova-plugin",
3
- "version": "8.3.57",
3
+ "version": "8.3.59",
4
4
  "description": "\n This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).\n ",
5
5
  "main":"www/PushNotification.js",
6
6
  "typings":"types/index.d.ts",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
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="8.3.57">
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="8.3.59">
3
3
 
4
4
  <name>Pushwoosh</name>
5
5
 
@@ -98,13 +98,13 @@
98
98
  <framework src="org.jetbrains.kotlin:kotlin-stdlib:1.1.60" />
99
99
  <framework src="com.google.android.material:material:1.12.0"/>
100
100
 
101
- <framework src="com.pushwoosh:pushwoosh:6.7.49"/>
102
- <framework src="com.pushwoosh:pushwoosh-amazon:6.7.49"/>
103
- <framework src="com.pushwoosh:pushwoosh-firebase:6.7.49"/>
104
- <framework src="com.pushwoosh:pushwoosh-badge:6.7.49"/>
105
- <framework src="com.pushwoosh:pushwoosh-inbox:6.7.49"/>
106
- <framework src="com.pushwoosh:pushwoosh-inbox-ui:6.7.49"/>
107
- <framework src="com.pushwoosh:pushwoosh-huawei:6.7.49"/>
101
+ <framework src="com.pushwoosh:pushwoosh:6.7.54"/>
102
+ <framework src="com.pushwoosh:pushwoosh-amazon:6.7.54"/>
103
+ <framework src="com.pushwoosh:pushwoosh-firebase:6.7.54"/>
104
+ <framework src="com.pushwoosh:pushwoosh-badge:6.7.54"/>
105
+ <framework src="com.pushwoosh:pushwoosh-inbox:6.7.54"/>
106
+ <framework src="com.pushwoosh:pushwoosh-inbox-ui:6.7.54"/>
107
+ <framework src="com.pushwoosh:pushwoosh-huawei:6.7.54"/>
108
108
  </platform>
109
109
 
110
110
  <!-- ios -->
@@ -143,10 +143,10 @@
143
143
 
144
144
  <podspec>
145
145
  <config>
146
- <source url="https://github.com/CocoaPods/Specs.git"/>
146
+ <source url="https://cdn.cocoapods.org/"/>
147
147
  </config>
148
148
  <pods use-frameworks="true">
149
- <pod name="PushwooshXCFramework" spec="7.0.10" />
149
+ <pod name="PushwooshXCFramework" spec="7.0.21" />
150
150
  <pod name="PushwooshInboxUIXCFramework" spec="7.0.3" />
151
151
  </pods>
152
152
  </podspec>
@@ -16,7 +16,7 @@ def callsSrc = pluginDir ? new File(pluginDir, 'src/android/src/com/pushwoosh/pl
16
16
  def applyVoip = {
17
17
  if (voipEnabled) {
18
18
  println "[${pluginId}] PW_VOIP_ANDROID_ENABLED=true — enabling VoIP (dependency + sources)"
19
- dependencies { implementation "com.pushwoosh:pushwoosh-calls:6.7.49" }
19
+ dependencies { implementation "com.pushwoosh:pushwoosh-calls:6.7.54" }
20
20
  if (callsSrc?.exists()) {
21
21
  android.sourceSets.main.java.srcDirs += callsSrc
22
22
  println "[${pluginId}] Added optional sources: ${callsSrc}"
@@ -1088,8 +1088,8 @@ public class PushNotifications extends CordovaPlugin {
1088
1088
  @CordovaMethod
1089
1089
  private boolean setApiToken(JSONArray data, final CallbackContext callbackContext) {
1090
1090
  try {
1091
- String appCode = data.getString(0);
1092
- Pushwoosh.getInstance().addAlternativeAppCode(appCode);
1091
+ String apiToken = data.getString(0);
1092
+ Pushwoosh.getInstance().setApiToken(apiToken);
1093
1093
  } catch (JSONException e) {
1094
1094
  PWLog.error(TAG, "No parameters passed (missing parameters)", e);
1095
1095
  }
@@ -45,6 +45,10 @@ BOOL initSupportsVideo = NO;
45
45
  NSString *ringtoneSound;
46
46
  NSInteger handleType;
47
47
 
48
+ // Early captured launch notification (before SDK initialization)
49
+ static NSDictionary *gEarlyLaunchNotification = nil;
50
+ static BOOL gEarlyLaunchNotificationCaptured = NO;
51
+
48
52
  @interface PWCommonJSBridge: NSObject <PWJavaScriptInterface>
49
53
 
50
54
  @property (nonatomic) CDVPlugin *plugin;
@@ -221,9 +225,20 @@ API_AVAILABLE(ios(10))
221
225
  }
222
226
 
223
227
  _deviceReady = YES;
224
-
225
- if (self.pushwoosh.launchNotification) {
226
- NSDictionary *notification = [self createNotificationDataForPush:self.pushwoosh.launchNotification onStart:YES];
228
+
229
+ // Check early captured launch notification first (captured in +load before SDK init)
230
+ // Then fallback to SDK's launchNotification (in case SDK was initialized early)
231
+ NSDictionary *launchPush = nil;
232
+ if (gEarlyLaunchNotificationCaptured && gEarlyLaunchNotification) {
233
+ launchPush = gEarlyLaunchNotification;
234
+ gEarlyLaunchNotification = nil;
235
+ gEarlyLaunchNotificationCaptured = NO;
236
+ } else if (self.pushwoosh.launchNotification) {
237
+ launchPush = self.pushwoosh.launchNotification;
238
+ }
239
+
240
+ if (launchPush) {
241
+ NSDictionary *notification = [self createNotificationDataForPush:launchPush onStart:YES];
227
242
  [self dispatchPushReceive:notification];
228
243
  [self dispatchPushAccept:notification];
229
244
  }
@@ -1475,6 +1490,26 @@ BOOL pwplugin_didRegisterUserNotificationSettings(id self, SEL _cmd, id applicat
1475
1490
 
1476
1491
  @end
1477
1492
 
1493
+ #pragma mark - Early Launch Notification Capture
1494
+
1495
+ @implementation PushNotification (EarlyLaunchCapture)
1496
+
1497
+ + (void)load {
1498
+ [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidFinishLaunchingNotification
1499
+ object:nil
1500
+ queue:nil
1501
+ usingBlock:^(NSNotification *notification) {
1502
+ NSDictionary *launchOptions = notification.userInfo;
1503
+ NSDictionary *remoteNotification = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];
1504
+ if (remoteNotification) {
1505
+ gEarlyLaunchNotification = [remoteNotification copy];
1506
+ gEarlyLaunchNotificationCaptured = YES;
1507
+ }
1508
+ }];
1509
+ }
1510
+
1511
+ @end
1512
+
1478
1513
  @implementation UIApplication (InternalPushRuntime)
1479
1514
 
1480
1515
  - (BOOL)pushwooshUseRuntimeMagic {
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Pushwoosh
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,156 +0,0 @@
1
- # CORDOVA VOIP SAMPLE
2
-
3
- ## VoIP Demo application showcasing Pushwoosh SDK VoIP functionality with CallKit integration
4
-
5
- ### iOS, Android
6
-
7
- ## Quick Start
8
-
9
- ### 1. Add platforms
10
-
11
- Simply add the required platforms — all dependencies will be installed automatically:
12
-
13
- ```bash
14
- cd demovoip
15
- npm install
16
-
17
- # Add iOS platform
18
- cordova platform add ios
19
-
20
- # Add Android platform
21
- cordova platform add android
22
- ```
23
-
24
- **What happens automatically:**
25
- - `pushwoosh-cordova-plugin` is installed with VoIP enabled for the added platform
26
- - iOS: `PW_VOIP_IOS_ENABLED=true` is set automatically
27
- - Android: `PW_VOIP_ANDROID_ENABLED=true` is set in gradle.properties
28
- - Gradle 8.9 and AGP 8.5.1 are configured for Android
29
- - `google-services.json` is copied for Firebase/FCM
30
-
31
- ### 2. Configure your VoIP App Code
32
-
33
- Open the app and set your VoIP App Code in the UI, or modify the default value in `www/index.html`:
34
-
35
- ```html
36
- <input type="text" id="pushAppId" value="YOUR-APP-ID">
37
- <input type="text" id="pushProjectId" value="YOUR-FCM-PROJECT-ID">
38
- ```
39
-
40
- ### 3. [Android] Configure Firebase
41
-
42
- Place your `google-services.json` in the project root. The file will be automatically copied to `platforms/android/app/` when running `cordova prepare`.
43
-
44
- To work with Firebase/FCM:
45
- 1. Download `google-services.json` from Firebase Console
46
- 2. Place it in `/demovoip/google-services.json`
47
- 3. Run `cordova prepare android`
48
-
49
- ### 4. [iOS] VoIP Push Notifications Setup
50
-
51
- #### a. Enable VoIP Push in your Apple Developer Account
52
- - Navigate to your App ID settings
53
- - Enable "Background Modes" → "Voice over IP"
54
- - Enable "Push Notifications"
55
-
56
- #### b. Configure CallKit in Xcode
57
- Open the Xcode project (`platforms/ios/demovoip.xcworkspace`) and ensure:
58
- - Background Modes → Voice over IP is enabled
59
- - Push Notifications capability is added
60
-
61
- ### 5. Build and Run
62
-
63
- ```bash
64
- # iOS
65
- cordova build ios
66
-
67
- # Android
68
- cordova build android
69
- ```
70
-
71
- ## Features
72
-
73
- - VoIP push notifications support
74
- - CallKit integration (iOS)
75
- - Android calling support with permissions
76
- - Real-time VoIP event monitoring
77
- - Interactive demo UI with event logging
78
- - Manual SDK initialization with App ID input
79
- - VoIP parameters configuration (video, ringtone, handle type)
80
-
81
- ## App Features
82
-
83
- ### Push Notifications Setup
84
- - Initialize Pushwoosh SDK with App ID and FCM Project ID
85
- - Automatically set VoIP App Code
86
-
87
- ### VoIP Parameters
88
- - Enable/disable video support
89
- - Configure ringtone sound (iOS only)
90
- - Select handle type (Generic, Phone Number, Email)
91
-
92
- ### Call Permissions (Android)
93
- - Request call permission (Android 12+)
94
- - Check permission status
95
-
96
- ### Push Notifications (Android)
97
- - Register for regular push notifications
98
- - Get push token
99
-
100
- ### Call Controls
101
- - End active VoIP call
102
-
103
- ### VoIP Events Log
104
- - Monitor all VoIP events:
105
- - `voipPushPayload` - VoIP notification received
106
- - `answer` - Incoming call answered
107
- - `reject` - Incoming call rejected
108
- - `hangup` - Call ended
109
- - `muted` / `unmuted` - Microphone muted/unmuted
110
- - `held` / `unheld` - Call held/unheld
111
- - `dtmf` - DTMF tones
112
- - `audioInterruption` - Audio interruption
113
- - `callFailed` - Call failed
114
- - `providerDidActivate` / `providerDidDeactivate` - CallKit activation/deactivation
115
- - `incomingCallSuccess` / `incomingCallFailure` - Incoming call success/failure
116
- - `voipDidRegisterTokenSuccessfully` / `voipDidFailToRegisterTokenWithError` - VoIP token registration
117
-
118
- ## Testing VoIP Calls
119
-
120
- ### iOS
121
- 1. Build and run the app on a physical device (VoIP doesn't work on simulator)
122
- 2. The app will automatically register for VoIP notifications
123
- 3. Send a VoIP push from Pushwoosh Control Panel using the VoIP App Code
124
- 4. Receive an incoming call via CallKit
125
-
126
- ### Android
127
- 1. Build and run the app
128
- 2. Grant call permission (Android 12+)
129
- 3. Tap "Register for Push Notifications" to register
130
- 4. Send a VoIP push from Pushwoosh Control Panel
131
- 5. Receive an incoming call via Android Calling API
132
-
133
- ## Troubleshooting
134
-
135
- ### Android: "Minimum supported Gradle version is 8.9"
136
- The hook automatically creates `gradle-wrapper.properties` with Gradle 8.9. If the error appears, run:
137
- ```bash
138
- cordova prepare android
139
- ```
140
-
141
- ### Android: "Incompatible AGP version"
142
- The hook automatically fixes AGP to 8.5.1. If the error appears, run:
143
- ```bash
144
- cordova prepare android
145
- ```
146
-
147
- ### Android: Firebase FIS_AUTH_ERROR
148
- Make sure that:
149
- 1. `google-services.json` is in the project root
150
- 2. An Android app with package name `com.pushwoosh.demovoip` is added in Firebase Console
151
- 3. `oauth_client` arrays are populated in `google-services.json`
152
-
153
- ### iOS: VoIP events not firing
154
- Make sure that:
155
- 1. `registerVoIPEvents()` is called immediately in `onDeviceReady()`, BEFORE SDK initialization
156
- 2. The app is running on a physical device (not simulator)
Binary file
@@ -1,181 +0,0 @@
1
- # Pushwoosh VoIP Demo App
2
-
3
- Demo application for testing Pushwoosh SDK VoIP functionality in Cordova.
4
-
5
- ## Quick Start
6
-
7
- ### 1. Adding Platforms
8
-
9
- Simply add the required platforms — all dependencies will be installed automatically:
10
-
11
- ```bash
12
- # Add iOS platform
13
- cordova platform add ios
14
-
15
- # Add Android platform
16
- cordova platform add android
17
- ```
18
-
19
- **What happens automatically:**
20
- - `pushwoosh-cordova-plugin` is installed with VoIP enabled for the added platform
21
- - iOS: `PW_VOIP_IOS_ENABLED=true` is set automatically
22
- - Android: `PW_VOIP_ANDROID_ENABLED=true` is set in gradle.properties
23
- - Gradle 8.9 and AGP 8.5.1 are configured for Android
24
- - `google-services.json` is copied for Firebase/FCM
25
-
26
- ### 2. Configuration
27
-
28
- #### App ID and VoIP App Code
29
- By default, the test App ID is used: `7BCDB-76CBE`
30
-
31
- To use your own App ID, change the values in `www/index.html`:
32
- ```html
33
- <input type="text" id="pushAppId" value="YOUR-APP-ID">
34
- <input type="text" id="pushProjectId" value="YOUR-FCM-PROJECT-ID">
35
- ```
36
-
37
- #### Google Services (Android)
38
- To work with Firebase/FCM, place your `google-services.json` in the project root. The file will be automatically copied to `platforms/android/app/` when running `cordova prepare`.
39
-
40
- ### 3. Build
41
-
42
- ```bash
43
- # iOS
44
- cordova build ios
45
-
46
- # Android
47
- cordova build android
48
- ```
49
-
50
- ## Project Structure
51
-
52
- ```
53
- demovoip/
54
- ├── www/ # Application sources
55
- │ ├── index.html # Main page with UI
56
- │ ├── js/index.js # Application logic
57
- │ └── css/index.css # Styles
58
- ├── hooks/ # Cordova hooks (automation)
59
- │ ├── after_prepare/ # Run after cordova prepare
60
- │ │ ├── 010_setup_gradle_wrapper.js # Sets up Gradle 8.9
61
- │ │ ├── 015_fix_agp_version.js # Fixes AGP to 8.5.1
62
- │ │ └── 020_copy_google_services.js # Copies google-services.json
63
- │ └── after_platform_add/ # Run after platform add
64
- │ └── 010_install_plugin.js # Installs Pushwoosh plugin
65
- ├── google-services.json # Firebase configuration for Android
66
- ├── config.xml # Cordova configuration
67
- └── package.json # npm dependencies
68
-
69
- ```
70
-
71
- ## Application Features
72
-
73
- ### Push Notifications Setup
74
- - Initialize Pushwoosh SDK with App ID and FCM Project ID
75
- - Automatically set VoIP App Code
76
-
77
- ### VoIP Parameters
78
- - Enable/disable video support
79
- - Configure ringtone sound (iOS only)
80
- - Select handle type (Generic, Phone Number, Email)
81
-
82
- ### Call Permissions (Android)
83
- - Request call permission (Android 12+)
84
- - Check permission status
85
-
86
- ### Push Notifications (Android)
87
- - Register for regular push notifications
88
- - Get push token
89
-
90
- ### Call Controls
91
- - End active VoIP call
92
-
93
- ### VoIP Events Log
94
- - Monitor all VoIP events:
95
- - `voipPushPayload` - VoIP notification received
96
- - `answer` - Incoming call answered
97
- - `reject` - Incoming call rejected
98
- - `hangup` - Call ended
99
- - `muted` / `unmuted` - Microphone muted/unmuted
100
- - `held` / `unheld` - Call held/unheld
101
- - `dtmf` - DTMF tones
102
- - `audioInterruption` - Audio interruption
103
- - `callFailed` - Call failed
104
- - `providerDidActivate` / `providerDidDeactivate` - CallKit activation/deactivation
105
- - `incomingCallSuccess` / `incomingCallFailure` - Incoming call success/failure
106
- - `voipDidRegisterTokenSuccessfully` / `voipDidFailToRegisterTokenWithError` - VoIP token registration
107
-
108
- ## Configuration (config.xml)
109
-
110
- ### Android Settings
111
- ```xml
112
- <platform name="android">
113
- <preference name="GradleVersion" value="8.9" />
114
- <preference name="AndroidGradlePluginVersion" value="8.5.1" />
115
- <preference name="android-minSdkVersion" value="24" />
116
- <preference name="android-targetSdkVersion" value="35" />
117
- </platform>
118
- ```
119
-
120
- ### Hooks
121
- ```xml
122
- <hook type="after_prepare" src="hooks/after_prepare/010_setup_gradle_wrapper.js" />
123
- <hook type="after_prepare" src="hooks/after_prepare/015_fix_agp_version.js" />
124
- <hook type="after_prepare" src="hooks/after_prepare/020_copy_google_services.js" />
125
- <hook type="after_platform_add" src="hooks/after_platform_add/010_install_plugin.js" />
126
- ```
127
-
128
- ## Testing VoIP
129
-
130
- ### iOS
131
- 1. Build and run the app on a physical device (VoIP doesn't work on simulator)
132
- 2. The app will automatically register for VoIP notifications
133
- 3. Send a VoIP push from Pushwoosh Control Panel using the VoIP App Code
134
- 4. Receive an incoming call via CallKit
135
-
136
- ### Android
137
- 1. Build and run the app
138
- 2. Grant call permission (Android 12+)
139
- 3. Tap "Register for Push Notifications" to register
140
- 4. Send a VoIP push from Pushwoosh Control Panel
141
- 5. Receive an incoming call via Android Calling API
142
-
143
- ## Requirements
144
-
145
- - Node.js 14+
146
- - Cordova CLI 12+
147
- - For iOS: Xcode 14+, macOS
148
- - For Android: Android Studio, JDK 17, Android SDK
149
-
150
- ## Versions
151
-
152
- - Cordova Android: 14.0.1
153
- - Cordova iOS: 7.1.1
154
- - Pushwoosh Cordova Plugin: 8.3.49
155
- - Gradle: 8.9
156
- - Android Gradle Plugin: 8.5.1
157
-
158
- ## Troubleshooting
159
-
160
- ### Android: "Minimum supported Gradle version is 8.9"
161
- The hook automatically creates `gradle-wrapper.properties` with Gradle 8.9. If the error appears, run:
162
- ```bash
163
- cordova prepare android
164
- ```
165
-
166
- ### Android: "Incompatible AGP version"
167
- The hook automatically fixes AGP to 8.5.1. If the error appears, run:
168
- ```bash
169
- cordova prepare android
170
- ```
171
-
172
- ### Android: Firebase FIS_AUTH_ERROR
173
- Make sure that:
174
- 1. `google-services.json` is in the project root
175
- 2. An Android app with package name `com.pushwoosh.demovoip` is added in Firebase Console
176
- 3. `oauth_client` arrays are populated in `google-services.json`
177
-
178
- ### iOS: VoIP events not firing
179
- Make sure that:
180
- 1. `registerVoIPEvents()` is called immediately in `onDeviceReady()`, BEFORE SDK initialization
181
- 2. The app is running on a physical device (not simulator)
@@ -1,22 +0,0 @@
1
- <?xml version='1.0' encoding='utf-8'?>
2
- <widget id="com.pushwoosh.demovoip" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3
- <name>demovoip</name>
4
- <description>Pushwoosh VoIP Sample App</description>
5
- <author email="support@pushwoosh.com" href="https://www.pushwoosh.com">
6
- Pushwoosh Team
7
- </author>
8
- <content src="index.html" />
9
- <allow-intent href="http://*/*" />
10
- <allow-intent href="https://*/*" />
11
- <platform name="android">
12
- <preference name="GradleVersion" value="8.9" />
13
- <preference name="AndroidGradlePluginVersion" value="8.5.1" />
14
- <preference name="android-minSdkVersion" value="24" />
15
- <preference name="android-targetSdkVersion" value="35" />
16
- </platform>
17
- <hook type="after_prepare" src="hooks/after_prepare/010_setup_gradle_wrapper.js" />
18
- <hook type="after_prepare" src="hooks/after_prepare/015_fix_agp_version.js" />
19
- <hook type="after_prepare" src="hooks/after_prepare/020_copy_google_services.js" />
20
- <hook type="after_platform_add" src="hooks/after_platform_add/010_install_plugin.js" />
21
-
22
- </widget>
@@ -1,86 +0,0 @@
1
- {
2
- "project_info": {
3
- "project_number": "843884467752",
4
- "project_id": "demoapp-33098",
5
- "storage_bucket": "demoapp-33098.firebasestorage.app"
6
- },
7
- "client": [
8
- {
9
- "client_info": {
10
- "mobilesdk_app_id": "1:843884467752:android:38e0329182de6fb22ec71d",
11
- "android_client_info": {
12
- "package_name": "com.pushwoosh.demoapp"
13
- }
14
- },
15
- "oauth_client": [],
16
- "api_key": [
17
- {
18
- "current_key": "AIzaSyD0fJnFrwLD820xFNFuE38csE2bm5Jn1EY"
19
- }
20
- ],
21
- "services": {
22
- "appinvite_service": {
23
- "other_platform_oauth_client": []
24
- }
25
- }
26
- },
27
- {
28
- "client_info": {
29
- "mobilesdk_app_id": "1:843884467752:android:a894ac7d888708bd2ec71d",
30
- "android_client_info": {
31
- "package_name": "com.pushwoosh.demoappunity"
32
- }
33
- },
34
- "oauth_client": [],
35
- "api_key": [
36
- {
37
- "current_key": "AIzaSyD0fJnFrwLD820xFNFuE38csE2bm5Jn1EY"
38
- }
39
- ],
40
- "services": {
41
- "appinvite_service": {
42
- "other_platform_oauth_client": []
43
- }
44
- }
45
- },
46
- {
47
- "client_info": {
48
- "mobilesdk_app_id": "1:843884467752:android:5594d785995d41832ec71d",
49
- "android_client_info": {
50
- "package_name": "com.pushwoosh.demovoip"
51
- }
52
- },
53
- "oauth_client": [],
54
- "api_key": [
55
- {
56
- "current_key": "AIzaSyD0fJnFrwLD820xFNFuE38csE2bm5Jn1EY"
57
- }
58
- ],
59
- "services": {
60
- "appinvite_service": {
61
- "other_platform_oauth_client": []
62
- }
63
- }
64
- },
65
- {
66
- "client_info": {
67
- "mobilesdk_app_id": "1:843884467752:android:5e6b23b8939b0d3b2ec71d",
68
- "android_client_info": {
69
- "package_name": "com.pushwoosh.newdemo"
70
- }
71
- },
72
- "oauth_client": [],
73
- "api_key": [
74
- {
75
- "current_key": "AIzaSyD0fJnFrwLD820xFNFuE38csE2bm5Jn1EY"
76
- }
77
- ],
78
- "services": {
79
- "appinvite_service": {
80
- "other_platform_oauth_client": []
81
- }
82
- }
83
- }
84
- ],
85
- "configuration_version": "1"
86
- }
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { exec } = require('child_process');
4
- const path = require('path');
5
- const fs = require('fs');
6
-
7
- module.exports = function(context) {
8
- const projectRoot = context.opts.projectRoot;
9
-
10
- const platforms = context.opts.platforms || [];
11
- const addedPlatform = platforms[0]; // Платформа которую только что добавили
12
-
13
- console.log(`[Hook] Platform added: ${addedPlatform}`);
14
- console.log('[Hook] Installing pushwoosh-cordova-plugin with VoIP enabled...');
15
-
16
- let voipFlags = '';
17
- if (addedPlatform === 'ios') {
18
- voipFlags = '--variable PW_VOIP_IOS_ENABLED=true';
19
- console.log('[Hook] Enabling VoIP for iOS');
20
- } else if (addedPlatform === 'android') {
21
- voipFlags = '--variable PW_VOIP_ANDROID_ENABLED=true';
22
- console.log('[Hook] Enabling VoIP for Android');
23
- } else {
24
- console.log('[Hook] No VoIP flags for this platform');
25
- }
26
-
27
- const command = `cordova plugin add ../../ --link ${voipFlags}`;
28
-
29
- return new Promise((resolve, reject) => {
30
- exec(command, { cwd: projectRoot }, (error, stdout, stderr) => {
31
- if (error) {
32
- if (stderr.includes('already installed') || stdout.includes('already installed')) {
33
- console.log('[Hook] Plugin already installed, skipping');
34
- resolve();
35
- } else {
36
- console.error('[Hook] Error installing plugin:', stderr);
37
- reject(error);
38
- }
39
- } else {
40
- console.log('[Hook] Plugin installed successfully');
41
- console.log(stdout);
42
- resolve();
43
- }
44
- });
45
- });
46
- };