This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const userAgent = window.navigator.userAgent; | |
const consentCookie = []; // Set the current consent status if this is a returning visitor. | |
const attRejectedString = 'ATTRejected'; | |
const attAcceptedString = 'ATTAccepted'; | |
// Show the consent bar if the consent cookie is not set or if this is the in-app browser | |
const initConsentBar = () => { | |
if (consentCookie.length > 0) { | |
return; // Tracking consent was already given by the visitor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// And you would use this like so in your app's codebase: | |
/// | |
let webView = WKWebView() | |
webView.setCustomUserAgent(.att(self.isATTAccepted ? .accepted : .rejected)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WebKit | |
extension WKWebView { | |
/// WKWebView.customUserAgent value | |
enum CustomUserAgent { | |
/// ATT (App Tracking Transparency) | |
/// - ATTUserAgent: set this based on users ATT preferences | |
case att(ATTUserAgent) | |
} | |
/// ATTUserAgent possible values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// change these vars until your satisfied MAKE SURE THAT THE CANVAS HAS AN ID OF: "Bounce" AND HAS THE SAME HEIGHT AND WIDTH AS YOU SPECIFY HERE | |
var WIDTH =1000 //height of canvas | |
var HEIGHT = 1000; // width of canvas | |
var balls = 501; // amount of balls | |
var size = 15; // radius of the balls | |
var canvas; | |
var ctx; | |
var x = [1]; |