'Get user-added parameter from Firebase Dynamic Link iOS

I have Firebase Dynamic Link with custom parameter id

https://someapp.page.link/Hnsd?id=0101

How can I get id parameter in app?

Or how is it possible to get this url https://someapp.page.link/Hnsd?id=0101 in app?



Solution 1:[1]

url encode id=0101

https://someapp.page.link/Hnsd?id=0101 to https://someapp.page.link/Hnsd?id%3D0101 convert

this worked for me

Solution 2:[2]

You can handle the received deep link in App delegate like this

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
        
        guard let incomingUrl = userActivity.webpageURL else { return false }

        let handled = DynamicLinks.dynamicLinks().handleUniversalLink(incomingUrl) { (dynamicLink, error) in

            if let url = dynamicLink?.url{
                let id= url["id"]
                print(id) //Prints 0101
            }
        }
        return handled
    }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ???
Solution 2