Post not yet marked as solved
runtime.oninstalled is invoked when I install the extension for the first time in the browser. But if I uninstalled it again (by dragging the app to bin), and tried reinstalling the runtime.oninstalled is not invoked.
is that an expected behavior?
If so, how can I test this case during extension development? Because it is difficult to find a new browser to test this case every time.
Thanks.
Post not yet marked as solved
Hi!
What is basic difference between Safari extension which has NSExtensionPointIdentifier set to com.apple.Safari.extension and Safari web extension with NSExtensionPointIdentifier value set to com.apple.Safari.web-extension.
I'm asking because to me it seems that permissions for those two work differently.
When I set same set of permissions to manifest.json of extension I have different behaviour.
Case 1:
For com.apple.Safari.extension when user turns on the extension in Safari preferences, there is a popup with question: Are you sure you want to turn on the extension "extension_name"?. User can either cancel it and not turn on extension, or user can click Turn on and allow all extension requested permissions on all pages.
Case 2:
For com.apple.Safari.web-extension when user turns on the extension in Safari preferences, there is no popup, but there are 2 buttons, Edit websites where user can enable/disable extension separately for each and every website and there is Always allow on Every Website which basically does the same as Turn On in first example. But if user does not accept some webpage, when user gets to that page first time and tries to click on extension icon, there will be popup with warning about permissions and with several options for user to allow or disable extension.
To create extension I used safari-web-extension-converter tool which automatically creates Safari web extension, but problem is our users do not like permission behaviour that happens in Case 2.
Is there a way to have Safari web extensions (com.apple.Safari.web-extension) which has behaviour described in Case 1.
Post not yet marked as solved
Hello.
How to receive keyboard events in PHContentEditingController on macOS?
When extension is active tapping any key will result in Funk sound.
First i tried to override keyDown in my subclass of PHContentEditingController, which does nothing.
I also tried override keyDown in my subclass of NSView for my subclass of PHContentEditingController.
Then i followed instructions from WWDC "Advances in macOS Security" session and implemented Input monitoring permissions request via CGEvent.tapCreate which only partially works. My extension now listed in System security / Privacy / Input Monitoring but it's impossible to turn it on. On each attempt to enable system fires alert with request to relaunch the app but does nothing. When alert disappear extension persist unchecked.
My goal is to provide keyboard shortcuts for various task in Photo Editing Extension. How i can achieve that?
I am developing an app with a widget available. Until recently the widget was being shown on both an iPhone and an iPad devices. Then I changed some logic in the widget, and now it only displays on the iPhone.
I also use the Xcode simulators in the development, and the widget is available on both iPhone and iPad simulators, with same code.
Summarizing the status for the widget.
Simulators
iPhone (13 Pro Max, iPhone 12) - OK
iPad Pro (12.9" 5th Gen) - OK
Devices
iPhone (11) - OK
iPad (Air 2) - Not available
I can attach the Widget extension to the debugger for the simulators and the iPhone device. However the process in not there when I use the iPad device, so cannot attach the widget code to the debugger. Even if I attach the widget extension by name to the debugger, it is as if it is not running.
I can run the widget extension directly on the iPad device (using an appropriate build scheme) and the details of the info displayed by the widget is the same as for the iPhone. So it is not running the widget on an iPad that is the problem.
It seems like the widget extension is not embedded in the app code when the app is loaded on to an iPad device.
Has anyone experienced anything similar?
Not necessarily with a widget, it could be with another framework extension.
Post not yet marked as solved
Hi,
I'm trying to build a Notification Service Extension. When I run the application, I get the error:
Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier.
Embedded Binary Bundle Identifier:(null)
Parent App Bundle Identifier: ##.#####.#####
I have no idea why the identifier of the embedded bundle could be null. In the General tab of the extension, I have set it so that it has a common prefix with the parent app. In the Info tab, the value for Bundle Identifier is $(PRODUCT_BUNDLE_IDENTIFIER), and I cannot change that to anything else. Whenever I build, it goes back to this.
Xcode Version 13.0
Any ideas?
Post not yet marked as solved
I'm working on an "Issuer Provisioning" extension for iOS. Instances of my root PKIssuerProvisioningExtensionHandler subclass are initialised and reinitialised often (every time the user taps the "+" button in the Wallet app) and live for a few milliseconds. So far, so good.
The head-scratching part is that the extensions' process lives on across multiple invocations. This in turn has the effect that static member values also live on, meaning they are not in a predictable state during instantiation. Some of my static-loving dependencies are unhappy with this pattern.
Is this "process outliving instances" extension pattern a common one? Is it described anywhere? Can it be disabled?
Post not yet marked as solved
Hi, We are an MDM Solution, who is trying to collect the Data Usage Datas from iOS Devices. We have our own Native app, there we can able to get the data usage with some limitations
While trying to fetch continuously, it shows usage for maximum upto 4GB. After 4 GB, it again resets the current count and starts from 0 .
Forum Link
Also These Above data fetched on one instance resets to zero on Restarting Device,
So we are planning for Content Filter Provider extensions to get a track of data usage. We have no clear Documentations to use this.
With Some third party domain references ,
Below are the Questions on it.
For Content Filtering to be working , We need to add a plugin web content Filter with apps distribution Certificate as its authentication. -> As we are an MDM solution ,Is it needed to give all the cx our Distribution Certificate with its private key?
Will the Content Filtering will satisfy our needs, as we can see that it works on tight container ? Is it possible to collect the data usages of the device without any limitations?
It will good ,if there was a proper apple document to use this extension. Is it any there?
Also will it be possible to use this without the distribution Certificate Authentication?
Apple Doc: Link
Any Suggestions are welcome. Thanks in Advance
Post not yet marked as solved
Env: any iOS 15.0+ devices.
I installed the thirtd-party keyboard app like Gboard, Naver SmartBoard, SwiftKey etc.
And, I added the keyboard app from Settings -> General -> Keyboard -> Keyboards -> add new keyboard...
However, the third-party keyboard is not shown in safari, finder, but shown in Notes app or the other apps.
I remove the third-party keyboard app from Settings -> ... -> Keyboards and if I add it repeatedly, it is shown.
I think this is a bug of iOS 15.
I don't have expreience in iOS 13, iOS 14.
Post not yet marked as solved
Hi,
I am working on safari web extension for iOS, Since Message passing is only supported from safari extension to iOS application.
To pass the data from app to safari extension, I thought of storing the required data using the Userdefault suite name and "app group" to access the UserDefaults data from the safari extension.
I am stuck at how to access the data at the safari extension.
Any sample javascript to access the UserDefaults data is appreciated
Thanks
Post not yet marked as solved
In Mail or Safari, user can select text to bring up the edit menu..
When sharing the text selection to Reminders using Share Extension, Reminders App's share extension is able to identify the "source" and show the app icon linking back to the original web page or email. (Please check attached screenshots)
In my own Share Extension, how do I get, say, an URL object linking to the sharing source?
I've looked at NSExtentionContext, NSExtensionItem and NSItemProvider documentation. It doesn't look like there's a public interface to retrieve that info.
Do u guys have any suggestion?
Thanks
Bill
Post not yet marked as solved
I implemented a basic version of the Notification Service Extension but it doesn't get called. Would like to ask for an advice...
【Issue Description】
Step 1: Run the main app that contains the extension on my iPhone.
Step 2: Set the breakpoints and add some logs in the extension.
Step 3: Attach the extension to the process for debugging purpose. Besides the "scheme" section, it always shows “waiting to attach to Notification Service on Angel’s iPhone".
Step 4: Triggered the push notification when the device screen is locked. I immediately received a message which was apparently not modified.
Step 5: The title -"Notification Service Extension" appears in console area. But no logs was printed out on the console. And no breakpoint was hit. So apparently this extension target was not invoked.
【Attempts I made】
1.Make sure "mutable-content: 1" is in notification payload;
2.Make sure an alert dictionary with "title" field is in notification payload;
3.Make sure TARGETS (main) -> Build Phases -> Embed App Extensions -> Uncheck "Copy only when installing" is unchecked;
4.Check the deployment version of both main app and the extension target(13.0) are lower than my device version(15.4).
5.Tried to explicitly & directly run the extension target but received an XPCError -"connection invalid".
6.Tried to create a new extension with minimal code but met with the exact same issue.
Post not yet marked as solved
I've created a sticker app extension for my game in Xcode and when i run it on my device or download it from TestFlight the sticker app shows no icon in messages and says Messages App Plugin and shows no stickers
Post not yet marked as solved
I trying run it with the next command:
csrutil enable --without kext
sudo chown -R root:wheel build/Release/VoltageShift.kext
./voltageshift info
But in this last step it fail
Post not yet marked as solved
Hi in my web extension I have a button, which I programmatically create a file for download when the user clicks it.
Here is my code: a.click()
However, this does nothing when I do it within the popup. It works fine on the main Safari webpage. Am I doing something wrong?
Post not yet marked as solved
Hi, i'm currently trying to implement an autofill service for my password management app and it's not showing in the Settings -> Passwords -> Autofill passwords.
I've created the entitlement file with the com.apple.developer.authentication-services.autofill-credential-provider key with the YES value for both my app target and autofill extension.
I've added for both my app target and extension target the capability for "Autofill Credential Provider".
I've followed this tutorial but it's not very clear.
Am I missing something here?
Post not yet marked as solved
I would like to access some data from CloudKit through an app extension (more specifically a watch app).
In my main app I simply create my container like this: CKContainer(identifier: "myContainerID") and then call any methods on the private database
In my app extension I create a container with the exact same code but when I try to call a method on the private database I get this error:
<CKError 0x600003953c90: "Permission Failure" (10/2007); server message = "Invalid bundle ID for container"; uuid = 76F8A8B0-0B53-4D23-A7EB-D9982C7CE0BB; container ID = "myContainerID">
I've also doubled checked that I've got all the correct iCloud entitlements.
I've also seen this question but I'm already using the solution: https://stackoverflow.com/questions/30458459/how-to-make-watchkit-extension-app-and-my-iphone-app-share-the-same-icloud-datab
Thanks for any help!
Post not yet marked as solved
Hello, we successfully uploaded a safari extension to the app store which was approved and shows ready for sale.
We want it to be private, only for our organization and we selected the organization in the Pricing and Availability section. We also selected all countries and regions.
We tried to download the extension from several locations: Bulgaria, Us, China but on all of them we are getting "App Not Available in your country or region."
Could you please help on what we are missing?
Thanks
Post not yet marked as solved
App disappears from the share sheet list on the second attempt to open the share menu. Noticed that it happens only on iOS >=15.0 and to URLs with query params.
Apps like Instagram and Reminders (iOS native app) don't show in the share sheet menu and even in the entire share list.
Reproducing on iOS v15.3 (demo images attached)
First time opening:
Second time opening:
Post not yet marked as solved
Hey,
I want to connect to an Wifi network setup by my IoT device.
I am using the following code to do so:
public class WifiUtil: NSObject{
private func connect(...) {
if #available(iOS 11.0, *) {
let configuration = initHotspotConfiguration(ssid: sSSID, passphrase: sPassword, security: sSecurity)
configuration.joinOnce = bJoinOnce ?? false
NEHotspotConfigurationManager.shared.apply(configuration) { [weak self] (error) in
guard let this = self else {
print("WiFi network not found")
result(false)
return
}
this.getSSID { (sSSID) -> () in
if (error != nil) {
if (error?.localizedDescription == "already associated.") {
print("Connected to '\(sSSID ?? "<Unknown Network>")'")
result(true)
} else {
print("Not Connected")
result(false)
}
} else if let ssid = sSSID {
print("Connected to " + ssid)
// ssid check is required because if wifi not found (could not connect) there seems to be no error given
result(ssid == sSSID)
} else {
print("WiFi network not found")
result(false)
}
}
}
} else {
print("Not Connected")
result(nil)
return
}
}
private func getSSID(result: @escaping (String?) -> ()) {
if #available(iOS 14.0, *) {
NEHotspotNetwork.fetchCurrent(completionHandler: { currentNetwork in
result(currentNetwork?.ssid);
})
} else {
if let interfaces = CNCopySupportedInterfaces() as NSArray? {
for interface in interfaces {
if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? {
result(interfaceInfo[kCNNetworkInfoKeySSID as String] as? String)
return
}
}
}
result(nil)
}
}
}
The code basically calls NEHotspotConfigurationManager.shared.apply and the checks if WiFi network is same as requested with NEHotspotNetwork.fetchCurrent. This is as per the docs:
Apple Docs for apply(_:completionHandler:)
The system calls your completion handler when it has applied the Wi-Fi level configuration. A successful configuration doesnʼt mean the device has joined that Wi-Fi network. To get the current Wi-Fi state, call fetchCurrent(completionHandler:).
I am getting the following error while fetching the SSID of current network: [] NEHotspotNetwork nehelper sent invalid result code [1] for Wi-Fi information request. But the phone connects to the network successfully.
I added some delay (incremental 1s upto 15s) before checking - it works sometimes but not always.
Strangely, when I make the connect request twice - it always works the second time.
Any help to fix this will be appreciated. Thanks in advance.
Post not yet marked as solved
Our app includes a share extension that allows you to share images which are uploaded and stored in S3. Prior to iOS 15 this generally worked without any issues.
I am now getting the following error with the background upload session, but only after the first share.
An error occurred on the xpc connection requesting pending callbacks for the background session: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service with pid 126 named com.apple.nsurlsessiond"
In other words if I share 5 images they all upload fine. If I try to upload an additional 5 the first one usually succeeds and the rest all fail with the above error.
Wondering if anyone else has seen this issue and has any thoughts on how to address this.