mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-11 18:24:43 +02:00
parent
9aa5df7790
commit
d5d57aa360
@ -82,11 +82,11 @@
|
||||
<!-- SHARE EXTENSION -->
|
||||
<activity
|
||||
android:noHistory="true"
|
||||
android:name=".share.ShareActivity"
|
||||
android:name=".ShareActivity"
|
||||
android:configChanges="orientation"
|
||||
android:launchMode="singleTask"
|
||||
android:label="@string/app_name"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppTheme"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
|
@ -1,4 +1,4 @@
|
||||
package net.cozic.joplin.share;
|
||||
package net.cozic.joplin;
|
||||
|
||||
import com.facebook.react.ReactActivity;
|
||||
|
@ -91,6 +91,10 @@ public class SharePackage implements ReactPackage {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (intent.getBooleanExtra("is_processed", false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String type = intent.getType() == null ? "" : intent.getType();
|
||||
map.putString("type", type);
|
||||
map.putString("title", getTitle(intent));
|
||||
@ -112,6 +116,7 @@ public class SharePackage implements ReactPackage {
|
||||
}
|
||||
|
||||
map.putArray("resources", resources);
|
||||
intent.putExtra("is_processed", true);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
import debounce from './debounce';
|
||||
|
||||
const { NativeModules, Platform } = require('react-native');
|
||||
|
||||
export interface SharedData {
|
||||
@ -11,9 +9,7 @@ export interface SharedData {
|
||||
const ShareExtension = (NativeModules.ShareExtension) ?
|
||||
{
|
||||
data: () => NativeModules.ShareExtension.data(),
|
||||
// we debounce the `close` method, to keep alive permissions of Uris received from the share activity
|
||||
// this is to prevent getting permission denied error while sharing the same file to joplin multiple times in a row
|
||||
close: () => debounce(() => NativeModules.ShareExtension.close(), 3 * 60 * 1000), // close it after 3 minutes
|
||||
close: () => NativeModules.ShareExtension.close(),
|
||||
shareURL: (Platform.OS === 'ios') ? NativeModules.ShareExtension.getConstants().SHARE_EXTENSION_SHARE_URL : '',
|
||||
} :
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user