1
0
mirror of https://github.com/tooot-app/app synced 2024-12-28 02:10:02 +01:00
tooot/.yarn/patches/react-native-share-menu-npm-6.0.0-f1094c3204.patch
2022-12-23 17:47:01 +01:00

90 lines
3.4 KiB
Diff

diff --git a/android/build.gradle b/android/build.gradle
index 9557fdbf2fbf97b7f7aeaf7ce86d301a8ced213d..ebdeb6f4de7846d3241101001755595c52a4b05e 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 29
- buildToolsVersion "29.0.2"
+ compileSdkVersion 31
+ buildToolsVersion "31.0.0"
defaultConfig {
- minSdkVersion 16
- targetSdkVersion 29
+ minSdkVersion 21
+ targetSdkVersion 31
versionCode 1
versionName "1.0"
ndk {
diff --git a/ios/ReactShareViewController.swift b/ios/ReactShareViewController.swift
index f42bce6ce7e3f48a7ddc83f3366b68fd0664b1a0..ee360622b1d03cc9661c78c6f210b84c3b19a725 100644
--- a/ios/ReactShareViewController.swift
+++ b/ios/ReactShareViewController.swift
@@ -13,7 +13,7 @@ class ReactShareViewController: ShareViewController, RCTBridgeDelegate, ReactSha
func sourceURL(for bridge: RCTBridge!) -> URL! {
#if DEBUG
return RCTBundleURLProvider.sharedSettings()?
- .jsBundleURL(forBundleRoot: "index.share", fallbackResource: nil)
+ .jsBundleURL(forBundleRoot: "index.share")
#else
return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
diff --git a/ios/ShareViewController.swift b/ios/ShareViewController.swift
index 12d8c92dda20fabd9e7b55fec57b3d867414063c..8a1db0de285b18a9358a10b2ca8293a8c7d56a8e 100644
--- a/ios/ShareViewController.swift
+++ b/ios/ShareViewController.swift
@@ -19,8 +19,8 @@ class ShareViewController: SLComposeServiceViewController {
var hostAppUrlScheme: String?
var sharedItems: [Any] = []
- override func viewDidLoad() {
- super.viewDidLoad()
+ override func viewWillAppear(_ animated: Bool) {
+ super.viewWillAppear(animated)
if let hostAppId = Bundle.main.object(forInfoDictionaryKey: HOST_APP_IDENTIFIER_INFO_PLIST_KEY) as? String {
self.hostAppId = hostAppId
@@ -33,6 +33,13 @@ class ShareViewController: SLComposeServiceViewController {
} else {
print("Error: \(NO_INFO_PLIST_URL_SCHEME_ERROR)")
}
+
+ guard let items = extensionContext?.inputItems as? [NSExtensionItem] else {
+ cancelRequest()
+ return
+ }
+
+ handlePost(items)
}
override func isContentValid() -> Bool {
@@ -40,16 +47,6 @@ class ShareViewController: SLComposeServiceViewController {
return true
}
- override func didSelectPost() {
- // This is called after the user selects Post. Do the upload of contentText and/or NSExtensionContext attachments.
- guard let items = extensionContext?.inputItems as? [NSExtensionItem] else {
- cancelRequest()
- return
- }
-
- handlePost(items)
- }
-
override func configurationItems() -> [Any]! {
// To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here.
return []
@@ -238,7 +235,7 @@ class ShareViewController: SLComposeServiceViewController {
func completeRequest() {
// Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context.
- extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
+ extensionContext!.completeRequest(returningItems: nil, completionHandler: nil)
}
func cancelRequest() {