edey
edey

Reputation: 159

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

Upvotes: 4

Views: 5101

Answers (2)

mabg
mabg

Reputation: 2092

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/

Upvotes: 0

Cameron
Cameron

Reputation: 381

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.*$

Upvotes: 6

Related Questions