IOS 8 Today widget and locked device

Sorry my english is bad!

I designed a widget today. I need to launch the Maps app (for example) from a widget and not work when the device is locked. How to detect a locked device and launch the unlock screen in this situation?

Hello,

+3


source to share


1 answer


Instead of using

UIApplication.SharedApplication.OpenUrl(new NSUrl("myapp://foo"));

      

Using



ExtensionContext.OpenUrl(new NSUrl("myapp://foo"), null);

      

The code is in C # using Xamarin.iOS, but ObjectiveC code is equivalent to:

NSURL *url = [NSURL URLWithString:@"myapp://foo"];
[self.extensionContext openURL:url completionHandler:nil]; 

      

+1


source







All Articles