1. 添加URL Scheme

将(datatist.xxxxxxxxxxxxxxxx)到项目中,以便唤醒您的程序进行圈选,其中xxxxxxxxxxxxxxxx为营销云中的siteId; 如下图所示:

image

2. 在AppDelegate中添加激活圈选的代码

- (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
    if ([DatatistTracker handleUrl:url])
    {
        return YES;
    }
    return NO;
}

若您在AppDelegate中实现了以下一个或多个方法,请在已实现的函数中,调用[DatatistTracker handleUrl:]

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(id)annotation
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options

若以上所有方法均未实现,请实现以下方法并调用[DatatistTracker handleUrl:]

- (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options

3. 设置可视化定义的上传地址和引入JS代码的地址

初始化SDK之后,进行以下配置

[DatatistTracker sharedInstance].visualDefineUrl = @“https://analyzer.datatist.com”;
[DatatistTracker sharedInstance].visualJSUrl = @"https://analyzer.datatist.com";

4. 注意事项

请确保

如果是UIWebVIew,确保实现并执行了 webViewDidFinishLoad:

如果是WKWebVIew,确保实现并执行了 webView:didFinishNavigation:

否则会影响内嵌H5页面的可视化定义

© Datatist all right reserved,powered by Gitbook更新时间: 2019-01-18 17:55:30

results matching ""

    No results matching ""