calvinckho / capacitor-jitsi-meet

This plugin is used to make video calls using Jitsi video platform (https://meet.jit.si) on iOS and Android using Ionic Capacitor.
85 stars 41 forks source link

Android 14 permissions #109

Closed gasci closed 4 months ago

gasci commented 4 months ago

My Android app is being rejected due to the missing the Foreground Service Policy type declaration:

As far as I understood, according to their new regulations, we connect the service type to the service. How can we apply this to this plugin. Is this case relevant for this plugin? If so, could you enhance the documentation for this plugin, please?

specifically for these two:

android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK
android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION
<manifest ...>
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
    <application ...>
      <service
          android:name=".MyMediaPlaybackService"
          android:foregroundServiceType="mediaPlayback"
          android:exported="false">
      </service>
    </application>
</manifest>

To read more about it, please follow this link: https://developer.android.com/about/versions/14/changes/fgs-types-required

calvinckho commented 4 months ago

I will take a look this weekend. @gasci Thanks for reporting this.

gasci commented 4 months ago

Thank you for the quick response.

Yesterday, I figured out that these permissions are being automatically added by the plugin to the final manifest.

But since Picture in Picture Mode or Screen Sharing doesn't work, I cannot show these features to Google during the review to justify these permissions. If there is a way to make these permissions optional, that would be great. PiP or screen sharing would justify this: FOREGROUND_SERVICE_MEDIA_PLAYBACK

I don't even know why we need this: FOREGROUND_SERVICE_MEDIA_PROJECTION

calvinckho commented 4 months ago

Hi @gasci, I checked the source code of the Jitsi SDK. Here is how the android SDK defines the foreground service type.

I am not sure if the foreground service type needs to be declared in the main app's AndroidManifest.xml, as it is not done in the Jitsi official app. See here.

I recommend you can try to enable the capacitor-jitsi-meet's PIP feature in Android, build the app, and submit the binary to the Google Play store and see if they accept it.

To enable Picture-in-Picture Mode for Android:

  1. In the plugin's AndroidManifest.xml, set supportsPictureInPicture to true (default).

android:supportsPictureInPicture="true"

  1. Set the featureFlags param 'pip.enabled' to true

const result = await Jitsi.joinConference({
....
featureFlags: { 'pip.enabled': true }
....
})
  1. Build the app, and submit the binary for approval.

Please note that the free plugin version only supports Android PIP. For iOS PIP implementation, as the Jitsi SDK doesn't support native PIP yet, I offer consultation service to help implement it in a non-native way.

gasci commented 4 months ago

I forcefully removed it from the final manifest and the plugin worked properly:

<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"
        tools:node="remove" />
<uses-permission android:name="android.permission. FOREGROUND_SERVICE_MEDIA_PLAYBACK"
        tools:node="remove" />

I sent our app for a final review with these configurations. I expect that they won't reject the app this time. Thank you for your support.

calvinckho commented 4 months ago

@gasci what is the result of the Play Store review? Did they accept your app submission?

gasci commented 4 months ago

Yes, it passed.