EddyVerbruggen / SocialSharing-PhoneGap-Plugin

👨‍❤️‍💋‍👨 Cordova plugin to share text, a file (image/PDF/..), or a URL (or all three) via the native sharing widget
MIT License
1.78k stars 905 forks source link

cordova android 11 and android sdk32/33 fix #1192

Open kiwi-x opened 1 year ago

kiwi-x commented 1 year ago

beside changes to plugin xml you need to have a new flag for pnedingintents for android 13

saggio89 commented 1 year ago

This is similar to PR #1158 which was merged into master. The only difference is this has an "If" condition. @kiwi-x is this for backward compatibility on old versions of Android?

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
          pendingIntentValueFLAG = pendingIntentValueFLAG | PendingIntent.FLAG_IMMUTABLE;
}
final PendingIntent pendingIntent = PendingIntent.getBroadcast(cordova.getActivity().getApplicationContext(), 0, receiverIntent, pendingIntentValueFLAG);
kiwi-x commented 1 year ago

Hello, yes I think so, 'cause on older Android Version (< Android S) You probably don't have the FLAG_IMMUTABLE flag.