Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
feat: server - FCM
refactor: app - compose
feat: app - FCM
  • Loading branch information
taetae98coding committed Nov 15, 2024
1 parent ddc1e5d commit 199b3ff
Show file tree
Hide file tree
Showing 141 changed files with 6,159 additions and 3,210 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ jobs:
echo '${{ secrets.APPLE_REAL_RELEASE_GOOGLE_SERVICE_INFO_PLIST }}' >> Diary/Secret/RealRelease/GoogleService-Info.plist
- name: Build iOS
run: xcodebuild -project Diary/Diary.xcodeproj -scheme CI -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0'
run: xcodebuild -project Diary/Diary.xcodeproj -scheme RealRelease -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0'
4 changes: 2 additions & 2 deletions .github/workflows/firebase_app_distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Archive xcarchive
run: xcodebuild -project Diary/Diary.xcodeproj -scheme CI archive -archivePath Diary/build/Diary.xcarchive -allowProvisioningUpdates
run: xcodebuild -project Diary/Diary.xcodeproj -scheme RealRelease archive -archivePath Diary/build/Diary.xcarchive -allowProvisioningUpdates

- name: Export ipa
run: xcodebuild -exportArchive -archivePath Diary/build/Diary.xcarchive -exportPath Diary/build -exportOptionsPlist Diary/ExportOptions.plist -allowProvisioningUpdates
Expand All @@ -131,7 +131,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Diary.ipa
path: Diary/build/Apps/Diary.ipa
path: Diary/build/Diary.ipa

iOS-Distribution:
needs: [iOS-Build]
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@

**/xcuserdata
**/dev.xcconfig
**/real.xcconfig
**/real.xcconfig
**/*.podspec
110 changes: 73 additions & 37 deletions Diary/Diary.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
objects = {

/* Begin PBXBuildFile section */
3DD9A74F2CDFBAC60023C4EE /* FirebaseAnalyticsWithoutAdIdSupport in Frameworks */ = {isa = PBXBuildFile; productRef = 3DD9A74E2CDFBAC60023C4EE /* FirebaseAnalyticsWithoutAdIdSupport */; };
3DD9A7512CDFBAC60023C4EE /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 3DD9A7502CDFBAC60023C4EE /* FirebaseCrashlytics */; };
3DD9A7532CDFBAC60023C4EE /* FirebasePerformance in Frameworks */ = {isa = PBXBuildFile; productRef = 3DD9A7522CDFBAC60023C4EE /* FirebasePerformance */; };
3DF0CB1B2CE4D18600B88439 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 3DF0CB1A2CE4D18600B88439 /* FirebaseAnalytics */; };
3DF0CB1D2CE4D18600B88439 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 3DF0CB1C2CE4D18600B88439 /* FirebaseCrashlytics */; };
3DF0CB1F2CE4D18600B88439 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 3DF0CB1E2CE4D18600B88439 /* FirebaseMessaging */; };
3DF0CB212CE4D18600B88439 /* FirebasePerformance in Frameworks */ = {isa = PBXBuildFile; productRef = 3DF0CB202CE4D18600B88439 /* FirebasePerformance */; };
3DF0CB232CE4D18600B88439 /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = 3DF0CB222CE4D18600B88439 /* FirebaseRemoteConfig */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -42,9 +44,11 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3DD9A74F2CDFBAC60023C4EE /* FirebaseAnalyticsWithoutAdIdSupport in Frameworks */,
3DD9A7512CDFBAC60023C4EE /* FirebaseCrashlytics in Frameworks */,
3DD9A7532CDFBAC60023C4EE /* FirebasePerformance in Frameworks */,
3DF0CB1F2CE4D18600B88439 /* FirebaseMessaging in Frameworks */,
3DF0CB1B2CE4D18600B88439 /* FirebaseAnalytics in Frameworks */,
3DF0CB212CE4D18600B88439 /* FirebasePerformance in Frameworks */,
3DF0CB1D2CE4D18600B88439 /* FirebaseCrashlytics in Frameworks */,
3DF0CB232CE4D18600B88439 /* FirebaseRemoteConfig in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -90,9 +94,11 @@
);
name = Diary;
packageProductDependencies = (
3DD9A74E2CDFBAC60023C4EE /* FirebaseAnalyticsWithoutAdIdSupport */,
3DD9A7502CDFBAC60023C4EE /* FirebaseCrashlytics */,
3DD9A7522CDFBAC60023C4EE /* FirebasePerformance */,
3DF0CB1A2CE4D18600B88439 /* FirebaseAnalytics */,
3DF0CB1C2CE4D18600B88439 /* FirebaseCrashlytics */,
3DF0CB1E2CE4D18600B88439 /* FirebaseMessaging */,
3DF0CB202CE4D18600B88439 /* FirebasePerformance */,
3DF0CB222CE4D18600B88439 /* FirebaseRemoteConfig */,
);
productName = Diary;
productReference = 3DDC71F62CCD5903001193A2 /* Diary.app */;
Expand Down Expand Up @@ -124,7 +130,7 @@
mainGroup = 3DDC71ED2CCD5903001193A2;
minimizedProjectReferenceProxies = 1;
packageReferences = (
3DD9A74D2CDFBAC60023C4EE /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
3DF0CB192CE4D18600B88439 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 3DDC71F72CCD5903001193A2 /* Products */;
Expand Down Expand Up @@ -163,7 +169,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd \"$SRCROOT/..\"\n\n\ncase \"${CONFIGURATION}\" in\n \"DevDebug\" )\ncp -r \"$SRCROOT/Secret/DevDebug/GoogleService-Info.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n \"DevRelease\" )\ncp -r \"$SRCROOT/Secret/DevRelease/GoogleService-Info.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n \"RealDebug\" )\ncp -r \"$SRCROOT/Secret/RealDebug/GoogleService-Info.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n \"RealRelease\" )\ncp -r \"$SRCROOT/Secret/RealRelease/GoogleService-Info.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n*)\n;;\nesac\n";
shellScript = "cd \"$SRCROOT/..\"\n\ncase \"${CONFIGURATION}\" in\n \"DevDebug\" )\ncp -r \"$SRCROOT/Secret/DevDebug/GoogleService-Info.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n \"DevRelease\" )\ncp -r \"$SRCROOT/Secret/DevRelease/GoogleService-Info.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n \"RealDebug\" )\ncp -r \"$SRCROOT/Secret/RealDebug/GoogleService-Info.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n \"RealRelease\" )\ncp -r \"$SRCROOT/Secret/RealRelease/GoogleService-Info.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n*)\n;;\nesac\n";
};
3DD9A7552CDFC3240023C4EE /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -203,7 +209,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd \"$SRCROOT/..\"\n\n\ncase \"${CONFIGURATION}\" in\n \"DevDebug\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=dev ;;\n \"DevRelease\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=dev ;;\n \"RealDebug\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=real ;;\n \"RealRelease\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=real ;;\n*)\n;;\nesac\n";
shellScript = "cd \"$SRCROOT/..\"\n\ncase \"${CONFIGURATION}\" in\n \"DevDebug\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=dev ;;\n \"DevRelease\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=dev ;;\n \"RealDebug\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=real ;;\n \"RealRelease\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=real ;;\n*)\n;;\nesac\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -286,10 +292,14 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CODE_SIGN_ENTITLEMENTS = Diary/Diary.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"Diary/Preview Content\"";
DEVELOPMENT_TEAM = 4TV6L66XZ8;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4TV6L66XZ8;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -306,9 +316,11 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = io.github.taetae98coding.diary.debug;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = DiaryRealDebug;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -376,10 +388,11 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Diary/Diary.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"Diary/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4TV6L66XZ8;
Expand All @@ -399,11 +412,11 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = io.github.taetae98coding.diary;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = adhoc;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = DiaryRealRelease;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -443,6 +456,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Apple Development";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -478,10 +492,14 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CODE_SIGN_ENTITLEMENTS = Diary/Diary.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"Diary/Preview Content\"";
DEVELOPMENT_TEAM = 4TV6L66XZ8;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4TV6L66XZ8;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -498,9 +516,11 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = io.github.taetae98coding.diary.dev.debug;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = DiaryDevDebug;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -568,10 +588,14 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CODE_SIGN_ENTITLEMENTS = Diary/Diary.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"Diary/Preview Content\"";
DEVELOPMENT_TEAM = 4TV6L66XZ8;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4TV6L66XZ8;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -588,9 +612,11 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = io.github.taetae98coding.diary.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = DiaryDevRelease;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -625,32 +651,42 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
3DD9A74D2CDFBAC60023C4EE /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
3DF0CB192CE4D18600B88439 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
kind = exactVersion;
version = 11.4.0;
version = 11.5.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
3DD9A74E2CDFBAC60023C4EE /* FirebaseAnalyticsWithoutAdIdSupport */ = {
3DF0CB1A2CE4D18600B88439 /* FirebaseAnalytics */ = {
isa = XCSwiftPackageProductDependency;
package = 3DD9A74D2CDFBAC60023C4EE /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAnalyticsWithoutAdIdSupport;
package = 3DF0CB192CE4D18600B88439 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAnalytics;
};
3DD9A7502CDFBAC60023C4EE /* FirebaseCrashlytics */ = {
3DF0CB1C2CE4D18600B88439 /* FirebaseCrashlytics */ = {
isa = XCSwiftPackageProductDependency;
package = 3DD9A74D2CDFBAC60023C4EE /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
package = 3DF0CB192CE4D18600B88439 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseCrashlytics;
};
3DD9A7522CDFBAC60023C4EE /* FirebasePerformance */ = {
3DF0CB1E2CE4D18600B88439 /* FirebaseMessaging */ = {
isa = XCSwiftPackageProductDependency;
package = 3DF0CB192CE4D18600B88439 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseMessaging;
};
3DF0CB202CE4D18600B88439 /* FirebasePerformance */ = {
isa = XCSwiftPackageProductDependency;
package = 3DD9A74D2CDFBAC60023C4EE /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
package = 3DF0CB192CE4D18600B88439 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebasePerformance;
};
3DF0CB222CE4D18600B88439 /* FirebaseRemoteConfig */ = {
isa = XCSwiftPackageProductDependency;
package = 3DF0CB192CE4D18600B88439 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseRemoteConfig;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 3DDC71EE2CCD5903001193A2 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "8328630971a8fdd8072b36bb22bef732eb15e1f0",
"version" : "11.4.0"
"revision" : "dbdfdc44bee8b8e4eaa5ec27eb12b9338f3f2bc1",
"version" : "11.5.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "RealRelease"
buildConfiguration = "DevRelease"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "RealRelease"
buildConfiguration = "DevRelease"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand All @@ -52,7 +52,7 @@
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "RealRelease"
buildConfiguration = "DevRelease"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
Expand All @@ -69,10 +69,10 @@
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "RealRelease">
buildConfiguration = "DevRelease">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "RealRelease"
buildConfiguration = "DevRelease"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
47 changes: 40 additions & 7 deletions Diary/Diary/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
import SwiftUI
import FirebaseCore

import Firebase
import UserNotifications

class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()

initRemoteNotifications(application: application)
initFirebaseMessaging()

return true
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Messaging.messaging().apnsToken = deviceToken
}


func initRemoteNotifications(application: UIApplication) {
UNUserNotificationCenter.current().delegate = self

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

application.registerForRemoteNotifications()
}

func initFirebaseMessaging() {
Messaging.messaging().delegate = self
}
}

extension AppDelegate: UNUserNotificationCenterDelegate {

}

return true
}
extension AppDelegate: MessagingDelegate {
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
print("Firebase registration token: \(String(describing: fcmToken))")
}
}
8 changes: 8 additions & 0 deletions Diary/Diary/Diary.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>
Loading

0 comments on commit 199b3ff

Please sign in to comment.