-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoking an action on a locked device doesn't work #9
Comments
The framework cannot compile in iOS app extension due to the link you post it's not pure iOS but Xamarin I think there is also an issue with application name, taken from main bundle To fix the compile issue a compilation flag could be added to replace the current code by one using NSExtensionContext |
I don't use CocoaPods. I added CallbackURLKit to my project as a subproject and added CallbackURLKit.framework to both my app and my today extension's target in the section Linked Frameworks and Libraries. This way it compiles for both with no issues. |
I suppose that app extension has underneath also the |
An NSExtensionContext must be set in Manager to open urls
I add a compilation flag APP_EXTENSIONS No tested yet For carthage maybe the only possibility is to create a new shared scheme with a new target with specific name |
Closed for no activity |
I tried to use CallbackURLKit on a Today Extension Widget. When one button on the widget is pressed, it should invoke an action on the main application via a url action.
try? Manager.perform(action: "playcollection", urlScheme: "bingobongo", parameters: parameters)
This works when invoking the action from the extension with the device unlocked, but if the device is locked the system doesn't ask to unlock and simply disregards the action.
The problem comes from Manager.open(url: Foundation.URL) that calls:
UIApplication.shared.openURL(url)
To let the device ask for the unlock code and then invoke the action, there's a similar method on NSExtensionContext:
func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil)
The same issue is descibed here:
http://stackoverflow.com/questions/26909821/ios-8-today-widget-and-locked-device
It would be useful to inject the current NSExtensionContext in a non-default Manager object, that when extensionContext is not nil will invoke this method instead of the one from UIApplication.
The text was updated successfully, but these errors were encountered: