iOS SDK - 구성 참조
이 문서는 iOS 애플리케이션용 Singular SDK에서 사용할 수 있는 모든 구성 옵션에 대한 포괄적인 참조를 제공합니다. SingularConfig 객체를 사용하면 추적 설정, 어트리뷰션 옵션, 개인정보 보호 제어 등을 포함하여 SDK의 동작을 사용자 지정할 수 있습니다. 각 구성 속성은 설명, 서명 및 실제 사용 예제와 함께 제공됩니다.
앱그룹명
SingularConfig.appGroupName 속성
기본 앱과 앱 확장 프로그램 간의 데이터 공유를 위한 앱 그룹 이름을 설정합니다. SDK로 앱 확장 프로그램을 사용할 때 필요합니다.
서명
@property (strong) NSString *appGroupName;
사용 예
// Set app group name for app extensions
config.appGroupName = "group.com.yourcompany.yourapp"
// Set app group name for app extensions
config.appGroupName = @"group.com.yourcompany.yourapp";
clipboardAttribution
엔터프라이즈 기능: 클립보드 기반 DDL을 사용하려면 엔터프라이즈 기능인 Singular WebSDK가 필요합니다. 계정에 이 기능을 사용 설정하려면 고객 성공 매니저에게 문의하세요.
SingularConfig.clipboardAttribution 속성
SDK에 클립보드 어트리뷰션을 활성화합니다. 활성화하면 SDK가 초기화 중에 디바이스 클립보드에서 어트리뷰션 링크를 확인합니다.
서명
@property (assign) BOOL clipboardAttribution;
사용 예시
// Enable clipboard attribution
config.clipboardAttribution = true
// Enable clipboard attribution
config.clipboardAttribution = YES;
전환값업데이트콜백
Singular 컨피규어 전환값 업데이트 콜백 속성
SKAdNetwork 전환 값이 업데이트될 때 호출할 콜백 함수를 설정합니다. 이를 통해 전환 값 변경에 대응할 수 있습니다.
서명
@property (copy) void(^conversionValueUpdatedCallback)(NSInteger);
사용 예시
// Set conversion value updated callback
config.conversionValueUpdatedCallback = { conversionValue in
print("Conversion value updated to: \(conversionValue)")
// Update UI or take other actions based on the new conversion value
}
// Set conversion value updated callback
config.conversionValueUpdatedCallback = ^(NSInteger conversionValue) {
NSLog(@"Conversion value updated to: %ld", (long)conversionValue);
// Update UI or take other actions based on the new conversion value
};
conversionValuesUpdatedCallback
Singular컨피그.conversionValuesUpdatedCallback 속성
SKAdNetwork 4.0 전환 값이 업데이트될 때 호출할 콜백 함수를 설정합니다. 이는 iOS 16.1 이상에만 해당되며 미세, 거친, 잠금 값의 변경에 반응할 수 있습니다.
서명
@property (copy) void(^conversionValuesUpdatedCallback)(NSNumber *, NSNumber *, BOOL);
사용 예시
// Set conversion values updated callback for SKAdNetwork 4.0
config.conversionValuesUpdatedCallback = { fineValue, coarseValue, lock in
print("Conversion values updated - Fine: \(fineValue ?? 0), Coarse: \(coarseValue ?? 0), Lock: \(lock)")
// Update UI or take other actions based on the new conversion values
}
// Set conversion values updated callback for SKAdNetwork 4.0
config.conversionValuesUpdatedCallback = ^(NSNumber *fineValue, NSNumber *coarseValue, BOOL lock) {
NSLog(@"Conversion values updated - Fine: %@, Coarse: %@, Lock: %d",
fineValue, coarseValue, lock);
// Update UI or take other actions based on the new conversion values
};
customSdid
SingularConfig.customSdid 속성
엔터프라이즈 기능: 사용자 지정 SDID(Singular 디바이스 ID)를 설정합니다. 이를 통해 Singular에서 생성된 장치 식별자를 사용하는 대신 고유한 장치 식별자를 제공할 수 있습니다.
서명
@property (strong) NSString *customSdid;
사용 예
// Set custom SDID
config.customSdid = "custom-device-id-12345"
// Set custom SDID
config.customSdid = @"custom-device-id-12345";
deviceAttributionCallback
Singular 컨피규어 디바이스 어트리뷰션 콜백 속성
베타 기능: 디바이스 어트리뷰션 데이터를 사용할 수 있을 때 호출할 콜백 함수를 설정합니다. 이를 통해 어트리뷰션 데이터를 사용할 수 있게 되는 즉시 데이터에 액세스할 수 있습니다.
서명
@property (copy) void(^deviceAttributionCallback)(NSDictionary *);
사용 예시
// Set device attribution callback
config.deviceAttributionCallback = { attributionData in
print("Attribution data received: \(attributionData)")
// Access specific attribution parameters
let campaign = attributionData["campaign"] as? String
let source = attributionData["source"] as? String
let adSet = attributionData["adSet"] as? String
// Update UI or take actions based on attribution data
if let campaign = campaign {
self.showCampaignSpecificContent(campaign)
}
}
// Set device attribution callback
config.deviceAttributionCallback = ^(NSDictionary *attributionData) {
NSLog(@"Attribution data received: %@", attributionData);
// Access specific attribution parameters
NSString *campaign = attributionData[@"campaign"];
NSString *source = attributionData[@"source"];
NSString *adSet = attributionData[@"adSet"];
// Update UI or take actions based on attribution data
if (campaign) {
[self showCampaignSpecificContent:campaign];
}
};
didSetSdidHandler
SingularConfig.didSetSdidHandler 속성
엔터프라이즈 기능: SDID(Singular 장치 ID)가 설정될 때 호출할 콜백 함수를 설정합니다. 이를 통해 사용자 지정 SDID가 성공적으로 설정되면 알림을 받을 수 있습니다.
서명
typedef void (^SdidAccessorHandler)(NSString *result);
@property (copy) SdidAccessorHandler didSetSdidHandler;
사용 예
// Set callback for when SDID is set
config.customSdid = "custom-device-id-12345"
config.didSetSdidHandler = { sdid in
print("SDID was set: \(sdid)")
// Perform any actions needed after SDID is set
}
// Set callback for when SDID is set
config.customSdid = @"custom-device-id-12345";
config.didSetSdidHandler = ^(NSString *sdid) {
NSLog(@"SDID was set: %@", sdid);
// Perform any actions needed after SDID is set
};
enableOdmWithTimeoutInterval
SingularConfig.enableOdmWithTimeoutInterval 속성
Google ODM(오가닉 데이터 측정) 검색을 위한 시간 초과 간격을 초 단위로 설정합니다. 이 기능은 구글 플레이에서 오가닉 인스톨 데이터를 검색하는 데 사용됩니다.
서명
@property (assign) NSInteger enableOdmWithTimeoutInterval;
사용 예시
// Enable Google ODM with 5 second timeout
config.enableOdmWithTimeoutInterval = 5
// Enable Google ODM with 5 second timeout
config.enableOdmWithTimeoutInterval = 5;
espDomains
SingularConfig.espDomains 속성
이메일 어트리뷰션에 사용할 ESP(이메일 서비스 제공업체) 도메인을 설정합니다. 이를 통해 어트리뷰션에 고려할 이메일 도메인을 지정할 수 있습니다.
서명
@property (strong) NSArray *espDomains;
사용 예
// Set ESP domains for email attribution
config.espDomains = ["mailchimp.com", "sendgrid.net", "campaign-monitor.com"]
// Set ESP domains for email attribution
config.espDomains = @[@"mailchimp.com", @"sendgrid.net", @"campaign-monitor.com"];
글로벌 프로퍼티
SingularConfig.globalProperties 속성
글로벌 속성 사전에 대한 읽기 전용 액세스를 제공합니다. 여기에는 구성에 대해 설정된 모든 전역 프로퍼티가 포함됩니다.
서명
@property (readonly) NSMutableDictionary *globalProperties;
사용 예시
// Access global properties
print("Global properties: \(config.globalProperties)")
// Access global properties
NSLog(@"Global properties: %@", config.globalProperties);
initWithApiKey
SingularConfig 초기화
API 키와 시크릿을 사용하여 새 SingularConfig 객체를 초기화합니다. 이는 Singular SDK를 구성하는 첫 번째 단계입니다.
서명
- (id)initWithApiKey:(NSString *)apikey andSecret:(NSString *)secret;
사용 예시
// Create configuration object
let config = SingularConfig(apiKey: "SDK KEY", andSecret: "YOUR_SECRET")
// Create configuration object
SingularConfig *config = [[SingularConfig alloc] initWithApiKey:@"SDK KEY"
andSecret:@"YOUR_SECRET"];
launchOptions
SingularConfig.launchOptions 속성
앱 델리게이트에서 실행 옵션 사전을 설정합니다. 딥링크 및 기타 실행 데이터를 처리하는 데 사용됩니다.
서명
@property (strong) NSDictionary *launchOptions;
사용 예시
// Set launch options from app delegate
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let config = SingularConfig(apiKey: "API_KEY", andSecret: "SECRET")
config.launchOptions = launchOptions
Singular.start(config)
return true
}
// Set launch options from app delegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
SingularConfig *config = [[SingularConfig alloc] initWithApiKey:@"API_KEY"
andSecret:@"SECRET"];
config.launchOptions = launchOptions;
[Singular start:config];
return YES;
}
limitAdvertisingIdentifiers
SingularConfig.limitAdvertisingIdentifiers 속성
광고 식별자 사용을 활성화 또는 비활성화합니다. 이 옵션은 SDK가 추적 및 어트리뷰션을 위해 디바이스 식별자를 수집하고 사용하는 방식에 영향을 줍니다.
서명
@property (assign) BOOL limitAdvertisingIdentifiers;
사용 예시
// Enable limited identifiers mode
config.limitAdvertisingIdentifiers = true
// Enable limited identifiers mode
config.limitAdvertisingIdentifiers = YES;
수동스캔컨버젼관리
SingularConfig.manualSkanConversionManagement 속성
SKAdNetwork 전환 값의 수동 관리를 활성화합니다. 활성화하면 SDK가 전환 값을 자동으로 업데이트하지 않으므로 수동으로 제어할 수 있습니다.
서명
@property (assign) BOOL manualSkanConversionManagement;
사용 예시
// Enable manual SKAdNetwork conversion management
config.manualSkanConversionManagement = true
// Enable manual SKAdNetwork conversion management
config.manualSkanConversionManagement = YES;
openUrl
SingularConfig.openUrl 속성
앱을 여는 데 사용되는 URL을 설정합니다. 이 프로퍼티는 사용자 지정 URL 체계 딥링크에 사용됩니다.
서명
@property (strong) NSURL *openUrl;
사용 예시
// Set open URL for custom URL schemes
func application(_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
let config = SingularConfig(apiKey: "API_KEY", andSecret: "SECRET")
config.openUrl = url
Singular.start(config)
return true
}
// Set open URL for custom URL schemes
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary *)options {
SingularConfig *config = [[SingularConfig alloc] initWithApiKey:@"API_KEY"
andSecret:@"SECRET"];
config.openUrl = url;
[Singular start:config];
return YES;
}
푸시알림링크경로
SingularConfig.pushNotificationLinkPath 속성
푸시 알림 페이로드에서 딥링크를 찾을 경로를 설정합니다. 이를 통해 SDK가 푸시 알림에서 어트리뷰션 링크를 찾고 처리하는 데 도움이 됩니다.
서명
@property (strong) NSArray<NSArray<NSString*>*> *pushNotificationLinkPath;
사용 예시
// Set push notification link paths
config.pushNotificationLinkPath = [
["data", "deeplink"],
["notification", "data", "url"],
["custom", "link"]
]
// Set push notification link paths
config.pushNotificationLinkPath = @[
@[@"data", @"deeplink"],
@[@"notification", @"data", @"url"],
@[@"custom", @"link"]
];
pushNotificationPayload
SingularConfig.pushNotificationPayload 속성
어트리뷰션에 대한 푸시 알림 페이로드를 설정합니다. 이를 통해 SDK가 초기화 중에 푸시 알림 데이터를 처리할 수 있습니다.
서명
@property (strong) NSDictionary *pushNotificationPayload;
사용 예시
// Set push notification payload
config.pushNotificationPayload = userInfo
// Set push notification payload
config.pushNotificationPayload = userInfo;
sdidReceivedHandler
SingularConfig.sdidReceivedHandler 속성
엔터프라이즈 기능: SDID(Singular 장치 ID)를 수신할 때 호출할 콜백 함수를 설정합니다. 이를 통해 SDID를 사용할 수 있게 되는 즉시 액세스할 수 있습니다.
서명
typedef void (^SdidAccessorHandler)(NSString *result);
@property (copy) SdidAccessorHandler sdidReceivedHandler;
사용 예
// Set callback for when SDID is received
config.sdidReceivedHandler = { sdid in
print("SDID received: \(sdid)")
// Store or use the SDID as needed
self.storeDeviceIdentifier(sdid)
}
// Set callback for when SDID is received
config.sdidReceivedHandler = ^(NSString *sdid) {
NSLog(@"SDID received: %@", sdid);
// Store or use the SDID as needed
[self storeDeviceIdentifier:sdid];
};
setGlobalProperty
SingularConfig.setGlobalProperty 메서드
SDK 초기화 중에 글로벌 프로퍼티를 설정합니다. 이 프로퍼티는 SDK에서 추적하는 모든 이벤트와 함께 전송됩니다. 프로퍼티가 아닌 메서드이므로 연쇄 구성이 가능합니다.
서명
- (void)setGlobalProperty:(NSString *)key
withValue:(NSString *)value
overrideExisting:(BOOL)overrideExisiting;
사용 예시
// Add global properties
config.setGlobalProperty("app_version",
withValue: "1.2.3",
overrideExisting: true)
config.setGlobalProperty("user_type",
withValue: "free",
overrideExisting: true)
// Add global properties
[config setGlobalProperty:@"app_version"
withValue:@"1.2.3"
overrideExisting:YES];
[config setGlobalProperty:@"user_type"
withValue:@"free"
overrideExisting:YES];
shortLinkResolveTimeOut
Singular 컨피규어 단축 링크 해결 시간 제한 속성
짧은 링크 확인에 대한 시간 제한을 초 단위로 설정합니다. 이 값은 SDK가 초기화를 계속하기 전에 짧은 링크가 해결될 때까지 기다리는 시간을 결정합니다. 기본값은 10초입니다.
서명
@property (assign) long shortLinkResolveTimeOut;
사용 예시
// Set short link resolve timeout to 15 seconds
config.shortLinkResolveTimeOut = 15
// Set short link resolve timeout to 15 seconds
config.shortLinkResolveTimeOut = 15;
singularLinksHandler
Singular 컨피규어 Singular링크 핸들러 속성
Singular가 처리하는 딥링크를 처리할 콜백 함수를 설정합니다. 이를 통해 앱이 어트리뷰션에 사용된 딥링크에 응답할 수 있습니다.
시그니처
@property (copy) void(^singularLinksHandler)(SingularLinkParams *);
사용 예시
// Set singular links handler
config.singularLinksHandler = { params in
// Check if we have a deep link
if let deeplink = params.deeplink {
print("Deep link received: \(deeplink)")
// Navigate based on the deep link
self.navigateToScreen(deeplink)
}
// Check if this is a deferred deep link
if params.isDeferred {
print("This is a deferred deep link")
}
// Access passthrough parameters
if let passthrough = params.passthrough {
print("Passthrough data: \(passthrough)")
}
}
// Set singular links handler
config.singularLinksHandler = ^(SingularLinkParams *params) {
// Check if we have a deep link
if (params.deeplink) {
NSLog(@"Deep link received: %@", params.deeplink);
// Navigate based on the deep link
[self navigateToScreen:params.deeplink];
}
// Check if this is a deferred deep link
if (params.isDeferred) {
NSLog(@"This is a deferred deep link");
}
// Access passthrough parameters
if (params.passthrough) {
NSLog(@"Passthrough data: %@", params.passthrough);
}
};
skAdNetworkEnabled
Singular컨피그.skAdNetworkEnabled 속성
SKAdNetwork 지원을 활성화 또는 비활성화합니다. SDK가 어트리뷰션에 Apple의 SKAdNetwork를 사용할지 여부를 제어합니다. 기본값은 YES입니다.
서명
@property (assign) BOOL skAdNetworkEnabled;
사용 예시
// Disable SKAdNetwork support if needed
config.skAdNetworkEnabled = false
// Disable SKAdNetwork support if needed
config.skAdNetworkEnabled = NO;
지원앱확장
Singular컨피그.지원앱확장 속성
앱 확장 지원을 활성화합니다. 활성화하면 SDK가 앱 확장 컨텍스트에서 제대로 작동할 수 있습니다.
서명
@property (assign) BOOL supportAppExtension;
사용 예제
// Enable app extension support
config.supportAppExtension = true
// Enable app extension support
config.supportAppExtension = YES;
userActivity
SingularConfig.userActivity 속성
유니버설 링크 처리를 위한 사용자 활동 객체를 설정합니다. 유니버설 링크를 통해 앱이 열릴 때 사용됩니다.
서명
@property (strong) NSUserActivity *userActivity;
사용 예시
// Set user activity for universal links
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
let config = SingularConfig(apiKey: "API_KEY", andSecret: "SECRET")
config.userActivity = userActivity
Singular.start(config)
return true
}
// Set user activity for universal links
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray *))restorationHandler {
SingularConfig *config = [[SingularConfig alloc] initWithApiKey:@"API_KEY"
andSecret:@"SECRET"];
config.userActivity = userActivity;
[Singular start:config];
return YES;
}
waitForTrackingAuthorizationWithTimeoutInterval
SingularConfig.waitForTrackingAuthorizationWithTimeoutInterval 속성
iOS 14+에서 사용자의 추적 권한 부여 응답을 기다리는 시간 초과 간격을 초 단위로 설정합니다. 이 프로퍼티는 SDK가 초기화를 계속하기 전에 ATT 프롬프트 응답을 기다리는 시간을 결정합니다.
서명
@property (assign) NSInteger waitForTrackingAuthorizationWithTimeoutInterval;
사용 예제
// Wait up to 60 seconds for ATT prompt response
config.waitForTrackingAuthorizationWithTimeoutInterval = 60
// Wait up to 60 seconds for ATT prompt response
config.waitForTrackingAuthorizationWithTimeoutInterval = 60;
전체 구성 예제
포괄적인 SDK 구성
다음 예는 여러 구성 속성을 함께 설정하여 포괄적인 구성을 만드는 방법을 보여줍니다.
전체 예제
// Create configuration with API credentials
let config = SingularConfig(apiKey: "SDK KEY", andSecret: "YOUR_SECRET")
// Set basic options
config.waitForTrackingAuthorizationWithTimeoutInterval = 60
config.clipboardAttribution = true
// Set global properties
config.setGlobalProperty("app_version",
withValue: "1.2.3",
overrideExisting: true)
config.setGlobalProperty("user_type",
withValue: "premium",
overrideExisting: true)
// Configure SKAdNetwork
config.skAdNetworkEnabled = true
config.manualSkanConversionManagement = false
config.conversionValueUpdatedCallback = { conversionValue in
print("Conversion value updated: \(conversionValue)")
}
// Configure deep links
config.launchOptions = launchOptions
config.singularLinksHandler = { params in
if let deeplink = params.deeplink {
print("Deep link received: \(deeplink)")
self.handleDeepLink(deeplink)
}
}
// Configure attribution callback
config.deviceAttributionCallback = { attributionData in
print("Attribution data: \(attributionData)")
}
// Start the SDK
Singular.start(config)
// Create configuration with API credentials
SingularConfig *config = [[SingularConfig alloc] initWithApiKey:@"SDK KEY"
andSecret:@"YOUR_SECRET"];
// Set basic options
config.waitForTrackingAuthorizationWithTimeoutInterval = 60;
config.clipboardAttribution = YES;
// Set global properties
[config setGlobalProperty:@"app_version"
withValue:@"1.2.3"
overrideExisting:YES];
[config setGlobalProperty:@"user_type"
withValue:@"premium"
overrideExisting:YES];
// Configure deep links
config.launchOptions = launchOptions;
config.singularLinksHandler = ^(SingularLinkParams *params) {
if (params.deeplink) {
NSLog(@"Deep link received: %@", params.deeplink);
[self handleDeepLink:params.deeplink];
}
};
// Start the SDK
[Singular start:config];