Problem
Your Android application may be rejected by the Google Play Store for VoIP-related permissions (for example FOREGROUND_SERVICE_PHONE_CALL, MANAGE_OWN_CALLS) after integrating the Pushwoosh Cordova plugin.
Cause
Version 8.3.40 of pushwoosh-cordova-plugin added the com.pushwoosh:pushwoosh-calls module for VoIP-style call notifications unconditionally, and that module merges the call permissions into your AndroidManifest.xml.
Recommended solution: update the plugin and leave VoIP off
Since plugin version 8.3.43 the VoIP module is opt-in and disabled by default. The plugin exposes the preferences PW_VOIP_ANDROID_ENABLED and PW_VOIP_IOS_ENABLED, both defaulting to false. When the Android flag is false, the pushwoosh-calls dependency and its sources are never added to the build, so the VoIP permissions never reach your manifest.
Update to a current plugin version and either omit the variable or set it explicitly in config.xml:
<plugin name="pushwoosh-cordova-plugin" spec="^8.3.70">
<variable name="PW_VOIP_ANDROID_ENABLED" value="false" />
<variable name="PW_VOIP_IOS_ENABLED" value="false" />
</plugin>
Then delete the node_modules and platforms folders, reinstall your dependencies and rebuild.
Capacitor note: Capacitor does not execute Cordova hooks, so set PW_VOIP_ANDROID_ENABLED=false (or simply leave it unset) in android/gradle.properties.
Do not pin to 8.3.39. That build is many releases behind and ships Pushwoosh Android SDK 6.7.30 instead of the current 6.9.6, so you would lose a year of fixes to avoid a problem that is already solved by the opt-in flag.
If you are stuck on an affected version (8.3.40–8.3.42)
Strip the permissions and the service at build time by adding the following inside the <platform name="android"> tag of your config.xml:
<platform name="android">
<!-- Add tools namespace to the manifest -->
<edit-config file="app/src/main/AndroidManifest.xml" target="/manifest" mode="merge">
<manifest xmlns:tools="http://schemas.android.com/tools" />
</edit-config>
<!-- Remove foreground service and VoIP-related permissions -->
<config-file target="app/src/main/AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" tools:node="remove" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" tools:node="remove" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" tools:node="remove" />
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS" tools:node="remove" />
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" tools:node="remove" />
</config-file>
<!-- Remove the VoIP service -->
<config-file target="app/src/main/AndroidManifest.xml" parent="/manifest/application">
<service android:name="com.pushwoosh.calls.service.PushwooshCallService" tools:node="remove" />
</config-file>
</platform>
Rebuild with cordova build android --release and verify the result in platforms/android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml.
Comments
0 comments
Please sign in to leave a comment.