Customize Attribution to Snap
Overview
Each Camera Kit integrations is required to include Snap branding elements consistent with the Design Guidelines. This page provides options to implement these within your app.
iOS Integration
Option 1: Snap Provided Reference UI
In Camera Kit SDK version 1.18.0 and above, Snap's attribution label is automatically added to the camera preview by Snap's Reference UI
. To include attribution to Snap, update Podfile to version 1.18.0 or later, and run pod install
:
pod 'SCSDKCameraKit', '1.18.0'
pod 'SCSDKCameraKitReferenceUI', '1.18.0'
pod 'SCSDKCameraKitReferenceSwiftUI', '1.18.0'
Once the Snap Terms of Service dialog has been accepted by the user, the “Powered by Snapchat” attribution will be displayed in the bottom right corner of the screen for all orientations. In the sample app, this is done in the CameraView
.
Option 2: Using a Custom View
If you are using a custom view, you can add the attribution as a subview using the SnapAttributionView
where the correct width constraint has already been set. To change the position of the view, the auto layout constraints can be set/modified.
Here is an example of using SnapAttributionView, adding it as a subview, and setting up its constraints:
let snapAttributionView: SnapAttributionView = {
let view = SnapAttributionView()
view.translatesAutoresizingMaskIntoConstraints = false
return view}()
func setupSnapAttributionView() {
addSubview(snapAttributionView)
NSLayoutConstraint.activate([
snapAttributionView.bottomAnchor.constraint(equalTo: bottomAnchor),
trailingAnchor.constraint(equalToSystemSpacingAfter: snapAttributionView.trailingAnchor,
multiplier: 2.0),
])
}