Ionic native Social Sharing


when updating my project to target version 32 the plugin ‘cordova-plugin-x-socialsharing’ has stopped working, it causes the app to close.

I get the following error:

java.lang.IllegalArgumentException:…..: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
        at nl.xservices.plugins.SocialSharing$

any ideas?

thank you

Yeah, the plugin needs to be updated to support SDK v32. Here is the same issue - Android 12 issue · Issue #1201 · EddyVerbruggen/SocialSharing-PhoneGap-Plugin · GitHub

This line needs to be updated to include FLAG_IMMUTABLE or FLAG_MUTABLE.

Hi @twestrick,

Thanks for answering.

I change the file ‘…/plugins/cordova-plugin-x-socialsharing/src/android/nl/xservices/plugins/’ and I still get the same error.

Don’t change the file, update the plugin to the latest version (6.0.4) as it might have more requires changes.


Thank you @julio-ionic. That’s how it works for me