「IDGraph iOS Tracking Code」修訂間的差異
跳至導覽
跳至搜尋
imported>Wikiuser (新頁面: 在AppDelegate的didFinishLaunchingWithOptions function中,帶入Service id初始化TAMIdGraphManager即可完成追蹤碼的建置。<br/> 其中Service id就是TAMedia提供給您的...) |
imported>Wikiuser |
||
| 行 31: | 行 31: | ||
return true | return true | ||
} | } | ||
[[IDGraph_iOS_SDK_Developer_Guide|回IDGraph iOS guide]] | |||
於 2017年11月13日 (一) 08:40 的修訂
在AppDelegate的didFinishLaunchingWithOptions function中,帶入Service id初始化TAMIdGraphManager即可完成追蹤碼的建置。
其中Service id就是TAMedia提供給您的服務id。
請參考以下範例
Objective-c
在AppDelegate.m內加入#import <TAMIdGraph/TAMIdGraph.h>
#import <TAMIdGraph/TAMIdGraph.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[TAMIdGraphManager initTAMIdGraphManagerWithServiceId:@"Your service id"];
return YES;
}
Swift
在YourProjectName-Bridging-Header.h內加入
#import <TAMIdGraph/TAMIdGraph.h>
在AppDelegate.swift內實作
import UIKit
import TAMIdGraph
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
TAMIdGraphManager.initTAMIdGraphManager(withServiceId:"Your Service Id")
return true
}