Closed aakashstha closed 1 year ago
Solution
<key>NSExtensionActivationRule</key>
<string>
SUBQUERY (
extensionItems,
$extensionItem,
SUBQUERY (
$extensionItem.attachments,
$attachment,
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" OR
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" OR
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie" OR
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.text"
).@count > 0
).@count > 0
</string>
@aakashstha can you share the complete share extension info.plist please?
@DavidAriza In this issue I had already shared all the shared extension key, value pairs naming as ShareExtension/Info.plist above just replace these block of code with the solution code provided by @aprashantz
<dict>
<key>NSExtensionActivationSupportsAttachmentsWithMaxCount</key>
<true/>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<true/>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<true/>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>15</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>15</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>15</integer>
<key>NSExtensionActivationSupportsText</key>
<true/>
</dict>
@aakashstha k cha sathi halkhabar
https://flutter.dev/
andhttps://www.google.com/
the share sheet is showing our app and suggestion of people.https://en.wikipedia.org/wiki/Google
andhttps://www.youtube.com/
the share sheet is unable to show our app and the suggestion of people.What I am doing in the code while editing info.plist in our app like below, the app is showing but nothing happens when its clicked.
As you can see I have removed value TRUEPREDICATE from the list above and added other supported url links and images supported value down below in the code of Info.plist and this way the app is not showing but feature is working from photos and files but not for the URL
This is the main Info.plist from our app and I don't think there is mistake here.
We are adding share extension app suggestion feature from this native swift code down below
We are adding share extension people suggestion feature from this native swift code down below
import UIKit import Social import Intents import CoreServices import Foundation
import FirebaseCore import FirebaseAuth import GoogleSignIn
class IntentShareController: UIViewController {
// let signIn = GIDSignIn.sharedInstance //// signIn?.scopes = ["https://www.googleapis.com/auth/photos"] // // Create Google Sign In configuration object. // let config = GIDConfiguration(clientID: "890577051017-11fgqgou5rk8ht59vln934ebv51c2rcg.apps.googleusercontent.com") // GIDSignIn.sharedInstance.configuration = config // // let currentUser = signIn.currentUser // currentUser?.authentication?.refreshTokens(completion: { (authentication, error) in // if let error = error { // print("Error refreshing token: (error.localizedDescription)") // } else { // // Token refreshed successfully // let accessToken = authentication?.accessToken // // Use the new access token to share the image // } // })
// Add File Name let fileName = getFileName(from: url, type: .image) self.fileNameWithExtension.append(fileName) print(self.fileNameWithExtension)
// Add File Data let fileURL = URL(fileURLWithPath: url.path) let totalFileData = try! Data(contentsOf: fileURL) // print("***the contents of file = " + totalFileData.base64EncodedString()) self.fileData.append(totalFileData) print(self.fileData)
// Add File Size if url.startAccessingSecurityScopedResource() {
// Add File Extension self.fileExtension.append(fileName.components(separatedBy: ".").last!.lowercased()) print(self.fileExtension)
// extensionContext!.completeRequest(returningItems: [], completionHandler: nil) }
// return alert }
// dismiss remove(pop) the presented view controller from the Screen self.dismiss(animated: true,completion: nil) self.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil) } }
// self.shareTextURLDataToPerr(url:urlString) self.textData = urlString self.shareTextAndFileDataToPerr() }
// this remove the Share Extension from the Screen // self.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil) } }
// self.shareTextURLDataToPerr(url:text) self.textData = text self.shareTextAndFileDataToPerr() } } }
// print("9999999999999999999999999") // let a = FileManager.default.fileExists(atPath: localPathUrl.path) // print(a)
// DispatchQueue.main.async { // self.uploadToSigned(signedUrl:dataArray) // }
// Specify the URL of the pre-signed URL for uploading the file let urlEndPoint = URL(string: signedUrl[i])! var request = URLRequest(url: urlEndPoint) request.httpMethod = "PUT"
// self.dispatchAtLast.append(jsonResponse!) // self.countAndStopLoaderAtLast += 1 print(jsonResponse as Any);
// Remove Loader at last self.stopLoader()
} // main class end