Other SDK Customizations
Braze Log Level
The default LogLevel for the Braze iOS SDK is 8
. This level suppresses most logging so that no sensitive information is logged in a production released application.
To enable verbose logging for debugging, add a dictionary named Appboy
to your Info.plist
file. Inside the Appboy
Dictionary, add the LogLevel
String subentry and set the value to 0
.
LogLevel 0
is only intended to be used in development environments and should not be set in a released application.
Example Info.plist
contents:
1
2
3
4
5
<key>Appboy</key>
<dict>
<key>LogLevel</key>
<string>0</string>
</dict>
Description of Log Levels
LogLevel | Description |
---|---|
0 | All log information will be logged to the iOS console |
8 | Default, minimal logging. |
Optional IDFA Collection
IDFA Collection is optional within the Braze SDK and disabled by default. IDFA Collection is required if you intend to utilize our install attribution integrations. However, we may develop additional features in the future which would benefit from the collection of your IDFA. If you opt to store your IDFA, we will store it free of charge so you may take advantage of these options immediately upon release without additional development work.
As a result, we recommend continuing to collect the IDFA if you meet any of the following criteria:
- You are using advertising elsewhere in the app
- You are attributing app installation to a previously served advertisement
- You are attributing an action within the application to a previously served advertisement
iOS 14 AppTrackingTransparency
Apple has temporarily reverted the proposed per-app IDFA access change in iOS 14 until 2021. For now, prompting for permission with AppTrackingTransparency
is not required, but you should be prepared for a future release from Apple which will require it to be implemented.
When the AppTrackingTransparency
prompt is required, in addition to implementing Braze’s ABKIDFADelegate
protocol, your application will need to request authorization using Apple’s ATTrackingManager
in the App Tracking Transparency framework. For more information, please reference this Braze iOS 14 guide, Apple’s Overview, and Apple’s Developer Documentation. In iOS 14, collecting IDFA will require building with Xcode 12, collecting IDFA will Xcode 11 is not possible in iOS 14.
The prompt for App Tracking Transparency authorization also requires an Info.plist
entry to explain your usage of the identifier:
1
2
<key>NSUserTrackingUsageDescription</key>
<string>To retarget ads and build a global profile to better serve you things you would like.</string>
Implementing IDFA Collection
Follow these steps to implement IDFA Collection:
Step 1: Implement ABKIDFADelegate
Create a class that conforms to the ABKIDFADelegate
protocol. For a contextual example, see IDFADelegate
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#import "IDFADelegate.h"
#import <AdSupport/ASIdentifierManager.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>
@implementation IDFADelegate
- (NSString *)advertisingIdentifierString {
return [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
}
- (BOOL)isAdvertisingTrackingEnabledOrATTAuthorized {
if (@available(iOS 14, *)) {
return [ATTrackingManager trackingAuthorizationStatus] == ATTrackingManagerAuthorizationStatusAuthorized;
}
return [[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled];
}
@end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Appboy_iOS_SDK
import AdSupport
import AppTrackingTransparency
class IDFADelegate: NSObject, ABKIDFADelegate {
func advertisingIdentifierString() -> String {
return ASIdentifierManager.shared().advertisingIdentifier.uuidString
}
func isAdvertisingTrackingEnabledOrATTAuthorized() -> Bool {
if #available(iOS 14, *) {
return ATTrackingManager.trackingAuthorizationStatus == ATTrackingManager.AuthorizationStatus.authorized
}
return ASIdentifierManager.shared().isAdvertisingTrackingEnabled
}
}
Step 2: Set the delegate during Braze initialization
In the appboyOptions
dictionary passed to startWithApiKey:inApplication:withAppboyOptions:
, set the ABKIDFADelegateKey
key to an instance of your ABKIDFADelegate
conforming class.
Approximate iOS SDK Size
The approximate iOS SDK framework file size is 30MB and the approximate .ipa (addition to app file) size is between 1MB and 2MB.
Braze measures the size of our iOS SDK by observing the SDK’s effect on .ipa
size, per Apple’s recommendations on app sizing. If you are calculating the iOS SDK’s size addition to your application, we recommend following the steps under “Getting an App Size Report” to compare the size difference in your .ipa
before and after integrating the Braze iOS SDK. When comparing sizes from the App Thinning Size Report, we also recommend looking at app sizes for thinned .ipa
files, as universal .ipa
files will be larger than the binaries downloaded from the App Store and installed onto user devices.
If you are integrating via CocoaPods with
use_frameworks!
, setEnable Bitcode = NO
in target’s Build Settings for accurate sizing.