Pedro A
Pedro A

Reputation: 4333

How to use PATTERN_ADVANCED_GLOB in android manifest intent-filter data?

Reading the docs on the <data> element of android manifest, three different path specification rules are shown:

But on the docs of the PatternMatcher class there is also a PATTERN_ADVANCED_GLOB, yet the manifest documentation does not seem to mention it anywhere. Is it possible to use PATTERN_ADVANCED_GLOB in the manifest file? What is the syntax?

Upvotes: 3

Views: 1586

Answers (2)

Mark
Mark

Reputation: 7718

Seems that android:pathAdvancedPattern was introduced in API26 but only documented in late 2022 (between September and December)

Note: R.attr.pathAdvancedPattern documentation was added early 2021 with the the API 31 (Android S) documentation drop.

H/T https://proandroiddev.com/how-to-handle-deep-link-with-complex-path-like-this-811216a0c802

The pathAdvancedPattern is claimed to work with API 26, but experiments on the Pixel emulator have shown that prior to API 31, the attribute is ignored and intent-filter accepts any path. Perhaps the behaviour will be different when testing on real devices and devices with shells from other vendors. I’ve also tested pathAdvancedPattern on my Samsung, One UI 4.1, Android 12.0 and the behaviour was not different.

Upvotes: 1

Morrison Chang
Morrison Chang

Reputation: 12121

No.

Reminder, PATTERN_ADVANCED_GLOB was only introduced in API 26 for the PatternMatcher class.

Intent filters in the manifest have limited matching capability, and any change would have to maintain backward compatibility.

See: How to use PathPattern in order to create DeepLink Apps Android?

Upvotes: 4

Related Questions