User ID and UIWebView
- iOS
- watchOS
- tvOS
Foreword
If your application uses a UIWebView and you wish to identify the user, you can retrieve the customer ID in order to pass it in a URL parameter of your UIWebView. By doing so, you can use this ID with JavaScript code, for example.
Tagging example
import UIKit
import Tracker
class ViewController: UIViewController {
let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
override func viewDidLoad() {
super.viewDidLoad()
let userId = tracker.getUserId()
}
}@interface ViewController ()
@property (nonatomic, strong) Tracker* tracker;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.tracker = [ATInternet sharedInstance].defaultTracker;
NSString *userId = [self.tracker getUserId];
}
@end