Open AndyDentFree opened 5 years ago
Asked a question on Stack Overflow. For now, personally, going back to XCode 10
Have updated imDataUrlApp in 0363e39 to prove that self.extensionContext?.open
still works to open a parent app, but there's no solution for opening Settings or external web links
Whilst I've yet to update these samples with this, Touchgram has been updated to prove you can do work around this as a two-step thing, which was recommended by Apple DTS.
self.extensionContext?.open
Was fixed in 585e2ea by using a local webView and forwarding URLs to a host app to open them (official DTS recommendation).
Re-opened because the fix above was only applied to webFromIM
sample and imPhoto
was left unbuildable, with its code in onUseCamera
trying to open the settings dialog
Hello, Hope you are doing great; I am also Working on message extension part I did Everything it working Fine as well But in my Message conatins the url also But When I tapped the Message Not opening anything Any suggestion for me I am attacking my Code below
private func share_UrlMethod(tag:Int){ let layout = MSMessageTemplateLayout() if let account_info = myAccounts?[tag]{ layout.caption = account_info.first_name ?? "" let finalurl = "https://b-intouch.me/staging/public/uploads/user_images/" + (account_info.user_img ?? "").replacingOccurrences(of: " ", with: "%20") if let url = URL(string: finalurl), let imageData = try? Data(contentsOf: url), let uiImage = UIImage(data: imageData) { layout.image = uiImage } else { layout.image = UIImage(named: "") } // layout.mediaFileURL = URL(string: account_info.account_Url ?? "")
}
//"Here is my B in Touch digital business card:"
var components = URLComponents()
let rating1 = URLQueryItem(name: "rating1", value: myAccounts?[tag].account_Url ?? "")
components.queryItems = [rating1]
// layout.subcaption = myAccounts?[tag].account_Url ?? ""
let message = MSMessage()
message.url = components.url!
message.layout = layout
self.activeConversation?.insert(message, completionHandler: { [weak self] (error) in
guard self != nil else {return}
DispatchQueue.main.async {
if (error == nil) {
debugPrint("Message sent")
} else {
debugPrint("Error!")
}
}
})
}
Please move this to a StackOverflow question and have a close look at imUrlData
It differs in the MSMessage:
let session = conversation.selectedMessage?.session
let message = MSMessage(session: session ?? MSSession())
Trying to build with XCode 11.0 gets an error:
'open(_:options:completionHandler:)' is unavailable in application extensions for iOS
in the apps: