Wie bringen Sie in einer iOS -App, die eine ActionExtesion verwendet, um eine URL von Safari zu teilen, Apps in den VordIOS

Programmierung für iOS
Anonymous
 Wie bringen Sie in einer iOS -App, die eine ActionExtesion verwendet, um eine URL von Safari zu teilen, Apps in den Vord

Post by Anonymous »

Ich habe ein ActionExtension -Ziel namens "url" hier ist url/info.plist :

Code: Select all




CFBundleDisplayName
Open in Chauffeur
NSAppTransportSecurity

NSAllowsArbitraryLoads


NSExtension

NSExtensionAttributes

NSExtensionActivationRule

NSExtensionActivationSupportsFileWithMaxCount
0
NSExtensionActivationSupportsImageWithMaxCount
0
NSExtensionActivationSupportsMovieWithMaxCount
0
NSExtensionActivationSupportsText

NSExtensionActivationSupportsWebURLWithMaxCount
1

NSExtensionJavaScriptPreprocessingFile
Action

NSExtensionPointIdentifier
com.apple.share-services
NSExtensionPrincipalClass
$(PRODUCT_MODULE_NAME).ActionRequestHandler

OS_ACTIVITY_MODE
disable


< /code>
und die info.plist meiner App hat: < /p>
  CFBundleURLTypes


CFBundleTypeRole
Editor
CFBundleURLName
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleURLSchemes

myappname



Und ich habe von Safari getestet, um die App zu myAppname: // öffnet die App.

Code: Select all

class ActionRequestHandler: NSObject, NSExtensionRequestHandling, URLSessionDelegate {

func beginRequest(with context: NSExtensionContext) {

let appURL = URL(string: "myappname://open?url=\(encodedURL)")!
context.open(appURL, completionHandler: { success in
// gets here but nothing happens, app does not come to foreground
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post