Skip to content

Commit

Permalink
Feature/notification service extension (#263)
Browse files Browse the repository at this point in the history
* Add new target, KarteNotificationServiceExtension

* Add podsped file

* Supports NotificationExtension Module in some scripts

* Fix version number

* Add NotificationServiceExtension to Package.swift

* Update CHANGELOG

* Exclude jazzy target

* Apply swift name

* Add to Danger target

* Bump up spm version
  • Loading branch information
watanave authored Jan 14, 2022
1 parent 857eed6 commit 1fa7fd4
Show file tree
Hide file tree
Showing 19 changed files with 669 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Please fill in as much of the template below as you can.
- KarteVariables x.x.x
- KarteVisualTracking x.x.x
- KarteUtilities x.x.x
- KarteNotificationServiceExtension x.x.x

## iOS Version

Expand Down
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@
- KarteDetectors/**
'Module:Utilities':
- KarteUtilities/**
'Module:NotificationServiceExtension':
- KarteNotificationServiceExtension/**
'Test':
- KarteTests/**
1 change: 1 addition & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ exclude:
- KarteCore/Core/AppInfo/*
- KarteCore/Tracking/Client/*
- KarteInAppMessaging/Preview/*
- KarteNotificationServiceExtension/*
1 change: 1 addition & 0 deletions .slather.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ binary_basename:
- KarteVariables
- KarteCrashReporting
- KarteUtilities
- KarteNotificationServiceExtension
2 changes: 1 addition & 1 deletion .spm-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0
2.2.0
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ included:
- KarteVariables
- KarteVisualTracking
- KarteCrashReporting
- KarteNotificationServiceExtension

excluded:
- KarteUtilities/ThirdParty
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
| KarteVisualTracking | ビジュアルトラッキング機能を提供します。 | 2.7.0 |
| KarteCrashReporting | クラッシュイベントのトラッキング機能を提供します。 | 2.4.0 |
| KarteUtilities | KarteCore モジュール等が利用するUtility機能を提供します。通常直接参照する必要はありません。 | 3.6.0 |
| KarteNotificationServiceExtension | リッチプッシュ通知機能を提供します。 | 1.0.0 |

# Releases - 2022.1.12

Expand Down
2 changes: 1 addition & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'fastlane'
Fastlane.load_actions

$diff_files = (git.added_files + git.modified_files + git.deleted_files)
$modules = ["Utilities", "Core", "InAppMessaging", "RemoteNotification", "Variables", "VisualTracking", "CrashReporting"]
$modules = ["Utilities", "Core", "InAppMessaging", "RemoteNotification", "Variables", "VisualTracking", "CrashReporting", "NotificationServiceExtension"]
$formatted_tags = git.tags.map { |tag| tag.strip }

$is_develop_pr = github.branch_for_base == "develop" && github.branch_for_head.start_with?("feature/")
Expand Down
151 changes: 151 additions & 0 deletions Karte.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@
500813C52703EC8000805FA7 /* ObjcCompatibleScope.swift in Sources */ = {isa = PBXBuildFile; fileRef = 500813C42703EC8000805FA7 /* ObjcCompatibleScope.swift */; };
500813C82703ED3100805FA7 /* KRTTracker+Variables.h in Headers */ = {isa = PBXBuildFile; fileRef = 500813C62703ED3100805FA7 /* KRTTracker+Variables.h */; settings = {ATTRIBUTES = (Public, ); }; };
500813C92703ED3100805FA7 /* KRTTracker+Variables.m in Sources */ = {isa = PBXBuildFile; fileRef = 500813C72703ED3100805FA7 /* KRTTracker+Variables.m */; };
5013526F277AB8E60026E1F9 /* KarteNotificationServiceExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 5013526E277AB8E60026E1F9 /* KarteNotificationServiceExtension.h */; settings = {ATTRIBUTES = (Public, ); }; };
5013527B277AC90C0026E1F9 /* KRTNotificationServiceExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 50135279277AC90C0026E1F9 /* KRTNotificationServiceExtension.h */; settings = {ATTRIBUTES = (Public, ); }; };
5013527C277AC90C0026E1F9 /* KRTNotificationServiceExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 5013527A277AC90C0026E1F9 /* KRTNotificationServiceExtension.m */; };
50135280277AC9A20026E1F9 /* KarteAttributesPayload.h in Headers */ = {isa = PBXBuildFile; fileRef = 5013527E277AC9A20026E1F9 /* KarteAttributesPayload.h */; settings = {ATTRIBUTES = (Private, ); }; };
50135281277AC9A20026E1F9 /* KarteAttributesPayload.m in Sources */ = {isa = PBXBuildFile; fileRef = 5013527F277AC9A20026E1F9 /* KarteAttributesPayload.m */; };
5089E1712701F64B00D1C77C /* KRTApp+RemoteNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 5089E16F2701F64B00D1C77C /* KRTApp+RemoteNotification.h */; settings = {ATTRIBUTES = (Public, ); }; };
5089E1722701F64B00D1C77C /* KRTApp+RemoteNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = 5089E1702701F64B00D1C77C /* KRTApp+RemoteNotification.m */; };
50E1E45427219090008CD346 /* DIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50E1E45327219090008CD346 /* DIHelper.swift */; };
Expand Down Expand Up @@ -889,6 +894,12 @@
500813C42703EC8000805FA7 /* ObjcCompatibleScope.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjcCompatibleScope.swift; sourceTree = "<group>"; };
500813C62703ED3100805FA7 /* KRTTracker+Variables.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KRTTracker+Variables.h"; sourceTree = "<group>"; };
500813C72703ED3100805FA7 /* KRTTracker+Variables.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "KRTTracker+Variables.m"; sourceTree = "<group>"; };
5013526C277AB8E60026E1F9 /* KarteNotificationServiceExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = KarteNotificationServiceExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5013526E277AB8E60026E1F9 /* KarteNotificationServiceExtension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KarteNotificationServiceExtension.h; sourceTree = "<group>"; };
50135279277AC90C0026E1F9 /* KRTNotificationServiceExtension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KRTNotificationServiceExtension.h; sourceTree = "<group>"; };
5013527A277AC90C0026E1F9 /* KRTNotificationServiceExtension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KRTNotificationServiceExtension.m; sourceTree = "<group>"; };
5013527E277AC9A20026E1F9 /* KarteAttributesPayload.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KarteAttributesPayload.h; sourceTree = "<group>"; };
5013527F277AC9A20026E1F9 /* KarteAttributesPayload.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KarteAttributesPayload.m; sourceTree = "<group>"; };
5089E16F2701F64B00D1C77C /* KRTApp+RemoteNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KRTApp+RemoteNotification.h"; sourceTree = "<group>"; };
5089E1702701F64B00D1C77C /* KRTApp+RemoteNotification.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "KRTApp+RemoteNotification.m"; sourceTree = "<group>"; };
50E1E45327219090008CD346 /* DIHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DIHelper.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -991,6 +1002,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
50135269277AB8E60026E1F9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand Down Expand Up @@ -1347,6 +1365,7 @@
0C8974582379050600098CD8 /* KarteVisualTracking */,
0C2B3C6D2382684C008A2708 /* KarteCrashReporting */,
0C060E992384D76C006AF974 /* KarteUtilities */,
5013526D277AB8E60026E1F9 /* KarteNotificationServiceExtension */,
0CE792E423862C9C00F0D932 /* KarteTests */,
0C6FE21722F3F41C00F2FD28 /* Products */,
0C6FE2D222F826CA00F2FD28 /* Frameworks */,
Expand All @@ -1365,6 +1384,7 @@
0C2B3C6C2382684C008A2708 /* KarteCrashReporting.framework */,
0C060E982384D76C006AF974 /* KarteUtilities.framework */,
0CE792E323862C9C00F0D932 /* KarteTests.xctest */,
5013526C277AB8E60026E1F9 /* KarteNotificationServiceExtension.framework */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -2165,6 +2185,26 @@
path = Common;
sourceTree = "<group>";
};
5013526D277AB8E60026E1F9 /* KarteNotificationServiceExtension */ = {
isa = PBXGroup;
children = (
5013527D277AC9910026E1F9 /* Private */,
5013526E277AB8E60026E1F9 /* KarteNotificationServiceExtension.h */,
50135279277AC90C0026E1F9 /* KRTNotificationServiceExtension.h */,
5013527A277AC90C0026E1F9 /* KRTNotificationServiceExtension.m */,
);
path = KarteNotificationServiceExtension;
sourceTree = "<group>";
};
5013527D277AC9910026E1F9 /* Private */ = {
isa = PBXGroup;
children = (
5013527E277AC9A20026E1F9 /* KarteAttributesPayload.h */,
5013527F277AC9A20026E1F9 /* KarteAttributesPayload.m */,
);
path = Private;
sourceTree = "<group>";
};
680C29B22446B95900FB1363 /* Client */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2292,6 +2332,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
50135267277AB8E60026E1F9 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
50135280277AC9A20026E1F9 /* KarteAttributesPayload.h in Headers */,
5013527B277AC90C0026E1F9 /* KRTNotificationServiceExtension.h in Headers */,
5013526F277AB8E60026E1F9 /* KarteNotificationServiceExtension.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -2454,6 +2504,24 @@
productReference = 0CE792E323862C9C00F0D932 /* KarteTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
5013526B277AB8E60026E1F9 /* KarteNotificationServiceExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = 50135272277AB8E60026E1F9 /* Build configuration list for PBXNativeTarget "KarteNotificationServiceExtension" */;
buildPhases = (
50135267277AB8E60026E1F9 /* Headers */,
50135268277AB8E60026E1F9 /* Sources */,
50135269277AB8E60026E1F9 /* Frameworks */,
5013526A277AB8E60026E1F9 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = KarteNotificationServiceExtension;
productName = KarteNotificationServiceExtension;
productReference = 5013526C277AB8E60026E1F9 /* KarteNotificationServiceExtension.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
Expand Down Expand Up @@ -2502,6 +2570,9 @@
0CFB1F39243475D000BC8757 = {
CreatedOnToolsVersion = 11.4;
};
5013526B277AB8E60026E1F9 = {
CreatedOnToolsVersion = 13.2.1;
};
};
};
buildConfigurationList = 0C6FE21022F3F41C00F2FD28 /* Build configuration list for PBXProject "Karte" */;
Expand All @@ -2524,6 +2595,7 @@
0C897689237BBA5300098CD8 /* KarteRemoteNotification */,
0C2B3C6B2382684C008A2708 /* KarteCrashReporting */,
0C060E972384D76C006AF974 /* KarteUtilities */,
5013526B277AB8E60026E1F9 /* KarteNotificationServiceExtension */,
0CE792E223862C9C00F0D932 /* KarteTests */,
0CCB410A23D82743000B5AB9 /* Build */,
0CFB1F39243475D000BC8757 /* Build-Universal */,
Expand Down Expand Up @@ -2600,6 +2672,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
5013526A277AB8E60026E1F9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -3070,6 +3149,15 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
50135268277AB8E60026E1F9 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5013527C277AC90C0026E1F9 /* KRTNotificationServiceExtension.m in Sources */,
50135281277AC9A20026E1F9 /* KarteAttributesPayload.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
Expand Down Expand Up @@ -3825,6 +3913,60 @@
};
name = Release;
};
50135270277AB8E60026E1F9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GENERATE_INFOPLIST_FILE = YES;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = io.karte.KarteNotificationServiceExtension;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
50135271277AB8E60026E1F9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GENERATE_INFOPLIST_FILE = YES;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = io.karte.KarteNotificationServiceExtension;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand Down Expand Up @@ -3927,6 +4069,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
50135272277AB8E60026E1F9 /* Build configuration list for PBXNativeTarget "KarteNotificationServiceExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
50135270277AB8E60026E1F9 /* Debug */,
50135271277AB8E60026E1F9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 0C6FE20D22F3F41C00F2FD28 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5013526B277AB8E60026E1F9"
BuildableName = "KarteNotificationServiceExtension.framework"
BlueprintName = "KarteNotificationServiceExtension"
ReferencedContainer = "container:Karte.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5013526B277AB8E60026E1F9"
BuildableName = "KarteNotificationServiceExtension.framework"
BlueprintName = "KarteNotificationServiceExtension"
ReferencedContainer = "container:Karte.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
25 changes: 25 additions & 0 deletions KarteNotificationServiceExtension.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Be sure to run `pod lib lint KarteNotificationServiceExtension.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
s.name = 'KarteNotificationServiceExtension'
s.version = '1.0.0'
s.summary = 'KARTE Notification Service Extension'
s.homepage = 'https://karte.io/'
s.author = { 'PLAID' => '[email protected]' }
s.documentation_url = 'https://developers.karte.io/docs/ios-sdk'
s.license = { :type => 'Apache', :file => 'LICENSE' }

s.platform = :ios
s.ios.deployment_target = '10.0'

s.source = { :git => 'https://github.com/plaidev/karte-ios-sdk.git', :tag => "NotificationServiceExtension-#{s.version}" }
s.source_files = 'KarteNotificationServiceExtension/**/*.{swift,h,m}'

s.requires_arc = true
end
Loading

0 comments on commit 1fa7fd4

Please sign in to comment.