Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Privacy Manifest and SPM Support #25

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ playground.xcworkspace
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/
Package.resolved


# CocoaPods
#
Expand Down
31 changes: 31 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "mParticle-Apptentive",
platforms: [ .iOS(.v13) ],
BrandonStalnaker marked this conversation as resolved.
Show resolved Hide resolved
products: [
.library(
name: "mParticle-Apptentive",
targets: ["mParticle-Apptentive"]),
],
dependencies: [
.package(url: "https://github.com/mParticle/mparticle-apple-sdk",
.upToNextMajor(from: "8.0.0")),
.package(url: "https://github.com/apptentive/apptentive-kit-ios",
.upToNextMajor(from: "6.6.0")),
],
targets: [
.target(
name: "mParticle-Apptentive",
dependencies: [
.product(name: "mParticle-Apple-SDK", package: "mparticle-apple-sdk"),
.product(name: "ApptentiveKit", package: "apptentive-kit-ios"),
],
path: "mParticle-Apptentive",
exclude: ["Info.plist"],
publicHeadersPath: "."),
]
)
4 changes: 2 additions & 2 deletions mParticle-Apptentive.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/mparticle-integrations/mparticle-apple-integration-apptentive.git", :tag => s.version.to_s }
s.social_media_url = "https://twitter.com/mparticle"
s.swift_version = "5.5"
s.ios.deployment_target = "11.0"
s.ios.deployment_target = "13.0"
s.ios.source_files = 'mParticle-Apptentive/*.{h,m,mm}'
s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 8.7'
s.ios.dependency 'ApptentiveKit', '~> 6.1'
s.ios.dependency 'ApptentiveKit', '~> 6.6'
end
4 changes: 4 additions & 0 deletions mParticle-Apptentive.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
D330F1682BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D330F1672BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy */; };
D37EFA8724F430580091B75B /* ApptentiveKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB695FB21F5F549A00A7F4CF /* ApptentiveKit.framework */; platformFilter = ios; };
DB7E05A61CB819D300967FDF /* MPKitApptentive.h in Headers */ = {isa = PBXBuildFile; fileRef = DB7E05A41CB819D300967FDF /* MPKitApptentive.h */; settings = {ATTRIBUTES = (Public, ); }; };
DB7E05A71CB819D300967FDF /* MPKitApptentive.m in Sources */ = {isa = PBXBuildFile; fileRef = DB7E05A51CB819D300967FDF /* MPKitApptentive.m */; };
Expand All @@ -29,6 +30,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
D330F1672BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
DB695FB21F5F549A00A7F4CF /* ApptentiveKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApptentiveKit.framework; path = Carthage/Build/iOS/ApptentiveKit.framework; sourceTree = "<group>"; };
DB7E05A41CB819D300967FDF /* MPKitApptentive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPKitApptentive.h; sourceTree = "<group>"; };
DB7E05A51CB819D300967FDF /* MPKitApptentive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPKitApptentive.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -89,6 +91,7 @@
children = (
DB7E05A41CB819D300967FDF /* MPKitApptentive.h */,
DB7E05A51CB819D300967FDF /* MPKitApptentive.m */,
D330F1672BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy */,
EF23381C263F48B2004B1C55 /* MPKitApptentiveUtils.h */,
EF23381D263F48B2004B1C55 /* MPKitApptentiveUtils.m */,
DB94016F1CB703F2007ABB18 /* mParticle_Apptentive.h */,
Expand Down Expand Up @@ -203,6 +206,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D330F1682BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
12 changes: 7 additions & 5 deletions mParticle-Apptentive/MPKitApptentive.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#import "MPKitApptentive.h"
#import "MPKitApptentiveUtils.h"

#if defined(__has_include) && __has_include(<ApptentiveKit/ApptentiveKit-Swift.h>)
#import <ApptentiveKit/ApptentiveKit-Swift.h>
#elif defined(__has_include) && __has_include(ApptentiveKit-Swift.h)
#import "ApptentiveKit-Swift.h"
#if SWIFT_PACKAGE
@import ApptentiveKit;
#else
@import ApptentiveKit;
#if __has_include(<ApptentiveKit/ApptentiveKit-Swift.h>)
#import <ApptentiveKit/ApptentiveKit-Swift.h>
#else
#import "ApptentiveKit-Swift.h"
#endif
#endif

static NSString * const apptentiveAppKeyKey = @"apptentiveAppKey";
Expand Down
18 changes: 18 additions & 0 deletions mParticle-Apptentive/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict/>
</array>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict/>
</array>
</dict>
</plist>