App Clips Causing CPSErrorDomain error 2 on Non App Clip URLs

Unexpected behavior encountered when scanning NFC tags.

Imagine a link shortener web service where users can create lots of different URLs that are hosted on the same domain eg, https://short.com/unique-path

The service has optional App Clip capability -- users can select any of their links and have the service create an App Clip for the selected link(s).

Users can encode their URLs into NFC tags and have their customers scan NFC tags.

Let's take just two URLs for example:

  1. https://short.com/foo
  2. https://short.com/bar

The /foo link does have an App Clip associated with it while /bar does not have it. Each link has been encoded into appropriate NFC tag.

Expected behavior when scanning from an iPhone:

  • /foo -- shows an App Clip popup.
  • /bar -- shows a "Open in Safari" default notification.

What's actually happening

  • /foo -- opens App Clip poput with correct metadata (title, subtitle, image) which is totally expected behavior.
  • /bar (the one that doesn't have app clip associated with it) -- opens an App-Clip-like popup with the following error: CPSErrorDomainError 2 (see attachment below)

So for some reason when someone scans an NFC tag with a URL that is not an App Clip and never has been -- it always shows that error regardless whether the URL exists or does not exist. I've tried few different/random URLs (which don't have an App Clip associated with it) and all of them show the same error.


Additional details:

  • All links use the same domain and URL format: domain.com/path where path is a short string of random a-Z characters.
  • All App Clips are created at the same iOS app.
  • AASA is good: Cache and Debug -- both green.
  • This issue has happened to lots of users on lots of different iPhones and iOS'.

Since the issue's been happening to lots of different users on different iPhone(s)/iOS' no sysdiagnose is attached. Actually it works the same on every device/iOS we've tried.


Before submitting the issue, I've found few other developers reporting the same issue.

What's interesting though is none of the links I've went through comes with a definite answer and it seems like this issue just randomly comes and goes without any specific changes on the server and/or iOS app.

Dropping the links of similar issues below.

I'm going to add more details here:

  • I've clicked "Clear Experience Cache" countless times.
  • Here's what Settings -> Developer -> App Clips Testing -> Diagnostics show for two URLs that are on the same domain but with different path (a.k.a /foo /bar at the example in the original post):

This is diagnostics data of the URL that does have an App Clip associated: https://short.com/foo

This is diagnostics data of the URL that does not have an App Clip associated: https://short.com/bar (Note: same domain, slightly different path)

One more use case of unexpected behavior with a new URL: /baz

/baz does have an App Clip associated within App Store Connect and works fine, as expected. But whenever someone deactivates it within App Store Connect, it starts showing the same CPSErrorDomain error 2.

What's interesting is I have another iOS that uses App Clips as well but on a different domain.

The App Clip settings look pretty much the same on both apps and AASA is fine on both domains as well.

However, it works perfectly fine on the other app. When the URL has an App Clip associated, it shows an App Clip popup. If it does not have it, it shows default Safari notification.

But on this app, it just keeps showing the CPSErrorDomain error 2 when the URL does not have App Clips associated with it or it has but it's been temporary deactivated.

Another interesting thing is when reading an NFC card that has just domain without path, it works as expected:

  • https://short.com -- Shows "Open in Safari" notification, expected behavior since there's no App Clip with this invocation URL.
  • https://short.com/ -- Shows "Open in Safari" notification, expected behavior since there's no App Clip with this invocation URL.
  • https://short.com/a -- Shows the CPSErrorDomain error 2 popup. There's no App Clip Invocations registered with this URL.

When checking these three URLs at Settings -> Developer -> App Clips Testing -> Diagnostics -- it shows the same information for all three URLs (it just shows the same as in the second Diagnostics screenshot I attached in replies above).

*Just a reminder that short.com is just an example domain here.

More information: the app clip itself is less than 1mb.

Here's another interesting thing that's happening.

I've tried clearing experience cache (Settings -> Developer -> App Clips Testing -> Clear Experience Cache) and immediately after that scanning URLs that don't have app clips as invocation URLs.

What sometimes (3 out of 10 attempts) started happening is this:

  1. Clear cache
  2. Scan NFC tag
  3. Shows "Open in Safari" notification // Expected behavior
  4. Scan NFC tag again
  5. Shows "No app clip available"
  6. Scan NFC tag again and again and again
  7. Shows "CPSError Domain error 2"

All other attempts it just shows CPSErrorDomain.

Just submitted a bug report. (sysdiagnose attached)

FB20563121

App Clips Causing CPSErrorDomain error 2 on Non App Clip URLs
 
 
Q