I've got the following from this tutorial on creating a ShareExtension:
override func didSelectPost() {
self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
}
Which uses this javascript to get the url:
var GetURL = function() {};
GetURL.prototype = {
run: function(arguments) {
arguments.completionFunction({"URL": document.URL});
}
};
var ExtensionPreprocessingJS = new GetURL;
I'd like to understand how I can modify the the didSelectPost
so I can pass this URL to my main app. I've created a shared app group from this response, but the problem is my main app uses Firebase to store and update the TableView (which is just a list of URLs, like a reading list). I understand I can't use Firebase in the shareExtension (they are meant to be as simple as possible) - but I can't figure out a way of doing it otherwise.
Any help would be greatly appreciated!