Skip to content

Commit

Permalink
Implementation of Push Notifications (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-kalamarz committed Nov 7, 2021
1 parent 317fde2 commit 12ac129
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 2 deletions.
1 change: 1 addition & 0 deletions BuyPolish/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ target :Pola do
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'Firebase/Performance'
pod 'Firebase/Messaging'
pod 'UITextView+Placeholder'
pod 'KVNProgress'
pod 'R.swift'
Expand Down
17 changes: 16 additions & 1 deletion BuyPolish/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ PODS:
- Firebase/Crashlytics (8.6.0):
- Firebase/CoreOnly
- FirebaseCrashlytics (~> 8.6.0)
- Firebase/Messaging (8.6.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 8.6.0)
- Firebase/Performance (8.6.0):
- Firebase/CoreOnly
- FirebasePerformance (~> 8.6.0)
Expand Down Expand Up @@ -54,6 +57,15 @@ PODS:
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/UserDefaults (~> 7.4)
- PromisesObjC (< 3.0, >= 1.2)
- FirebaseMessaging (8.6.0):
- FirebaseCore (~> 8.0)
- FirebaseInstallations (~> 8.0)
- GoogleDataTransport (~> 9.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/Reachability (~> 7.4)
- GoogleUtilities/UserDefaults (~> 7.4)
- nanopb (~> 2.30908.0)
- FirebasePerformance (8.6.0):
- FirebaseCore (~> 8.0)
- FirebaseInstallations (~> 8.0)
Expand Down Expand Up @@ -132,6 +144,7 @@ DEPENDENCIES:
- Alamofire
- Firebase/Analytics
- Firebase/Crashlytics
- Firebase/Messaging
- Firebase/Performance
- KVNProgress
- Observable
Expand All @@ -154,6 +167,7 @@ SPEC REPOS:
- FirebaseCoreDiagnostics
- FirebaseCrashlytics
- FirebaseInstallations
- FirebaseMessaging
- FirebasePerformance
- FirebaseRemoteConfig
- GoogleAppMeasurement
Expand Down Expand Up @@ -182,6 +196,7 @@ SPEC CHECKSUMS:
FirebaseCoreDiagnostics: 3721920bde3a9a6d5aa093c1d25e9d3e47f694af
FirebaseCrashlytics: 58f8ecea7c799c61c50e8111d2e438424a8a1d2e
FirebaseInstallations: 0ede6ffcd215b8f93c19d9b06c1c54e2d4107e98
FirebaseMessaging: ce0a5ee974f7bfe83b6cc5acce88c2d969e37c41
FirebasePerformance: 868249ceda5e3399f581b5b53454d963feaa8164
FirebaseRemoteConfig: 9ee4672d4eacf646256e26cfac61021b3a390ea4
GoogleAppMeasurement: 2c0c6e2a7ab3fe730ade6379f732bdefb46f50b0
Expand All @@ -201,6 +216,6 @@ SPEC CHECKSUMS:
Swinject: ddf78b8486dd9b71a667b852cad919ab4484478e
"UITextView+Placeholder": d7b0c400921f66523f3a85d74f774512e14f6502

PODFILE CHECKSUM: d5f344273737eb063204ad291d08bc7f3f844830
PODFILE CHECKSUM: d4b2053dd9d80eee1bb552e69e5fa50fdc99198d

COCOAPODS: 1.11.2
40 changes: 40 additions & 0 deletions BuyPolish/Pola.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
37B645454FC2ACC155CB1538 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37B6472FF4603F63771FADE6 /* AVFoundation.framework */; };
37B64B7D226FBFA23FFCA1C1 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 37B645C93F848A6F598F96E2 /* Localizable.strings */; };
3B88A23C25BB139D00EFE032 /* krasnystaw.json in Resources */ = {isa = PBXBuildFile; fileRef = 3B88A23A25BB139D00EFE032 /* krasnystaw.json */; };
6285A0082737F53100D19C88 /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6285A0072737F53100D19C88 /* NotificationManager.swift */; };
6285A0092737F53100D19C88 /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6285A0072737F53100D19C88 /* NotificationManager.swift */; };
6285A00A2737F53100D19C88 /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6285A0072737F53100D19C88 /* NotificationManager.swift */; };
6285A00C2737F8DC00D19C88 /* NotificationRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6285A00B2737F8DC00D19C88 /* NotificationRegistrant.swift */; };
6299A5752737F239005464A5 /* NotificationProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6299A5742737F239005464A5 /* NotificationProvider.swift */; };
6299A5762737F239005464A5 /* NotificationProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6299A5742737F239005464A5 /* NotificationProvider.swift */; };
6299A5772737F239005464A5 /* NotificationProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6299A5742737F239005464A5 /* NotificationProvider.swift */; };
8402E1D62309BB610065E850 /* AltResultContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8402E1D52309BB610065E850 /* AltResultContentView.swift */; };
8406E62D233D59A700B7313C /* MainProggressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8406E62C233D59A700B7313C /* MainProggressView.swift */; };
8406E62F233D5FC000B7313C /* SecondaryProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8406E62E233D5FC000B7313C /* SecondaryProgressView.swift */; };
Expand Down Expand Up @@ -272,6 +279,11 @@
3B88A23A25BB139D00EFE032 /* krasnystaw.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = krasnystaw.json; sourceTree = "<group>"; };
5310C93A6052FC9BA4E8C020 /* Pods-Pola.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Pola.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Pola/Pods-Pola.debug.xcconfig"; sourceTree = "<group>"; };
53F3B599F258259843E2755D /* Pods_Pola_PolaTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Pola_PolaTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6276F99F2732B6AC0077C9E8 /* Pola.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Pola.entitlements; sourceTree = "<group>"; };
6276F9A02732B6C10077C9E8 /* PolaRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PolaRelease.entitlements; sourceTree = "<group>"; };
6285A0072737F53100D19C88 /* NotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManager.swift; sourceTree = "<group>"; };
6285A00B2737F8DC00D19C88 /* NotificationRegistrant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationRegistrant.swift; sourceTree = "<group>"; };
6299A5742737F239005464A5 /* NotificationProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationProvider.swift; sourceTree = "<group>"; };
6D7DD012073B8CCDD821A2D0 /* Pods-Pola-PolaTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Pola-PolaTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Pola-PolaTests/Pods-Pola-PolaTests.release.xcconfig"; sourceTree = "<group>"; };
8402E1D52309BB610065E850 /* AltResultContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AltResultContentView.swift; sourceTree = "<group>"; };
8406E62C233D59A700B7313C /* MainProggressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainProggressView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -555,6 +567,8 @@
1D08E83D19A7621A00879BD2 /* Images.xcassets */,
8455A7EE220D527200F30845 /* LaunchScreen.storyboard */,
9E188D91223063EC00325383 /* LaunchScreen.xcassets */,
6276F99F2732B6AC0077C9E8 /* Pola.entitlements */,
6276F9A02732B6C10077C9E8 /* PolaRelease.entitlements */,
84F177E022CAD3F700238266 /* R.generated.swift */,
2D70D222267BAB6D00682EF8 /* Theme.xcassets */,
);
Expand Down Expand Up @@ -738,6 +752,7 @@
D3201C5C26753A6600E683EC /* FlashlightManager */,
D3201C5F26753B9E00E683EC /* KeyboardManager */,
D3201C3C2675110000E683EC /* Logger */,
6299A5732737F1FD005464A5 /* NotificationManager */,
D3201C6426753C2600E683EC /* ProductImageManager */,
37B64977613F0A577613F7E4 /* ProductManager */,
37B641361E13BB0824D5828D /* ReportManager */,
Expand All @@ -762,6 +777,16 @@
path = ScanCode;
sourceTree = "<group>";
};
6299A5732737F1FD005464A5 /* NotificationManager */ = {
isa = PBXGroup;
children = (
6285A0072737F53100D19C88 /* NotificationManager.swift */,
6299A5742737F239005464A5 /* NotificationProvider.swift */,
6285A00B2737F8DC00D19C88 /* NotificationRegistrant.swift */,
);
path = NotificationManager;
sourceTree = "<group>";
};
7B71219F6F5A578A5DE23F85 /* Pods */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1292,6 +1317,7 @@
"${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseCrashlytics/FirebaseCrashlytics.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework",
"${BUILT_PRODUCTS_DIR}/FirebasePerformance/FirebasePerformance.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseRemoteConfig/FirebaseRemoteConfig.framework",
"${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework",
Expand All @@ -1315,6 +1341,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCrashlytics.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebasePerformance.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseRemoteConfig.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework",
Expand Down Expand Up @@ -1370,6 +1397,7 @@
"${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseCrashlytics/FirebaseCrashlytics.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework",
"${BUILT_PRODUCTS_DIR}/FirebasePerformance/FirebasePerformance.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseRemoteConfig/FirebaseRemoteConfig.framework",
"${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework",
Expand All @@ -1392,6 +1420,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCrashlytics.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebasePerformance.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseRemoteConfig.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework",
Expand Down Expand Up @@ -1518,6 +1547,7 @@
"${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseCrashlytics/FirebaseCrashlytics.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework",
"${BUILT_PRODUCTS_DIR}/FirebasePerformance/FirebasePerformance.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseRemoteConfig/FirebaseRemoteConfig.framework",
"${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework",
Expand All @@ -1539,6 +1569,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCrashlytics.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebasePerformance.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseRemoteConfig.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework",
Expand Down Expand Up @@ -1583,6 +1614,7 @@
9E43AF78242BBC4C0093627B /* ScanCodeViewController.swift in Sources */,
BDA76B5E21DE64FD003E9FD6 /* AnalyticsParameters.swift in Sources */,
84D8B77223EA202800CD0ECB /* DataRequestFactory.swift in Sources */,
6285A00C2737F8DC00D19C88 /* NotificationRegistrant.swift in Sources */,
841F7D9E235675A2007BE3F6 /* UIView+Additions.swift in Sources */,
84A6A97525EDB6F7004199B9 /* ScanResult+Additions.swift in Sources */,
84A81C4C23EE118300464745 /* PutAmazonRequestFactory.swift in Sources */,
Expand All @@ -1592,6 +1624,7 @@
8477CFC723CE137D00C72542 /* AboutRows.swift in Sources */,
8477CFCB23CE17B100C72542 /* DIContainer.swift in Sources */,
BDA76B5A21DE6248003E9FD6 /* AnalyticsHelper.swift in Sources */,
6299A5752737F239005464A5 /* NotificationProvider.swift in Sources */,
84A81C5A23EFF91300464745 /* ScannerCodeViewController.swift in Sources */,
842E763823E4703500A5534B /* Report.swift in Sources */,
84A81C5623EFF2CA00464745 /* CodeScannerManager.swift in Sources */,
Expand Down Expand Up @@ -1665,6 +1698,7 @@
84A6A93425EDAAAE004199B9 /* AskForReport.swift in Sources */,
D3201C4B2675359900E683EC /* DependencyRegistrant.swift in Sources */,
84CE3E6023BA895100FE8D66 /* AboutWebViewController.swift in Sources */,
6285A0082737F53100D19C88 /* NotificationManager.swift in Sources */,
849E50DB24A623A80064F269 /* AskForDonate.swift in Sources */,
84A6A93F25EDAE40004199B9 /* UIButton+ReportType.swift in Sources */,
9E43AF74242798780093627B /* ResultsView.swift in Sources */,
Expand Down Expand Up @@ -1695,6 +1729,7 @@
D340FA53263B53E500121AAA /* UIButton+ReportTypeSnapshotTests.swift in Sources */,
8430819B25CFEE0900B96981 /* AltResultContentViewControllerSnapshotTests.swift in Sources */,
84AB4C32259B13140008A6B2 /* MainProggressViewSnapshotTests.swift in Sources */,
6285A0092737F53100D19C88 /* NotificationManager.swift in Sources */,
9EC3BBF823CDD74000242B1E /* UIColor_AdditionsTests.swift in Sources */,
841EC045257F7CC2008D8EC9 /* TestData+ScanResult.swift in Sources */,
846A995825EBA72C007DFF88 /* MockKeyboardManager.swift in Sources */,
Expand All @@ -1709,6 +1744,7 @@
846A992925EBA4CB007DFF88 /* MockAnalyticsProvider.swift in Sources */,
9EC3BBF923CDD74000242B1E /* Encodable_DictionaryTests.swift in Sources */,
84AB4BC2259A0C660008A6B2 /* OwnBrandCompanyTitleViewSnapshotTests.swift in Sources */,
6299A5762737F239005464A5 /* NotificationProvider.swift in Sources */,
8430819325CFE8F600B96981 /* CompanyContentViewControllerSnapshotTests.swift in Sources */,
847071D1251DFD21009E296A /* KeyboardBarcodeTests.swift in Sources */,
);
Expand All @@ -1725,6 +1761,7 @@
9EC3BC2B23CDD9D100242B1E /* ScanBarcodePage+TestData.swift in Sources */,
9EC3BC2623CDD9D100242B1E /* MainGalleryPage.swift in Sources */,
9EC3BC2723CDD9D100242B1E /* PhotosGalleryPage.swift in Sources */,
6299A5772737F239005464A5 /* NotificationProvider.swift in Sources */,
84E7083E2280A40400402E26 /* PolaUITestCase.swift in Sources */,
9EC3BC1223CDD76C00242B1E /* ReportBugPageUITests.swift in Sources */,
9EC3BC2423CDD9D100242B1E /* ISBNPage.swift in Sources */,
Expand All @@ -1744,6 +1781,7 @@
9EC3BC1123CDD76C00242B1E /* ScanBarcodeWithResultPageUITests.swift in Sources */,
9EC3BC1323CDD76C00242B1E /* ISBNPageUITests.swift in Sources */,
849E40D82415204C006E1B76 /* ScanBarcodePageUITests.swift in Sources */,
6285A00A2737F53100D19C88 /* NotificationManager.swift in Sources */,
9EC3BC2823CDD9D100242B1E /* ReportBugPage.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1905,6 +1943,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CODE_SIGN_ENTITLEMENTS = Pola/Pola.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 9NBWKG2G3X;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -1938,6 +1977,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CODE_SIGN_ENTITLEMENTS = Pola/PolaRelease.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = 9NBWKG2G3X;
Expand Down
7 changes: 6 additions & 1 deletion BuyPolish/Pola/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import AVFoundation
import FirebaseMessaging
import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
private var notificationProvider: NotificationProvider?

func application(_: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
DI.container.resolve(AnalyticsProvider.self)!.configure()
applyAppearance()

Expand All @@ -29,6 +31,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
_ = handleShortcutItem(shortcutItem)
}

notificationProvider = DI.container.resolve(NotificationProvider.self)
notificationProvider?.register(in: application)

return true
}

Expand Down
1 change: 1 addition & 0 deletions BuyPolish/Pola/Manager/DI/DIContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ final class DI {
RequestFactoryRegistrant(),
ScanCodeRegistrant(),
UIKitRegistrant(),
NotificationRegistrant(),
]
registrants.forEach { $0.registerDependency(container: container) }
return container
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Foundation
import UIKit

final class NotificationManager: NSObject, NotificationProvider {
func register(in application: UIApplication) {
UNUserNotificationCenter.current().delegate = self

let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
options: authOptions,
completionHandler: { _, _ in }
)

application.registerForRemoteNotifications()
}
}

extension NotificationManager: UNUserNotificationCenterDelegate {
func userNotificationCenter(_: UNUserNotificationCenter,
willPresent _: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions)
-> Void) {
completionHandler([[.alert, .sound]])
}

func userNotificationCenter(_: UNUserNotificationCenter,
didReceive _: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
completionHandler()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import UIKit
protocol NotificationProvider {
func register(in application: UIApplication)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Firebase
import Swinject

final class NotificationRegistrant: DependencyRegistrant {
func registerDependency(container: Container) {
container.register(NotificationProvider.self) { _ in
NotificationManager()
}.inObjectScope(.container)
}
}
8 changes: 8 additions & 0 deletions BuyPolish/Pola/Pola.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>aps-environment</key>
<string>development</string>
</dict>
</plist>
5 changes: 5 additions & 0 deletions BuyPolish/Pola/PolaRelease.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?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/>
</plist>

0 comments on commit 12ac129

Please sign in to comment.