简体   繁体   中英

Whitelisting URLs in Firebase Dynamic Link

I setup a dynamic link to invite users to download my app or be sent to my website (I own the domain but haven't built it yet format: www.my-domain.com) with Firebase Dynamic Links. Firebase recommends whitelisting URL patterns in the Firebase console, however I am unfamiliar with the RE2 syntax they require.

There are examples on Firebase and so I tried two:

  1. ^ https://my-domain.com/ .*$

  2. ^ https://www.my-domain.com/ .*\wshare?\wshareProfileName=\wBecky%20\wThomas$ (where Becky Thomas is a users name & changes for each user)

I'm testing this on my iPhone and would expect this to work & be able to share the link however nothing happens and I receive the following error in the Xcode terminal:

"Error Domain=com.firebase.durabledeeplink Code=0 "We could not match param 'https://www.my-domain.com/share?shareProfileName=James%20Thomas ' with whitelisted URL patterns in your Google project. [ https://support.google.com/firebase/answer/9021429] [ https://support.google.com/firebase/answer/9021429] "

Any advice would be much appreciated

The example didn't work for me either, I got it working by removing some of the slashes. This is the pattern I'm using...

^https://example.com.*$

If you want to match sub domains too you can use this...

^https://.*example.com.*$

Use this expression:

^https://www\.my-domain\.com/share\?shareProfileName=.+$

It's more restrictive because only accept the exact url with different values for shareProfileName.

Test the expressions on https://regex101.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM