1

I'm building an Safari app extension with a main view with a button to enable the extension in safari preferences.

The button uses this code:

    SFSafariApplication.showPreferencesForExtension(withIdentifier: "com.bry.teste.teste1") { (error) in
        if error != nil {
            print("Error launching the extension's preferences: %@", error);
            return;
        }
    }

"com.bry.teste" is the bundle ID and "com.bry.teste.teste1" is the extension bundle ID

The thing is, this code works in my Mac OSX which version is = 10.13.1 I just send it to another friend with the same OS and it works as well.

BUT, I send it to another 2 friends that uses 10.12.6 (Sierra) and doesn't work.

The code print this error: Optional(Error Domain=SFErrorDomain Code=1 "(null)")

I think it means that the extension id doesn't exist, but in another topic someone says that this is related to the extension owner or something.

I can't figure out why it does work in 10.13 and not in 12.6, safariServices are supported by 12+ OS.

Any hints?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38

1 Answers1

2

It's correct to use the extension bundle ID. But this doesn't always work as expected when you debug your main app or extension.

To fully test it out, archive your app and export with your developer (installer) profile, move the exported app to /Applications and run it.

James Chen
  • 10,794
  • 1
  • 41
  • 38