{"id":21478230,"url":"https://github.com/appsflyersdk/appsflyer-urlresolver-client","last_synced_at":"2025-06-15T20:10:33.752Z","repository":{"id":37822836,"uuid":"410544537","full_name":"AppsFlyerSDK/appsflyer-urlresolver-client","owner":"AppsFlyerSDK","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-12T10:52:25.000Z","size":152,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-02T11:51:01.906Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AppsFlyerSDK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-09-26T12:22:29.000Z","updated_at":"2021-11-03T10:46:47.000Z","dependencies_parsed_at":"2022-07-18T01:16:56.718Z","dependency_job_id":"3e96e86d-bf46-432b-ba4e-3439e13fedba","html_url":"https://github.com/AppsFlyerSDK/appsflyer-urlresolver-client","commit_stats":null,"previous_names":["appsflyersdk/appsflyerurlresolver"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AppsFlyerSDK%2Fappsflyer-urlresolver-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AppsFlyerSDK%2Fappsflyer-urlresolver-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AppsFlyerSDK%2Fappsflyer-urlresolver-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AppsFlyerSDK%2Fappsflyer-urlresolver-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AppsFlyerSDK","download_url":"https://codeload.github.com/AppsFlyerSDK/appsflyer-urlresolver-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997162,"owners_count":20380981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T11:17:19.450Z","updated_at":"2025-03-17T08:23:20.197Z","avatar_url":"https://github.com/AppsFlyerSDK.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cimg src=\"https://raw.githubusercontent.com/AppsFlyerSDK/appsflyer-capacitor-plugin/main/assets/AFLogo_primary.png\"  width=\"600\" \u003e\n\n# AppsFlyer URL Resolver\n\nThe AppsFlyer URLResolver library is a simple tool to perform redirections of a URL and get a final URL from it. \n\n## Table of contents\n- [Installation](#Installation)\n     - [Android Installation](#AndroidInstallation)\n     - [iOS Installation](#iOSInstallation)\n- [API](#API)\n    - [Android API](#AndroidAPI)\n    - [iOS API](#iOSAPI)\n- [Debug](#Debug)\n- [Support](#Support)\n\n\n## \u003ca id=\"Installation\"\u003e Installation  \n ### \u003ca id=\"AndroidInstallation\"\u003e Android  \n Install the URLResolver library using Gradle. \u003cbr\u003e\n **Step 1: Declare repositories**  \nIn the Project `build.gradle` file, declare the `mavenCentral` repository:\n```groovy\n allprojects {  \n      repositories {  \n           mavenCentral()\n      }  \n   }  \n```\n**Step 2: Add dependency**\nIn the application  `build.gradle`  file, add the dependency to [latest version of library](https://mvnrepository.com/artifact/com.appsflyer/appsflyer-url-resolver):\n```groovy  \n   dependencies {  \n      implementation 'com.appsflyer:appsflyer-url-resolver:1.0.0'\n   }  \n```\n ### \u003ca id=\"iOSInstallation\"\u003e iOS  \n #### \u003cu\u003eSwift Package Manger (SPM)\u003c/u\u003e\n **Step 1: Navigate to Add Package Dependency**  \nIn Xcode, go to **File** \u003e **Add Packages** \n\n**Step 2: Add iOS SDK GitHub repository**  \nEnter the AppsFlyer SDK GitHub repository:  \n`https://github.com/AppsFlyerSDK/AppsFlyerURLResolver.git`\n\n**Step 3: Select SDK version**\n\n**Step 4: Add AppsFlyerURLResolver to desired Target**\n \n #### \u003cu\u003eCocoapods\u003c/u\u003e\n **Step 1: Download CocoaPods**  \n[Download and install](https://guides.cocoapods.org/using/getting-started.html#installation)  the latest version of CocoaPods.\n\n**Step 2: Add dependencies**  \nAdd the  [latest version of  `AppsFlyerURLResolver`](https://github.com/AppsFlyerSDK/AppsFlyerURLResolver/releases/latest)  to your project's Podfile:\n\n```\npod 'AppsFlyerURLResolver'\n```\n\n**Step 3: Install dependencies**  \nIn your terminal, navigate to your project's root folder and run  `pod install`.\n\n**Step 4: Open Xcode workspace**  \nIn Xcode, use the  `.xcworkspace`  file to open the project from this point forward, instead of the  `.xcodeproj`  file.\n\n #### \u003cu\u003eCarthage\u003c/u\u003e\n**Step 1: Install Carthage**  \n[Install](https://github.com/Carthage/Carthage#installing-carthage)  the latest version of Carthage.\n\n**Step 2: Add dependencies**  \nAdd the following line to your  `Cartfile` :\n```\ngithub \"AppsFlyerSDK/AppsFlyerURLResolver\" ~\u003e 1.0.0\n```\n## \u003ca id=\"API\"\u003eAPI\n### \u003ca id=\"AndroidAPI\"\u003eAndroid\n\n### `resolve`\n**Method signature**\n```kotlin\nfun resolve(url: String?,maxRedirections: Int = 10, urlResolverListener: URLResolverListener)\n```\n**Description**\nResolve a given URL. \nThis function will perform redirects until it gets to the final URL or up to the maximum redirects. The function will return the last URL address.\n* `null` URL will return `null`. \n* An invalid URL will return the original input (passed in the `url` parameter).\n\n**Input arguments**\n|Type|Name|Description|\n|--|--|--|\n|String?|url|The URL to resolve|\n|Int|maxRedirections|The maximum redirections to relove. The default value is 10 Redirections|\n|URLResolverListener|urlResolverListener|The listener for the output of the URL resolving\n\n\n**Example**\n```kotlin\n  override fun onDeepLinking(deepLinkResult: DeepLinkResult) {\n        if (deepLinkResult.status == DeepLinkResult.Status.FOUND) {\n            URLResolver().resolve(deepLinkResult.deepLink?.deepLinkValue, 5, object : URLResolverListener {\n            override fun onComplete(url: String?) {\n            \tLog.d(TAG, \"final URL: $url\")\n            }\n        })\n        }\n    }\n```\n### `resolveJSRedirection`\n**Method signature**\n```kotlin\nfun fun resolveJSRedirection(url: String?, urlResolverListener: URLResolverListener) \n```\n**Description**\u003cbr\u003e\nUse this API if you want to perform redirection based on JS (Hubspot). This api extracts the link from the JS code and returns it to the `urlResolverListener` callback for forther redirections.\n* `null` URL will return `null`. \n* An invalid URL will return the original input (passed in the `url` parameter).\n\n**Input arguments**\n|Type|Name|Description|\n|--|--|--|\n|String?|url|The URL to resolve|\n|URLResolverListener|urlResolverListener|The listener for the output of the URL resolving\n\n\n**Example**\n```kotlin\nURLResolver(true).resolveJSRedirection(\"my-url\"){\n    Log.d(TAG, \"The URL is: $it\")\n}\n```\n\n### \u003ca id=\"iOSAPI\"\u003eiOS\n### `resolve`\n**Method signature**\n```swift\nresolve(url: String?, maxRedirections: Int  =  10 , completionHandler: @escaping (String?) -\u003e  Void)\n```\n**Description**\nResolve a given URL. \nThis function will perform redirects until to final URL or up to the maximum redirects. The function will return the last URL address using the completion handler.\n* `nil` URL will return `nil`. \n* Not a vailid URL will return the input to the function (`url` parameter).\n\n**Input arguments**\n|Type|Name|Description|\n|--|--|--|\n|String?|url|The URL to resolve|\n|Int|maxRedirections|The maximum redirections to relove. The default value is 10 Redirections|\n|@escaping (String?) -\u003e  Void|completionHandler|Completion handler that will return the result as a optional string| \n\n\n**Example**\n```swift\n  // add this import\n import AppsFlyerURLResolver\n    \n func didResolveDeepLink(_ result: DeepLinkResult) {\n        if result.status == .found{\n            URLResolver().resolve(url: result.deepLink?.deeplinkValue, maxRedirections: 9){ res in\n                print(\"The URL is: \\(res ?? \"nil\")\")\n            }\n        }\n    }\n```\n\n### `resolveJSRedirection`\n**Method signature**\n```swift\nresolveJSRedirection(url: String?, completionHandler :  @escaping (String?) -\u003e Void)\n```\n**Description**\u003cbr\u003e\nUse this api if you want to perform redirection based on JS. This api extracts the link from the JS code and returns it to the `completion handler` for forther redirections.\n* `nil` URL will return `nil`. \n* Not a vailid URL will return the input to the function (`url` parameter).\n\n**Input arguments**\n|Type|Name|Description|\n|--|--|--|\n|String?|url|The URL to resolve|\n|@escaping (String?) -\u003e  Void|completionHandler|Completion handler that will return the result as a optional string| \n\n\n**Example**\n```swift\n  // add this import\n import AppsFlyerURLResolver\n    \nURLResolver().resolveJSRedirection(url: \"my-url\"){ res in\n    print(\"The URL is: \\(res ?? \"nil\")\")\n}\n```\n## \u003ca id=\"Debug\"\u003e Debug  \nThe logs are disabled by default. \nYou can enable the debugging logs by adding `true`  as the argument for the URLResolver() constructor.\n\n### Android\n```Kotlin\nURLResolver(true)\n```\n\n### iOS\n```swift\nURLResolver(isDebug: true)\n```\n\n\n## \u003ca id=\"Support\"\u003e Support \n\n🛠 In order for us to provide optimal support, we would kindly ask you to submit any issues to support@appsflyer.com\n\n*When submitting an issue please specify your AppsFlyer sign-up (account) email , your app ID , production steps, logs, code snippets and any additional relevant information.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappsflyersdk%2Fappsflyer-urlresolver-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappsflyersdk%2Fappsflyer-urlresolver-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappsflyersdk%2Fappsflyer-urlresolver-client/lists"}