BrowserID for iOS Using Swift

Related tags

Layout browserid-ios
Overview

browserid-ios

Almost a clone of https://github.com/amedia/browserid

For generating and providing a browser id and a browser visit id to a WebView. Used e.g. in Common Schema in ADPLogger.

Usage

Installation

Click on File -> Swift Packages -> Add Package Dependency and type in the git repository’s URL. Select branch master, the package’s products that you need, and add them to specific targets in your project.

Once you click on Finish, the Swift Package Dependencies section will show the newly added package.

Usage and requirements

import BrowserID

...

In a ViewController

Use method initBrowserId on the webView. Takes one param.

for: String. The domain/host to set the cookie on, if missing.

var webView: WKWebView!

...

override func viewWillAppear(_ animated: Bool) {

    super.viewWillAppear(animated)
    
    let plainURL = URL(string: AppConfig.urlEndpoints.homeScreen)!
        
    // Init domainBrowserId and domainVisitId, via BrowserID
    if let domain = plainURL.host {
        webView.initBrowserId(for: domain)
    }
    
    let request = URLRequest(url: url)
    configureCustomUserAgent(webView: webView) { [weak self] in
        self?.webView.load(request)
    }

    ...
}

More methods

BrowserID.shared.getBrowserId()

Get persisted BrowserID, uuid, (unique for app install).

BrowserID.shared.getVisitId()

Get visitID, refreshed each 30 mins, uuid.

BrowserID.shared.getLastSessionTimestamp()

Get lastSessionTimestamp, epoch time.

You might also like...
An experiment creating a particle emitter using the new TimelineView and Canvas views in SwiftUI
An experiment creating a particle emitter using the new TimelineView and Canvas views in SwiftUI

Particle Emitter An experiment creating a particle emitter using the new Timelin

A simple checklist app using UIKit
A simple checklist app using UIKit

UIKit Checklist App Data Persistence Icon Selector Notification Scheduling Multi

A simple game application using SpriteKit, physics, blend modes, radians and CGFloat
A simple game application using SpriteKit, physics, blend modes, radians and CGFloat

Pachinko A simple game application using SpriteKit, physics, blend modes, radian

Using the UIKitChain framework, You can create a UIKit component in one line of code.
Using the UIKitChain framework, You can create a UIKit component in one line of code.

Using the UIKitChain framework, You can create a UIKit component in one line of code. Installation CocoaPods CocoaPods is a dependency manager for Coc

StoryboardUsingCustomViews - Storyboard Using Custom Views
StoryboardUsingCustomViews - Storyboard Using Custom Views

Storyboard Using Custom Views Vista creada con: Storyboard + Constraints + Progr

VerticalFlowLayout - This implementation is built using a UICollectionView and a custom flowLayout.
VerticalFlowLayout - This implementation is built using a UICollectionView and a custom flowLayout.

VerticalFlowLayout This implementation is built using a UICollectionView and a custom flowLayout. Table of contents Requirements Installation CocoaPod

Arrange views in your app’s interface using layout tools that SwiftUI provides.

Composing custom layouts with SwiftUI Arrange views in your app's interface using layout tools that SwiftUI provides. Overview This sample app demonst

VidyoPlatform Basic CustomLayouts Reference App for iOS (Swift)VidyoPlatform Basic CustomLayouts Reference App for iOS (Swift)

VidyoPlatform Basic CustomLayouts Reference App for iOS (Swift) VidyoPlatform reference application highlighting how to integrate video chat into a na

SwiftLanguageWeather-master - Swift Language Weather is an iOS weather app developed in Swift 4
SwiftLanguageWeather-master - Swift Language Weather is an iOS weather app developed in Swift 4

Swift Language Weather SwiftWeather has renamed to Swift Language Weather. Becau

Owner
Amedia Utvikling
Amedia Utvikling
Ios-quizzer - The app implements basic features of a quiz app using MVC pattern

Quizzer App The app implements basic features of a quiz app using MVC pattern.

Stefan 2 May 10, 2022
An awesome Swift CSS DSL library using result builders.

An awesome Swift CSS DSL library using result builders.

Binary Birds 57 Nov 21, 2022
Flexbox in Swift, using Facebook's css-layout.

SwiftBox A Swift wrapper around Facebook's implementation of CSS's flexbox. Example let parent = Node(size: CGSize(width: 300, height: 300),

Josh Abernathy 811 Jun 23, 2022
SuperLayout is a Swift library that makes using Auto Layout a breeze.

SuperLayout is a library that adds a few custom operators to Swift that makes using the amazing NSLayoutAnchor API for Auto Layout a breeze. SuperLayo

Lionheart Software 53 Oct 12, 2022
AppStoreClone - Understanding the complex layout of app store using UICompositional layout in swift

AppStoreClone Understanding the complex layout of app store using UICompositiona

Dheeraj Kumar Sharma 8 Dec 28, 2022
PhotoCatalog - PhotoCatalog Project Using Swift

PhotoCatalog Project Setup Clone the project from this link [email protected]:islam

Islam Ibrahim 0 Jan 30, 2022
This is a simple chat application made in Swift using send and receive interface.

Flash Chat ????‍♂️ Overview This is a simple chat application made in Swift using send and receive interface. ⚙️ How it works The user needs to first

Sougato Roy 2 Aug 4, 2022
Using Kiva's free API, the demo app retrieves its most recent fundraising loans

KivaLoan Kiva is a non-profit organization with a mission to connect people through lending to alleviate poverty. Using Kiva's free API, the demo app

DaryliOSdev 0 Nov 28, 2021
Content Hugging Priority settings using Auto Layout

AutoLayoutContentHugging Swift 5 and Xcode 12. Content Hugging Priority settings using Auto Layout. Content Hugging Priority give you granular control

Camila Rodrigues 0 Jan 21, 2022
This app presents few examples for common patterns using purer SwiftUI code

VIPERtoSwiftUI GOAL This app presents few examples for common patterns using purer (from authors experience) SwiftUI code. LITERATURE https://www.appy

Tomislav Gelešić 0 Dec 19, 2021