diff --git a/Example Project/SwiftingNotification/NotificationContentExtension/Base.lproj/MainInterface.storyboard b/Example Project/SwiftingNotification/NotificationContentExtension/Base.lproj/MainInterface.storyboard
new file mode 100644
index 0000000..f0db77e
--- /dev/null
+++ b/Example Project/SwiftingNotification/NotificationContentExtension/Base.lproj/MainInterface.storyboard
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/NotificationContentExtension/Info.plist b/Example Project/SwiftingNotification/NotificationContentExtension/Info.plist
new file mode 100644
index 0000000..26edbde
--- /dev/null
+++ b/Example Project/SwiftingNotification/NotificationContentExtension/Info.plist
@@ -0,0 +1,40 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleDisplayName
+ NotificationContentExtension
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ XPC!
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+ NSExtension
+
+ NSExtensionAttributes
+
+ UNNotificationExtensionDefaultContentHidden
+
+ UNNotificationExtensionCategory
+ customContentIdentifier
+ UNNotificationExtensionInitialContentSizeRatio
+ 0.7
+
+ NSExtensionMainStoryboard
+ MainInterface
+ NSExtensionPointIdentifier
+ com.apple.usernotifications.content-extension
+
+
+
diff --git a/Example Project/SwiftingNotification/NotificationContentExtension/NotificationViewController.swift b/Example Project/SwiftingNotification/NotificationContentExtension/NotificationViewController.swift
new file mode 100644
index 0000000..9c884e9
--- /dev/null
+++ b/Example Project/SwiftingNotification/NotificationContentExtension/NotificationViewController.swift
@@ -0,0 +1,28 @@
+//
+// NotificationViewController.swift
+// NotificationContentExtension
+//
+// Created by woroninb on 25/07/16.
+// Copyright © 2016 roche. All rights reserved.
+//
+
+import UIKit
+import UserNotifications
+import UserNotificationsUI
+
+class NotificationViewController: UIViewController, UNNotificationContentExtension {
+
+ @IBOutlet weak var webView: UIWebView!
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ let filePath = Bundle.main.path(forResource: "matrix", ofType: "gif")
+ let gif = NSData(contentsOfFile: filePath!)!
+ webView.load(gif as Data, mimeType: "image/gif", textEncodingName: String(), baseURL: URL(string: filePath!)!)
+ webView.isUserInteractionEnabled = false;
+ }
+
+ func didReceive(_ notification: UNNotification) {
+
+ }
+}
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/project.pbxproj b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..05ae18f
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/project.pbxproj
@@ -0,0 +1,506 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1F85A6DD1D44279E0006907C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F85A6DC1D44279E0006907C /* AppDelegate.swift */; };
+ 1F85A6DF1D44279E0006907C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F85A6DE1D44279E0006907C /* ViewController.swift */; };
+ 1F85A6E21D44279E0006907C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1F85A6E01D44279E0006907C /* Main.storyboard */; };
+ 1F85A6E41D44279E0006907C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1F85A6E31D44279E0006907C /* Assets.xcassets */; };
+ 1F85A6E71D44279E0006907C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1F85A6E51D44279E0006907C /* LaunchScreen.storyboard */; };
+ 1F9EE3CD1D5FB82700AD24F7 /* skrzypce.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1F9EE3CC1D5FB82700AD24F7 /* skrzypce.jpg */; };
+ 1F9EE3D11D607C6A00AD24F7 /* matrix.gif in Resources */ = {isa = PBXBuildFile; fileRef = 1F9EE3D01D607C6A00AD24F7 /* matrix.gif */; };
+ 1F9EE3D21D607C7000AD24F7 /* matrix.gif in Resources */ = {isa = PBXBuildFile; fileRef = 1F9EE3D01D607C6A00AD24F7 /* matrix.gif */; };
+ 1F9EE3D51D61AE9800AD24F7 /* NotificationButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F9EE3D41D61AE9800AD24F7 /* NotificationButton.swift */; };
+ 1F9EE3D81D61AF3B00AD24F7 /* NotificationContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F9EE3D71D61AF3B00AD24F7 /* NotificationContent.swift */; };
+ 1F9EE3DA1D61B42800AD24F7 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F9EE3D91D61B42800AD24F7 /* Helpers.swift */; };
+ 1FBF33CF1D46BC9700950439 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FBF33CE1D46BC9700950439 /* UserNotifications.framework */; };
+ 1FBF33D11D46BC9700950439 /* UserNotificationsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FBF33D01D46BC9700950439 /* UserNotificationsUI.framework */; };
+ 1FBF33D41D46BC9700950439 /* NotificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FBF33D31D46BC9700950439 /* NotificationViewController.swift */; };
+ 1FBF33D71D46BC9700950439 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1FBF33D51D46BC9700950439 /* MainInterface.storyboard */; };
+ 1FBF33DB1D46BC9700950439 /* NotificationContentExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 1FBF33CC1D46BC9700950439 /* NotificationContentExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+ 1FC4222F1D5E702C00917D25 /* Consts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FC4222E1D5E702C00917D25 /* Consts.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 1FBF33D91D46BC9700950439 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 1F85A6D11D44279D0006907C /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 1FBF33CB1D46BC9700950439;
+ remoteInfo = NotificationContentExtension;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 1FBF33DF1D46BC9700950439 /* Embed App Extensions */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 13;
+ files = (
+ 1FBF33DB1D46BC9700950439 /* NotificationContentExtension.appex in Embed App Extensions */,
+ );
+ name = "Embed App Extensions";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 1F85A6D91D44279E0006907C /* SwiftingNotification.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftingNotification.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1F85A6DC1D44279E0006907C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 1F85A6DE1D44279E0006907C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
+ 1F85A6E11D44279E0006907C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 1F85A6E31D44279E0006907C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
+ 1F85A6E61D44279E0006907C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
+ 1F85A6E81D44279E0006907C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 1F9EE3CC1D5FB82700AD24F7 /* skrzypce.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = skrzypce.jpg; sourceTree = ""; };
+ 1F9EE3D01D607C6A00AD24F7 /* matrix.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = matrix.gif; sourceTree = ""; };
+ 1F9EE3D41D61AE9800AD24F7 /* NotificationButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationButton.swift; sourceTree = ""; };
+ 1F9EE3D71D61AF3B00AD24F7 /* NotificationContent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationContent.swift; sourceTree = ""; };
+ 1F9EE3D91D61B42800AD24F7 /* Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = ""; };
+ 1FBF33CC1D46BC9700950439 /* NotificationContentExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NotificationContentExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1FBF33CE1D46BC9700950439 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
+ 1FBF33D01D46BC9700950439 /* UserNotificationsUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotificationsUI.framework; path = System/Library/Frameworks/UserNotificationsUI.framework; sourceTree = SDKROOT; };
+ 1FBF33D31D46BC9700950439 /* NotificationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationViewController.swift; sourceTree = ""; };
+ 1FBF33D61D46BC9700950439 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; };
+ 1FBF33D81D46BC9700950439 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 1FC4222E1D5E702C00917D25 /* Consts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Consts.swift; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 1F85A6D61D44279D0006907C /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1FBF33C91D46BC9700950439 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1FBF33D11D46BC9700950439 /* UserNotificationsUI.framework in Frameworks */,
+ 1FBF33CF1D46BC9700950439 /* UserNotifications.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 1F85A6D01D44279D0006907C = {
+ isa = PBXGroup;
+ children = (
+ 1F85A6DB1D44279E0006907C /* SwiftingNotification */,
+ 1FBF33D21D46BC9700950439 /* NotificationContentExtension */,
+ 1FBF33CD1D46BC9700950439 /* Frameworks */,
+ 1F85A6DA1D44279E0006907C /* Products */,
+ );
+ sourceTree = "";
+ };
+ 1F85A6DA1D44279E0006907C /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 1F85A6D91D44279E0006907C /* SwiftingNotification.app */,
+ 1FBF33CC1D46BC9700950439 /* NotificationContentExtension.appex */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 1F85A6DB1D44279E0006907C /* SwiftingNotification */ = {
+ isa = PBXGroup;
+ children = (
+ 1F9EE3D31D61AE3D00AD24F7 /* Media */,
+ 1F9EE3D61D61AEDC00AD24F7 /* Classes */,
+ 1FC4222E1D5E702C00917D25 /* Consts.swift */,
+ 1F85A6DC1D44279E0006907C /* AppDelegate.swift */,
+ 1F85A6DE1D44279E0006907C /* ViewController.swift */,
+ 1F85A6E01D44279E0006907C /* Main.storyboard */,
+ 1F85A6E31D44279E0006907C /* Assets.xcassets */,
+ 1F85A6E51D44279E0006907C /* LaunchScreen.storyboard */,
+ 1F85A6E81D44279E0006907C /* Info.plist */,
+ );
+ path = SwiftingNotification;
+ sourceTree = "";
+ };
+ 1F9EE3D31D61AE3D00AD24F7 /* Media */ = {
+ isa = PBXGroup;
+ children = (
+ 1F9EE3CC1D5FB82700AD24F7 /* skrzypce.jpg */,
+ 1F9EE3D01D607C6A00AD24F7 /* matrix.gif */,
+ );
+ name = Media;
+ sourceTree = "";
+ };
+ 1F9EE3D61D61AEDC00AD24F7 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 1F9EE3D41D61AE9800AD24F7 /* NotificationButton.swift */,
+ 1F9EE3D71D61AF3B00AD24F7 /* NotificationContent.swift */,
+ 1F9EE3D91D61B42800AD24F7 /* Helpers.swift */,
+ );
+ name = Classes;
+ sourceTree = "";
+ };
+ 1FBF33CD1D46BC9700950439 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1FBF33CE1D46BC9700950439 /* UserNotifications.framework */,
+ 1FBF33D01D46BC9700950439 /* UserNotificationsUI.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ 1FBF33D21D46BC9700950439 /* NotificationContentExtension */ = {
+ isa = PBXGroup;
+ children = (
+ 1FBF33D31D46BC9700950439 /* NotificationViewController.swift */,
+ 1FBF33D51D46BC9700950439 /* MainInterface.storyboard */,
+ 1FBF33D81D46BC9700950439 /* Info.plist */,
+ );
+ path = NotificationContentExtension;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 1F85A6D81D44279D0006907C /* SwiftingNotification */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1F85A6EB1D44279E0006907C /* Build configuration list for PBXNativeTarget "SwiftingNotification" */;
+ buildPhases = (
+ 1F85A6D51D44279D0006907C /* Sources */,
+ 1F85A6D61D44279D0006907C /* Frameworks */,
+ 1F85A6D71D44279D0006907C /* Resources */,
+ 1FBF33DF1D46BC9700950439 /* Embed App Extensions */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 1FBF33DA1D46BC9700950439 /* PBXTargetDependency */,
+ );
+ name = SwiftingNotification;
+ productName = SwiftingNotification;
+ productReference = 1F85A6D91D44279E0006907C /* SwiftingNotification.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 1FBF33CB1D46BC9700950439 /* NotificationContentExtension */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1FBF33DE1D46BC9700950439 /* Build configuration list for PBXNativeTarget "NotificationContentExtension" */;
+ buildPhases = (
+ 1FBF33C81D46BC9700950439 /* Sources */,
+ 1FBF33C91D46BC9700950439 /* Frameworks */,
+ 1FBF33CA1D46BC9700950439 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = NotificationContentExtension;
+ productName = NotificationContentExtension;
+ productReference = 1FBF33CC1D46BC9700950439 /* NotificationContentExtension.appex */;
+ productType = "com.apple.product-type.app-extension";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 1F85A6D11D44279D0006907C /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastSwiftUpdateCheck = 0800;
+ LastUpgradeCheck = 0800;
+ ORGANIZATIONNAME = roche;
+ TargetAttributes = {
+ 1F85A6D81D44279D0006907C = {
+ CreatedOnToolsVersion = 8.0;
+ DevelopmentTeam = 285YFT3K3J;
+ DevelopmentTeamName = "F. Hoffmann-La Roche Ltd.";
+ ProvisioningStyle = Automatic;
+ };
+ 1FBF33CB1D46BC9700950439 = {
+ CreatedOnToolsVersion = 8.0;
+ DevelopmentTeam = 285YFT3K3J;
+ DevelopmentTeamName = "F. Hoffmann-La Roche Ltd.";
+ ProvisioningStyle = Automatic;
+ };
+ };
+ };
+ buildConfigurationList = 1F85A6D41D44279D0006907C /* Build configuration list for PBXProject "SwiftingNotification" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 1F85A6D01D44279D0006907C;
+ productRefGroup = 1F85A6DA1D44279E0006907C /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 1F85A6D81D44279D0006907C /* SwiftingNotification */,
+ 1FBF33CB1D46BC9700950439 /* NotificationContentExtension */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 1F85A6D71D44279D0006907C /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1F9EE3D11D607C6A00AD24F7 /* matrix.gif in Resources */,
+ 1F85A6E71D44279E0006907C /* LaunchScreen.storyboard in Resources */,
+ 1F85A6E41D44279E0006907C /* Assets.xcassets in Resources */,
+ 1F9EE3CD1D5FB82700AD24F7 /* skrzypce.jpg in Resources */,
+ 1F85A6E21D44279E0006907C /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1FBF33CA1D46BC9700950439 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1FBF33D71D46BC9700950439 /* MainInterface.storyboard in Resources */,
+ 1F9EE3D21D607C7000AD24F7 /* matrix.gif in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 1F85A6D51D44279D0006907C /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1F9EE3D81D61AF3B00AD24F7 /* NotificationContent.swift in Sources */,
+ 1F9EE3DA1D61B42800AD24F7 /* Helpers.swift in Sources */,
+ 1F85A6DF1D44279E0006907C /* ViewController.swift in Sources */,
+ 1FC4222F1D5E702C00917D25 /* Consts.swift in Sources */,
+ 1F9EE3D51D61AE9800AD24F7 /* NotificationButton.swift in Sources */,
+ 1F85A6DD1D44279E0006907C /* AppDelegate.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1FBF33C81D46BC9700950439 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1FBF33D41D46BC9700950439 /* NotificationViewController.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 1FBF33DA1D46BC9700950439 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 1FBF33CB1D46BC9700950439 /* NotificationContentExtension */;
+ targetProxy = 1FBF33D91D46BC9700950439 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 1F85A6E01D44279E0006907C /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1F85A6E11D44279E0006907C /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 1F85A6E51D44279E0006907C /* LaunchScreen.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1F85A6E61D44279E0006907C /* Base */,
+ );
+ name = LaunchScreen.storyboard;
+ sourceTree = "";
+ };
+ 1FBF33D51D46BC9700950439 /* MainInterface.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1FBF33D61D46BC9700950439 /* Base */,
+ );
+ name = MainInterface.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 1F85A6E91D44279E0006907C /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 1F85A6EA1D44279E0006907C /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 1F85A6EC1D44279E0006907C /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ INFOPLIST_FILE = SwiftingNotification/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = com.roche.SwiftingNotification;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 3.0;
+ };
+ name = Debug;
+ };
+ 1F85A6ED1D44279E0006907C /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ INFOPLIST_FILE = SwiftingNotification/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = com.roche.SwiftingNotification;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 3.0;
+ };
+ name = Release;
+ };
+ 1FBF33DC1D46BC9700950439 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = NotificationContentExtension/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = com.roche.SwiftingNotification.NotificationContentExtension;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 3.0;
+ };
+ name = Debug;
+ };
+ 1FBF33DD1D46BC9700950439 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = NotificationContentExtension/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = com.roche.SwiftingNotification.NotificationContentExtension;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 3.0;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1F85A6D41D44279D0006907C /* Build configuration list for PBXProject "SwiftingNotification" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1F85A6E91D44279E0006907C /* Debug */,
+ 1F85A6EA1D44279E0006907C /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1F85A6EB1D44279E0006907C /* Build configuration list for PBXNativeTarget "SwiftingNotification" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1F85A6EC1D44279E0006907C /* Debug */,
+ 1F85A6ED1D44279E0006907C /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1FBF33DE1D46BC9700950439 /* Build configuration list for PBXNativeTarget "NotificationContentExtension" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1FBF33DC1D46BC9700950439 /* Debug */,
+ 1FBF33DD1D46BC9700950439 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 1F85A6D11D44279D0006907C /* Project object */;
+}
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..2e15550
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/project.xcworkspace/xcuserdata/woroninb.xcuserdatad/UserInterfaceState.xcuserstate b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/project.xcworkspace/xcuserdata/woroninb.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644
index 0000000..b5d3d72
Binary files /dev/null and b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/project.xcworkspace/xcuserdata/woroninb.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
new file mode 100644
index 0000000..fe2b454
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -0,0 +1,5 @@
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/NotificationContentExtension.xcscheme b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/NotificationContentExtension.xcscheme
new file mode 100644
index 0000000..122d1cb
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/NotificationContentExtension.xcscheme
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 2.xcscheme b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 2.xcscheme
new file mode 100644
index 0000000..d086486
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 2.xcscheme
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 4.xcscheme b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 4.xcscheme
new file mode 100644
index 0000000..d086486
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 4.xcscheme
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 6.xcscheme b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 6.xcscheme
new file mode 100644
index 0000000..d086486
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 6.xcscheme
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 8.xcscheme b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 8.xcscheme
new file mode 100644
index 0000000..d086486
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification 8.xcscheme
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification.xcscheme b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification.xcscheme
new file mode 100644
index 0000000..d086486
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/SwiftingNotification.xcscheme
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/xcschememanagement.plist b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 0000000..53e7761
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification.xcodeproj/xcuserdata/woroninb.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,52 @@
+
+
+
+
+ SchemeUserState
+
+ NotificationContentExtension.xcscheme
+
+ orderHint
+ 1
+
+ SwiftingNotification 2.xcscheme
+
+ orderHint
+ 2
+
+ SwiftingNotification 4.xcscheme
+
+ orderHint
+ 3
+
+ SwiftingNotification 6.xcscheme
+
+ orderHint
+ 4
+
+ SwiftingNotification 8.xcscheme
+
+ orderHint
+ 5
+
+ SwiftingNotification.xcscheme
+
+ orderHint
+ 0
+
+
+ SuppressBuildableAutocreation
+
+ 1F85A6D81D44279D0006907C
+
+ primary
+
+
+ 1FBF33CB1D46BC9700950439
+
+ primary
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/AppDelegate.swift b/Example Project/SwiftingNotification/SwiftingNotification/AppDelegate.swift
new file mode 100644
index 0000000..6ead52b
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/AppDelegate.swift
@@ -0,0 +1,55 @@
+//
+// AppDelegate.swift
+// SwiftingNotification
+//
+// Created by woroninb on 24/07/16.
+// Copyright © 2016 roche. All rights reserved.
+//
+
+import UIKit
+import UserNotifications
+
+@UIApplicationMain
+class AppDelegate: UIResponder, UIApplicationDelegate {
+
+ var window: UIWindow?
+
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
+ let center = UNUserNotificationCenter.current()
+ let action = UNNotificationAction(identifier: Consts.replyIdentifier, title: "reply")
+ let category = UNNotificationCategory(identifier: Consts.categoryIdentifier, actions: [action], intentIdentifiers: [])
+ center.setNotificationCategories([category])
+ center.requestAuthorization(options: [.badge, .alert , .sound]) { (greanted, error) in
+ print(error)
+ }
+ return true
+ }
+
+ func applicationWillResignActive(_ application: UIApplication) {
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ }
+
+ func applicationDidEnterBackground(_ application: UIApplication) {
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+ }
+
+ func applicationWillEnterForeground(_ application: UIApplication) {
+ // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
+ }
+
+ func applicationDidBecomeActive(_ application: UIApplication) {
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+ }
+
+ func applicationWillTerminate(_ application: UIApplication) {
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+ }
+
+ func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
+ print(error)
+ }
+
+}
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example Project/SwiftingNotification/SwiftingNotification/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..1d060ed
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,93 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "20x20",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "20x20",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "83.5x83.5",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/Base.lproj/LaunchScreen.storyboard b/Example Project/SwiftingNotification/SwiftingNotification/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 0000000..fdf3f97
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/Base.lproj/Main.storyboard b/Example Project/SwiftingNotification/SwiftingNotification/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..273375f
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/Base.lproj/Main.storyboard
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/Consts.swift b/Example Project/SwiftingNotification/SwiftingNotification/Consts.swift
new file mode 100644
index 0000000..3071a64
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/Consts.swift
@@ -0,0 +1,17 @@
+//
+// Consts.swift
+// SwiftingNotification
+//
+// Created by woroninb on 12/08/16.
+// Copyright © 2016 roche. All rights reserved.
+//
+
+import Foundation
+
+struct Consts {
+ static let requestIdentifier = "requestIdentifier"
+ static let replyIdentifier = "replyIdentifier"
+ static let categoryIdentifier = "catgeoryIdentifier"
+ static let imageIdentifier = "imageIdentifier"
+ static let customContentIdentifier = "customContentIdentifier"
+}
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/Helpers.swift b/Example Project/SwiftingNotification/SwiftingNotification/Helpers.swift
new file mode 100644
index 0000000..b4c5c0c
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/Helpers.swift
@@ -0,0 +1,29 @@
+//
+// Helpers.swift
+// SwiftingNotification
+//
+// Created by woroninb on 15/08/16.
+// Copyright © 2016 roche. All rights reserved.
+//
+
+import UIKit
+
+final class Helpers {
+
+ class func saveImage(name: String) -> URL? {
+
+ guard let image = UIImage(named: name) else {
+ return nil
+ }
+
+ let imageData = UIImagePNGRepresentation(image)
+ let documentsURL = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
+ do {
+ let imageURL = documentsURL.appendingPathComponent("\(name).png")
+ _ = try imageData?.write(to: imageURL)
+ return imageURL
+ } catch {
+ return nil
+ }
+ }
+}
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/Info.plist b/Example Project/SwiftingNotification/SwiftingNotification/Info.plist
new file mode 100644
index 0000000..d052473
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/Info.plist
@@ -0,0 +1,45 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+ LSRequiresIPhoneOS
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/NotificationButton.swift b/Example Project/SwiftingNotification/SwiftingNotification/NotificationButton.swift
new file mode 100644
index 0000000..b099049
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/NotificationButton.swift
@@ -0,0 +1,31 @@
+//
+// NotificationButton.swift
+// SwiftingNotification
+//
+// Created by woroninb on 15/08/16.
+// Copyright © 2016 roche. All rights reserved.
+//
+
+import UIKit
+
+final class NotificationButton: UIButton {
+
+ private var pressedAction: () -> ()
+
+ init(title: String, action: @escaping () -> ()) {
+ self.pressedAction = action
+ super.init(frame: .zero)
+ self.setTitleColor(UIColor.blue, for: .normal)
+ self.setTitle(title, for: .normal)
+ self.translatesAutoresizingMaskIntoConstraints = false
+ self.addTarget(self, action: #selector(tapped), for: .touchUpInside)
+ }
+
+ required init?(coder aDecoder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+
+ func tapped(sender: AnyObject) {
+ pressedAction()
+ }
+}
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/NotificationContent.swift b/Example Project/SwiftingNotification/SwiftingNotification/NotificationContent.swift
new file mode 100644
index 0000000..c2247ac
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/NotificationContent.swift
@@ -0,0 +1,24 @@
+//
+// File.swift
+// SwiftingNotification
+//
+// Created by woroninb on 15/08/16.
+// Copyright © 2016 roche. All rights reserved.
+//
+
+import Foundation
+import UserNotifications
+
+final class NotificationContent: UNMutableNotificationContent {
+ init(title: String, subTitle: String, body: String) {
+ super.init()
+ self.title = title
+ self.subtitle = subTitle
+ self.body = body
+ self.sound = UNNotificationSound.default()
+ }
+
+ required init?(coder aDecoder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+}
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/ViewController.swift b/Example Project/SwiftingNotification/SwiftingNotification/ViewController.swift
new file mode 100644
index 0000000..41902c0
--- /dev/null
+++ b/Example Project/SwiftingNotification/SwiftingNotification/ViewController.swift
@@ -0,0 +1,169 @@
+//
+// ViewController.swift
+// SwiftingNotification
+//
+// Created by woroninb on 24/07/16.
+// Copyright © 2016 roche. All rights reserved.
+//
+
+import UIKit
+import UserNotifications
+import UserNotificationsUI
+
+final class ViewController: UIViewController {
+
+ private var localNotButton: UIButton!
+ private var localActionNotButton: UIButton!
+ private var localAttachementNotButton: UIButton!
+ private var localCustomContentNotButton: UIButton!
+ private var localDelayedNotButton: UIButton!
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ localNotButton = NotificationButton(title: "Show rich notification", action: showSimpleLocalNototification)
+ localActionNotButton = NotificationButton(title: "Show actionable notification", action: showCustomActionsLocalNototification)
+ localAttachementNotButton = NotificationButton(title: "Show media notification", action: showMediaAttachememnt)
+ localCustomContentNotButton = NotificationButton(title: "Show custom content notification", action: showCustomContentNotification)
+ localDelayedNotButton = NotificationButton(title: "Show delayed notification", action: showDelayedNotification)
+
+ view.addSubview(localNotButton)
+ view.addSubview(localActionNotButton)
+ view.addSubview(localAttachementNotButton)
+ view.addSubview(localCustomContentNotButton)
+ view.addSubview(localDelayedNotButton)
+
+ setUpConstraints()
+ }
+
+ override func didReceiveMemoryWarning() {
+ super.didReceiveMemoryWarning()
+ }
+
+ func setUpConstraints() {
+
+ let views = ["localNotButton": localNotButton!,
+ "localActionNotButton": localActionNotButton!,
+ "localAttachementNotButton": localAttachementNotButton!,
+ "localCustomContentNotButton": localCustomContentNotButton!,
+ "localDelayedNotButton": localDelayedNotButton!]
+
+ NSLayoutConstraint.activate(
+ NSLayoutConstraint.constraints(
+ withVisualFormat: "H:|-[localNotButton]-|",
+ options: [], metrics: nil, views: views))
+
+ NSLayoutConstraint.activate(
+ NSLayoutConstraint.constraints(
+ withVisualFormat: "H:|-[localActionNotButton]-|",
+ options: [], metrics: nil, views: views))
+
+ NSLayoutConstraint.activate(
+ NSLayoutConstraint.constraints(
+ withVisualFormat: "H:|-[localAttachementNotButton]-|",
+ options: [], metrics: nil, views: views))
+
+ NSLayoutConstraint.activate(
+ NSLayoutConstraint.constraints(
+ withVisualFormat: "H:|-[localCustomContentNotButton]-|",
+ options: [], metrics: nil, views: views))
+
+ NSLayoutConstraint.activate(
+ NSLayoutConstraint.constraints(
+ withVisualFormat: "H:|-[localDelayedNotButton]-|",
+ options: [], metrics: nil, views: views))
+
+ NSLayoutConstraint.activate(
+ NSLayoutConstraint.constraints(
+ withVisualFormat: "V:|-50-[localNotButton]-10-[localActionNotButton]-10-[localAttachementNotButton]-10-[localCustomContentNotButton]-10-[localDelayedNotButton]-(>=10)-|",
+ options: [.alignAllCenterX], metrics: nil, views: views))
+
+ }
+
+ func showSimpleLocalNototification() {
+ let content = NotificationContent(title: "SwiftingNotifications", subTitle: "Swifting.io presents", body: "Rich notifications")
+ let request = UNNotificationRequest(identifier: Consts.requestIdentifier, content: content, trigger: nil)
+ UNUserNotificationCenter.current().add(request) { error in
+ UNUserNotificationCenter.current().delegate = self
+ if (error != nil){
+ //handle here
+ }
+ }
+ }
+
+ func showCustomActionsLocalNototification() {
+ let content = NotificationContent(title: "SwiftingNotifications", subTitle: "Swifting.io presents", body: "Actionable notifications")
+ content.categoryIdentifier = Consts.categoryIdentifier
+ let request = UNNotificationRequest(identifier: Consts.requestIdentifier, content: content, trigger: nil)
+ UNUserNotificationCenter.current().add(request) { error in
+ UNUserNotificationCenter.current().delegate = self
+ if (error != nil){
+ //handle here
+ }
+ }
+ }
+
+ func showMediaAttachememnt() {
+
+ let content = NotificationContent(title: "SwiftingNotifications", subTitle: "Swifting.io presents", body: "Media notifications")
+
+ guard let url = Helpers.saveImage(name: "skrzypce.jpg") else {
+ return
+ }
+
+ let attachment = try? UNNotificationAttachment(identifier: Consts.imageIdentifier,
+ url: url,
+ options: [:])
+
+ if let attachment = attachment {
+ content.attachments.append(attachment)
+ }
+
+ let request = UNNotificationRequest(identifier: Consts.requestIdentifier, content: content, trigger: nil)
+ UNUserNotificationCenter.current().add(request) { error in
+ UNUserNotificationCenter.current().delegate = self
+ if (error != nil){
+ //handle here
+ }
+ }
+ }
+
+ func showCustomContentNotification() {
+
+ let content = NotificationContent(title: "SwiftingNotifications", subTitle: "Swifting.io presents", body: "Custom notifications")
+
+ content.categoryIdentifier = Consts.customContentIdentifier
+
+ let request = UNNotificationRequest(identifier: Consts.requestIdentifier, content: content, trigger: nil)
+ UNUserNotificationCenter.current().add(request) { error in
+ UNUserNotificationCenter.current().delegate = self
+ if (error != nil){
+ //handle here
+ }
+ }
+ }
+
+ func showDelayedNotification() {
+
+ let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)
+ let content = NotificationContent(title: "SwiftingNotifications", subTitle: "Swifting.io presents", body: "Delayed notifications")
+ let request = UNNotificationRequest(identifier: Consts.requestIdentifier, content: content, trigger: trigger)
+ UNUserNotificationCenter.current().add(request) { error in
+ UNUserNotificationCenter.current().delegate = self
+ if (error != nil){
+ //handle here
+ }
+ }
+ }
+}
+
+extension UIViewController: UNUserNotificationCenterDelegate {
+
+ public func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Swift.Void) {
+ completionHandler( [.alert, .badge, .sound])
+ }
+
+ public func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Swift.Void) {
+ print("Tapped in notification")
+ }
+}
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/matrix.gif b/Example Project/SwiftingNotification/SwiftingNotification/matrix.gif
new file mode 100644
index 0000000..42c104d
Binary files /dev/null and b/Example Project/SwiftingNotification/SwiftingNotification/matrix.gif differ
diff --git a/Example Project/SwiftingNotification/SwiftingNotification/skrzypce.jpg b/Example Project/SwiftingNotification/SwiftingNotification/skrzypce.jpg
new file mode 100644
index 0000000..bb7e603
Binary files /dev/null and b/Example Project/SwiftingNotification/SwiftingNotification/skrzypce.jpg differ
diff --git a/Images/APNS.jpg b/Images/APNS.jpg
new file mode 100644
index 0000000..57683fa
Binary files /dev/null and b/Images/APNS.jpg differ
diff --git a/Images/Action.gif b/Images/Action.gif
new file mode 100644
index 0000000..7155a19
Binary files /dev/null and b/Images/Action.gif differ
diff --git a/Images/Custom.gif b/Images/Custom.gif
new file mode 100644
index 0000000..7f7f21a
Binary files /dev/null and b/Images/Custom.gif differ
diff --git a/Images/Delayed.gif b/Images/Delayed.gif
new file mode 100644
index 0000000..100ec27
Binary files /dev/null and b/Images/Delayed.gif differ
diff --git a/Images/Media.gif b/Images/Media.gif
new file mode 100644
index 0000000..58451a1
Binary files /dev/null and b/Images/Media.gif differ
diff --git a/Images/NotificationContentExtensionAdd.jpg b/Images/NotificationContentExtensionAdd.jpg
new file mode 100644
index 0000000..492f1fc
Binary files /dev/null and b/Images/NotificationContentExtensionAdd.jpg differ
diff --git a/Images/NotificationExtensionInfoPlist.jpg b/Images/NotificationExtensionInfoPlist.jpg
new file mode 100644
index 0000000..3a888de
Binary files /dev/null and b/Images/NotificationExtensionInfoPlist.jpg differ
diff --git a/Images/Registration.png b/Images/Registration.png
new file mode 100644
index 0000000..3789d0d
Binary files /dev/null and b/Images/Registration.png differ
diff --git a/Images/Rich.gif b/Images/Rich.gif
new file mode 100644
index 0000000..d58896d
Binary files /dev/null and b/Images/Rich.gif differ
diff --git a/Images/ServiceExtensionAdd.jpg b/Images/ServiceExtensionAdd.jpg
new file mode 100644
index 0000000..f0c49b5
Binary files /dev/null and b/Images/ServiceExtensionAdd.jpg differ
diff --git a/Images/ServiceGraph.jpg b/Images/ServiceGraph.jpg
new file mode 100644
index 0000000..3e2993e
Binary files /dev/null and b/Images/ServiceGraph.jpg differ
diff --git a/Images/TwoCategoriesInfoPlist.jpg b/Images/TwoCategoriesInfoPlist.jpg
new file mode 100644
index 0000000..280ba04
Binary files /dev/null and b/Images/TwoCategoriesInfoPlist.jpg differ
diff --git a/Images/calendarIcon.png b/Images/calendarIcon.png
new file mode 100644
index 0000000..14445c6
Binary files /dev/null and b/Images/calendarIcon.png differ
diff --git a/Images/locationIcon.png b/Images/locationIcon.png
new file mode 100644
index 0000000..b2b4b7c
Binary files /dev/null and b/Images/locationIcon.png differ
diff --git a/Images/matrix.gif b/Images/matrix.gif
new file mode 100644
index 0000000..42c104d
Binary files /dev/null and b/Images/matrix.gif differ
diff --git a/Images/timeIcon.png b/Images/timeIcon.png
new file mode 100644
index 0000000..0bc2303
Binary files /dev/null and b/Images/timeIcon.png differ