{"id":42417434,"url":"https://github.com/taboola/taboola-ios-lite","last_synced_at":"2026-01-28T02:06:40.084Z","repository":{"id":288411428,"uuid":"967297942","full_name":"taboola/taboola-ios-lite","owner":"taboola","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-19T10:02:41.000Z","size":35877,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-19T11:13:19.748Z","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/taboola.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-16T08:35:11.000Z","updated_at":"2025-11-19T10:02:45.000Z","dependencies_parsed_at":"2025-04-18T01:07:04.120Z","dependency_job_id":"2d4d8155-9525-42a7-91a1-c5d83db9efd8","html_url":"https://github.com/taboola/taboola-ios-lite","commit_stats":null,"previous_names":["taboola/taboola-ios-lite"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/taboola/taboola-ios-lite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taboola%2Ftaboola-ios-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taboola%2Ftaboola-ios-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taboola%2Ftaboola-ios-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taboola%2Ftaboola-ios-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taboola","download_url":"https://codeload.github.com/taboola/taboola-ios-lite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taboola%2Ftaboola-ios-lite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28833505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"online","status_checked_at":"2026-01-28T02:00:06.943Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-01-28T02:06:39.376Z","updated_at":"2026-01-28T02:06:40.078Z","avatar_url":"https://github.com/taboola.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Taboola iOS Lite SDK Documentation\n\nThe Taboola Lite SDK allows developers to easily integrate Taboola's personalized content recommendations into their iOS applications. This documentation provides all the necessary steps and details to set up and use the SDK.\n\n---\n\n## Prerequisites\n\nBefore you begin, ensure your project meets the following requirements:\n\n- **Minimum iOS Version**: 14.0\n- **Xcode**: 13.0 or later\n- **Swift**: 5.0 or later\n\n---\n\n## Installation\n\n### Swift Package Manager\n\n1. In Xcode, go to File \u003e Add Packages\n2. Enter the package URL: `https://github.com/taboola/taboola-ios-lite`\n3. Select the version you want to use by setting the branch name\n4. Click Add Package\n\n### Manual Installation\n\n1. Download the latest release from GitHub\n2. Drag the `TaboolaLite.xcframework` into your Xcode project\n3. Make sure \"Copy items if needed\" is checked\n4. Select your target and select \"Do Not Embed\" (the framework is static)\n\n---\n\n## Getting Started\n\n### 1. Initialize the SDK\n\nThe `TBLSDK.initialize` method must be called before using any other SDK functionality. Initialize the SDK in your `AppDelegate`.\n\u003e **Important:** You must wait for `onTaboolaInitializationComplete` with status `SUCCESS` before calling `setupTaboolaNews`. Calling it earlier will result in `SDK_NOT_INITIALIZED` error.\n\n```swift\nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool {\n    let publisherId = \"your-publisher-id\"\n    let userData = TBLUserData(\n        email: email,\n        globalUserId: globalUserId,\n        allowPersonalization: true,\n        allowDeviceContext: true\n    )\n    let newsParams = TBLNewsParams() // Empty for standard flow\n\n    TBLSDK.shared.initialize(publisherId: publisherId, data: userData, newsParams: newsParams, onTaboolaListener: OnTBLListener())\n    return true\n}\n```\n\n* **Parameters**:\n\n  * `publisherId`: A valid Taboola PublisherId (e.g., `publisherId`).\n  * `userData`: An instance of `TBLUserData` containing user-specific data (email, globalUserId, and consent preferences).\n  * `newsParams`: An instance of `TBLNewsParams` containing referral data (pass empty `TBLNewsParams()` for standard flow).\n  * `onTaboolaListener`: An implementation of `OnTBLListener` for lifecycle callbacks.\n\n### 2. Add Taboola to a View\n\nOnce SDK is initialized (after receiving SUCCESS from `onTaboolaInitializationComplete`), add Taboola content using `TBLSDK.setupTaboolaNews`:\n\n```swift\nclass NewsViewController: UIViewController {\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        TBLSDK.shared.setupTaboolaNews(view: view, onTBLNewsListener: OnTBLNewsListener())\n    }\n}\n```\n\n### 3. Remove Taboola Content\n\nWhen you're done with the Taboola content, remove it from the view:\n\n```swift\noverride func viewWillDisappear(_ animated: Bool) {\n    super.viewWillDisappear(animated)\n    TBLSDK.shared.removeTaboolaNewsFromView()\n}\n```\n\n### 4. Set User Data (Optional)\n\nYou can update user data at any time. When `setUserData` is called, the WebView will automatically reload with the new data - no need to call `initialize` again:\n\n```swift\nlet userData = TBLUserData(\n    email: \"user@example.com\",\n    globalUserId: \"user-123\",\n    allowPersonalization: true,  // Set to false if user opts out\n    allowDeviceContext: true      // Set to false to limit device data collection\n)\nTBLSDK.shared.setUserData(userData)\n```\n\n* **Parameters**:\n  * `email`: User's email address\n  * `globalUserId`: Unique identifier for the user\n  * `allowPersonalization`: Controls whether personalized recommendations are enabled (default: true)\n  * `allowDeviceContext`: Controls whether device context data is collected (default: true)\n\n### 5. Set News Parameters (Optional)\n\nYou can update news parameters after initialization. This is useful when the news tab is opened from different sources (e.g., from a chat tab banner with referral data):\n\n#### Scenario 1: News Tab Opened Directly (Standard Flow)\nIf the user opens the news tab by tapping on the tab itself, no referral data is needed:\n\n```swift\n// User clicks the news tab\nlet newsParams = TBLNewsParams()\nTBLSDK.shared.initialize(publisherId: publisherId, data: userData, newsParams: newsParams, onTaboolaListener: onTaboolaListener)\n```\n\n#### Scenario 2: News Tab Opened from Chat Tab Banner (CTB)\nIf the user opens the news tab by clicking a news banner, you need to pass the referral data:\n\n1. **Get Data from Deeplink**: When the user clicks the CTB, your deeplink will contain a `jd` query parameter (e.g., `line://nv/newsRow?jd=v2_fdfsdf`).\n2. **Extract the `jd` value** from the deeplink.\n3. **Create the TBLNewsParams object**:\n\n```swift\nlet newsParams = TBLNewsParams(referralCode: TBLReferralCode.CHAT_PAGE, journeyData: jd)\n```\n\n4. **Pass the object to the SDK** using one of these methods:\n\n   **a)** If `initialize` has not been called yet, pass the `newsParams` directly:\n   ```swift\n   TBLSDK.shared.initialize(publisherId: publisherId, data: userData, newsParams: newsParams, onTaboolaListener: onTaboolaListener)\n   ```\n\n   **b)** If `initialize` has already been called, use the `setNewsParams()` function:\n   ```swift\n   TBLSDK.shared.setNewsParams(newsParams)\n   ```\n\n### 6. Cleanup on App Termination\n\nTo properly clean up SDK resources when the app terminates, add the following to your AppDelegate:\n\n```swift\nfunc applicationWillTerminate(_ application: UIApplication) {\n    TBLSDK.shared.deinitialize()\n}\n```\n\nThis ensures that all SDK resources are properly released when the app is terminated.\n\n---\n\n## Listener Interfaces\n\n### Taboola Event Listeners\n\n#### OnTBLListener\n\nThe `OnTBLListener` interface listens to global SDK events:\n\n```swift\npublic protocol OnTBLListener: AnyObject {\n    func onTaboolaInitializationComplete(statusCode: TBLStatusCode)\n    func onTaboolaLoadComplete(statusCode: TBLStatusCode)\n    func onTaboolaSharePressed(url: String)\n}\n```\n\n* **onTaboolaInitializationComplete**: Called when the SDK initialization finishes.\n* **onTaboolaLoadComplete**: Called when the creation of the Taboola WebView completes.\n* **onTaboolaSharePressed**: Triggered when a user presses the share button.\n\n#### OnTBLNewsListener\n\nThe `OnTBLNewsListener` interface allows you to listen for news-fragment events from Taboola:\n\n```swift\npublic protocol OnTBLNewsListener: AnyObject {\n    func onTaboolaNewsSetupComplete(statusCode: TBLStatusCode)\n    func onTaboolaNewsRefreshComplete(statusCode: TBLStatusCode)\n    func onTaboolaNewsClickComplete(statusCode: TBLStatusCode)\n}\n```\n\n* **onTaboolaNewsSetupComplete**: Called when the Taboola WebView is successfully added to the fragment.\n* **onTaboolaNewsRefreshComplete**: Called when the Taboola WebView finishes refreshing content.\n* **onTaboolaNewsClickComplete**: Called when clicking on opening category or item.\n\nThe `TBLStatusCode` enum includes the following statuses\nEach status also includes a `message` property that provides a user-friendly description, which can be used for logging or displaying error messages in the UI:\n\n- SUCCESS (200): \"Success\"\n- BAD_REQUEST (400): \"Bad Request - Please check your input.\"\n- SERVICE_UNAVAILABLE (503): \"Service Unavailable - Try again later.\"\n- PUBLISHER_INVALID (-1): \"Publisher Invalid - Please contact support.\"\n- WEB_VIEW_NOT_FOUND(-2): \"WebView Not Found - Please check if you deinitialized the SDK.\"\n- SDK_DISABLED(-3): \"SDK Disabled - SDK functionality has been disabled.\"\n- SDK_NOT_INITIALIZED(-4): \"SDK Not Initialized - Please call initialize() first.\"\n- INVALID_VIEW_GROUP(-5): \"Invalid View - View must be a ViewGroup and not null.\"\n- TIMEOUT(-6):\"Timeout - Try again later.\"\n\n---\n\n\n## Lifecycle Management\n\n### Pause/Resume Taboola Content\n\nWhen your app goes to background or returns to foreground:\n\n```swift\n// In AppDelegate\nfunc applicationDidEnterBackground(_ application: UIApplication) {\n    TBLSDK.shared.onPauseTaboolaNews()\n}\n\nfunc applicationWillEnterForeground(_ application: UIApplication) {\n    TBLSDK.shared.onResumeTaboolaNews()\n}\n```\n\n### Scroll to Top\n\nTo programmatically scroll the Taboola content to the top:\n\n```swift\nTBLSDK.shared.onScrollToTopTaboolaNews()\n```\n\n---\n\n## Advanced Configuration\n\n### Set Log Level\n\nTo control the log verbosity of the SDK, you can set the log level as follows:\n\n```swift\nTBLSDK.shared.setLogLevel(TBLLogLevel.debug) // Options: .error, .warn, .info, .debug\n```\n\n### Update Reload Intervals (Testing Only)\n\nFor testing purposes, you can configure the reload intervals for the WebView content:\n\n```\nTBLSDK.shared.updateReloadIntervals(\n    1, // Set WebView reload interval to 1 minutes\n    1  // Set timer repeat interval to 1 minutes\n)\n```\n\n## Changelog\n\n### Version 1.4.5\n- Added new referral type `chatTabAwareness` for chat tab native ad tracking.\n\n### Version 1.4.3\n- Framework is now static (changed from dynamic).\n\n### Version 1.4.2\n- Removed the configuration line that disables JavaScript (javaScriptEnabled = false) on the WebView.\n\n### Version 1.4.1\n- Framework is now dynamic (changed from static).\n\n### Version 1.4.0\n- `TBLUserData` now includes `allowPersonalization` and `allowDeviceContext` parameters (both default to `true`) to manage user data collection preferences.\n- Removed `setCollectUserData()` function - use `TBLUserData` consent parameters instead.\n\n### Version 1.3.0\n- Framework is now static (changed from dynamic).\n- Added `newsParams` parameter to `initialize` function for handling referral data from different sources (e.g., chat tab banner).\n- Added new `setNewsParams(_ newsParams: TBLNewsParams)` function to update news parameters after initialization.\n- Enhanced `setUserData` to automatically reload the WebView with new user data - no need to call `initialize` again.\n\n### Version 1.2.0\n- Change `TBLUserData` init with hashed email and GUID.\n- Change `setCollectUserData` to pass `allowPersonalization` and `allowDeviceContext`\n\n### Version 1.1.3\n- Add a fix to status bar color.\n- Add timout stutus to error handling.\n- Fix Auto refresh.\n\n### Version 1.1.2\n- Dynamic SDK\n\n### Version 1.1.1\n- Status bar color change\n\n### Version 1.1.0\n- Remove location code.\n- Not collection IDFA if no concent\n\n### Version 1.0.8\n- Enable deeplink in taboola webView\n- Fix wait for `onTaboolaInitializationComplete`\n- Remove collection of location\n- Fix security issue\n\n### Version 1.0.7\n- Added lifecycle-safe listener interfaces: `OnTBLListener`, `OnTBLNewsListener`\n- Expanded `TBLStatusCode` with full error message support\n- Added mandatory success-check requirement before calling `setupTaboolaNews`\n\n### Version 1.0.4\n- New function `setCollectUserData` to enable/disable collecting user data.\n- Add privacy manifest.\n- Fix error event handling (like when the publisher id is incorrect)\n\n### Version 1.0.3\n- Remove handle crash and error events.\n\n### Version 1.0.2\n- Send an error event if pull to refresh failes.\n- Handle click events in web pages.\n- Remove javascript bridge in non taboola pages.\n- Handle crash and error events.\n\n### Version 1.0.1\n- Added updateReloadIntervals method for testing WebView reload behavior\n- Added setLogLevel method for controlling SDK log verbosity\n\n### Version 1.0.0\n- Initial release of the Taboola Lite SDK\n- Includes user data configuration and publisher-specific settings\n- Provides lifecycle management for proper SDK initialization and cleanup\n- Supports event handling for Taboola content interactions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaboola%2Ftaboola-ios-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaboola%2Ftaboola-ios-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaboola%2Ftaboola-ios-lite/lists"}