ios-extensions

How to debug an iOS app extension?

淺唱寂寞╮ 提交于 2020-07-05 09:14:02
问题 I'm trying to debug an iOS app extension and all I can do is to set breakpoints but it would be nice to be able to print to console. Is this possible with Xcode 9? Or at least read it somewhere, maybe a file? I went to see my device's logs in "devices and simulators" but could't find what I printed from my iOS app extension. 回答1: You can debug an app extension like any other app by just choosing target and device and then running the extension. You need to choose an app to run with the

How to debug an iOS app extension?

倾然丶 夕夏残阳落幕 提交于 2020-07-05 09:11:29
问题 I'm trying to debug an iOS app extension and all I can do is to set breakpoints but it would be nice to be able to print to console. Is this possible with Xcode 9? Or at least read it somewhere, maybe a file? I went to see my device's logs in "devices and simulators" but could't find what I printed from my iOS app extension. 回答1: You can debug an app extension like any other app by just choosing target and device and then running the extension. You need to choose an app to run with the

How to communicate between iOS App Containing Extension and Extension (not Host App)

空扰寡人 提交于 2020-06-24 01:54:47
问题 TLDR: Is it possible to send realtime messages or notifications between iOS App and it's Extension? I'm writing an iOS App with an extension that are part of the same App Group and share the same CoreData (SQLite database). I can read and write to the database using CoreData from the App and from the extension, they both share the same content. My Question is: Is it possible to send messages or notifications between the App and the extension to notify the other to update if necessary? I tried

Crash when open containing app from today extension

非 Y 不嫁゛ 提交于 2020-01-25 04:40:10
问题 I created today extension and add a button to open containing app. Inside extension view controller: @IBAction func pressed() { extensionContext?.openURL(NSURL(string:"myApp://")!, completionHandler: nil) } So, I also add URL Scheme to containing app plist: <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>myApp</string> </array> </dict> </array> Widget works fine, but when I try to press widget my app crashes inside containing app AppDelegate.swift.

Can imessage extension open host app?

一个人想着一个人 提交于 2020-01-14 19:09:55
问题 I've tried [self.extensionContext openURL:completion] , but my app crashed. I heard some extensions can't use this method, can iMessage extensions? By the way, can host app activate its iMessage extension? 回答1: Share Extensions and Action Extensions are not designed to function as app launchers. App Extension Programming Guide There is no direct communication between an app extension and its containing app; typically, the containing app isn’t even running while a contained extension is

Can imessage extension open host app?

扶醉桌前 提交于 2020-01-14 19:08:00
问题 I've tried [self.extensionContext openURL:completion] , but my app crashed. I heard some extensions can't use this method, can iMessage extensions? By the way, can host app activate its iMessage extension? 回答1: Share Extensions and Action Extensions are not designed to function as app launchers. App Extension Programming Guide There is no direct communication between an app extension and its containing app; typically, the containing app isn’t even running while a contained extension is

NotificationServiceExtension not called

▼魔方 西西 提交于 2020-01-14 13:35:30
问题 After iOS 10 released, I use NotificationServiceExtension for image notification. It works fine. But I found something wrong recently. Codes in UNNotificationServiceExtension not call anymore. I'm not sure the cause so I create a new project for test. Unfortunately the new project not work neither. I found something strange: Run extension in my device, locked screen, then push notification. Xcode raises this message(Extension is called obviously), unlocked and Xcode print " Program ended with

Scan functionality doesn't work on Action Extension(no camera opening to scan )

我的梦境 提交于 2020-01-07 02:56:06
问题 i am able to implement buttonactions,tableview,textfields ,switch... all are working fine in ActionExtension BUT Scan Functionality doesn't work (no camera opening to scan ) in Action Extension . Below i shared my scanning code in swift and screenshot of my Extension Declarations : var scannedBarcode = NSString(string: "") var scannedMetadataOutput = AVCaptureMetadataOutput() var gCaptureMetadataOutput = AVCaptureMetadataOutput() var _prevLayer = AVCaptureVideoPreviewLayer() var _session =

How to overlap two controls in iOS watch kit using interfacebuilder

自作多情 提交于 2020-01-04 04:14:48
问题 I have two button with images and i want to overlap one over another. Is it even possible to do it iOS Watch? Moreover, how to handle background or foreground depth of a WKInterfaceObject in watch programming, like sendViewtoBackground or bringSubViewtoFront, as in normal iOS programming ? 回答1: In the watch you don't have a Z hierarchy. The max you can do is using a group, that has a background and then have controls over that background. Another alternative (hack?) is to render all your

NEVPNErrorDomain Error 1 when trying to start TunnelProvider network extension

ぐ巨炮叔叔 提交于 2020-01-02 07:18:11
问题 I'm trying to make a custom TunnelProvider network extension by starting with the XCode template for the TunnelProvider and then adding the code to the host app in order to configure it and start it. I am using an instance of NETunnelProviderManager to configure it, and when I call saveToPreferencesWithCompletionHandler: I get success (error = 0). However, when I call startVPNTunnelAndReturnError: on the (non-zero) connection I always get the below error: Error Domain=NEVPNErrorDomain Code=1