Skip to content

Commit

Permalink
android 12 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Filippi committed Nov 30, 2021
1 parent f20414e commit b600d89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-x-socialsharing"
version="6.0.3">
version="6.0.4">

<name>SocialSharing</name>

Expand Down Expand Up @@ -72,7 +72,7 @@


<config-file target="AndroidManifest.xml" parent="/*/application">
<receiver android:name="nl.xservices.plugins.ShareChooserPendingIntent" android:enabled="true">
<receiver android:name="nl.xservices.plugins.ShareChooserPendingIntent" android:enabled="true" android:export="true">
<intent-filter>
<action android:name="android.intent.action.SEND"/>
</intent-filter>
Expand Down
3 changes: 1 addition & 2 deletions src/android/nl/xservices/plugins/SocialSharing.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ public void run() {
final boolean hasMultipleAttachments = files.length() > 1;
final Intent sendIntent = new Intent(hasMultipleAttachments ? Intent.ACTION_SEND_MULTIPLE : Intent.ACTION_SEND);
final Intent receiverIntent = new Intent(cordova.getActivity().getApplicationContext(), ShareChooserPendingIntent.class);
final PendingIntent pendingIntent = PendingIntent.getBroadcast(cordova.getActivity().getApplicationContext(), 0, receiverIntent, PendingIntent.FLAG_UPDATE_CURRENT);
sendIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
final PendingIntent pendingIntent = PendingIntent.getBroadcast(cordova.getActivity().getApplicationContext(), 0, receiverIntent, PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_IMMUTABLE); sendIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);

try {
if (files.length() > 0 && !"".equals(files.getString(0))) {
Expand Down

0 comments on commit b600d89

Please sign in to comment.