Skip to content

Commit

Permalink
add language online
Browse files Browse the repository at this point in the history
  • Loading branch information
xqsadness committed Sep 15, 2023
1 parent f2ddf0d commit 420f3c3
Show file tree
Hide file tree
Showing 9 changed files with 322 additions and 37 deletions.
27 changes: 27 additions & 0 deletions DefaultProject.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
DDCC6D792A8E19E50085D950 /* HistoryInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDCC6D782A8E19E50085D950 /* HistoryInfoView.swift */; };
DDCC6D7B2A8E1A420085D950 /* HistoryContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDCC6D7A2A8E1A420085D950 /* HistoryContentView.swift */; };
DDCC6D7D2A8E1C890085D950 /* HistorySubmitNextButtonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDCC6D7C2A8E1C890085D950 /* HistorySubmitNextButtonsView.swift */; };
DDFDD3DE2AB3EAF200585841 /* Localize.strings in Resources */ = {isa = PBXBuildFile; fileRef = DDFDD3DD2AB3EAF200585841 /* Localize.strings */; };
DDFDD3E82AB3EE6800585841 /* CrowdinSDK in Frameworks */ = {isa = PBXBuildFile; productRef = DDFDD3E72AB3EE6800585841 /* CrowdinSDK */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -288,13 +290,15 @@
DDCC6D782A8E19E50085D950 /* HistoryInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryInfoView.swift; sourceTree = "<group>"; };
DDCC6D7A2A8E1A420085D950 /* HistoryContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryContentView.swift; sourceTree = "<group>"; };
DDCC6D7C2A8E1C890085D950 /* HistorySubmitNextButtonsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistorySubmitNextButtonsView.swift; sourceTree = "<group>"; };
DDFDD3DD2AB3EAF200585841 /* Localize.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localize.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
CA2223402A2BB329005164BB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
DDFDD3E82AB3EE6800585841 /* CrowdinSDK in Frameworks */,
DA475ADEA3BDD29E30F2BF97 /* Pods_DefaultProject.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -540,6 +544,7 @@
DD0EA4832A8B26DC007D8C55 /* Localizable */ = {
isa = PBXGroup;
children = (
DDFDD3DD2AB3EAF200585841 /* Localize.strings */,
DD0EA4882A8B2704007D8C55 /* Localizable.strings */,
);
path = Localizable;
Expand Down Expand Up @@ -703,6 +708,7 @@
);
name = DefaultProject;
packageProductDependencies = (
DDFDD3E72AB3EE6800585841 /* CrowdinSDK */,
);
productName = DefaultProject;
productReference = CA2223432A2BB329005164BB /* DefaultProject.app */;
Expand Down Expand Up @@ -736,6 +742,7 @@
);
mainGroup = CA22233A2A2BB329005164BB;
packageReferences = (
DDFDD3E62AB3EE6800585841 /* XCRemoteSwiftPackageReference "mobile-sdk-ios" */,
);
productRefGroup = CA2223442A2BB329005164BB /* Products */;
projectDirPath = "";
Expand All @@ -752,6 +759,7 @@
buildActionMask = 2147483647;
files = (
CA22234E2A2BB32A005164BB /* Preview Assets.xcassets in Resources */,
DDFDD3DE2AB3EAF200585841 /* Localize.strings in Resources */,
CA2223AD2A2BB34A005164BB /* GoogleService-Info.plist in Resources */,
CA2223A22A2BB34A005164BB /* NativeAdView.xib in Resources */,
CA2223DE2A2BBADC005164BB /* Launch Screen.storyboard in Resources */,
Expand Down Expand Up @@ -1161,6 +1169,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
DDFDD3E62AB3EE6800585841 /* XCRemoteSwiftPackageReference "mobile-sdk-ios" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/crowdin/mobile-sdk-ios.git";
requirement = {
branch = master;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
DDFDD3E72AB3EE6800585841 /* CrowdinSDK */ = {
isa = XCSwiftPackageProductDependency;
package = DDFDD3E62AB3EE6800585841 /* XCRemoteSwiftPackageReference "mobile-sdk-ios" */;
productName = CrowdinSDK;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = CA22233B2A2BB329005164BB /* Project object */;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = "ru"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
32 changes: 32 additions & 0 deletions DefaultProject.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"pins" : [
{
"identity" : "baseapi",
"kind" : "remoteSourceControl",
"location" : "https://github.com/serhii-londar/BaseAPI.git",
"state" : {
"revision" : "8e736fa8302647749fb1b4ebe3c59e920174a095",
"version" : "0.2.1"
}
},
{
"identity" : "mobile-sdk-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/crowdin/mobile-sdk-ios.git",
"state" : {
"branch" : "master",
"revision" : "8ae7f1cc2ca683df32806ce3904e06d2530606b0"
}
},
{
"identity" : "starscream",
"kind" : "remoteSourceControl",
"location" : "https://github.com/daltoniam/Starscream.git",
"state" : {
"revision" : "ac6c0fc9da221873e01bd1a0d4818498a71eef33",
"version" : "4.0.6"
}
}
],
"version" : 2
}
Binary file not shown.
Binary file not shown.

This file was deleted.

44 changes: 14 additions & 30 deletions DefaultProject/DEFAULT_SOURCE/CONTROLL_APP/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import Foundation
import Firebase
import GoogleMobileAds
import AppTrackingTransparency
import CrowdinSDK

class AppDelegate: NSObject, UIApplicationDelegate{
class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate{
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()
setUpCrowdinSDK()
UNUserNotificationCenter.current().delegate = self
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (allowed, error) in
if #available(iOS 14.0, *) {
Expand All @@ -23,6 +25,17 @@ class AppDelegate: NSObject, UIApplicationDelegate{
}
return true
}

func setUpCrowdinSDK(){
let providerConfig = CrowdinProviderConfig(hashString: "3cb996756cbbe1eed8c9779j50z", sourceLanguage: "fr")
let config = CrowdinSDKConfig.config().with(crowdinProviderConfig: providerConfig)

CrowdinSDK.startWithConfig(config) {
// added successfully
print("added successfully")
}
}

func appTracking(){
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
ATTrackingManager.requestTrackingAuthorization { status in
Expand All @@ -45,32 +58,3 @@ class AppDelegate: NSObject, UIApplicationDelegate{
print(error.localizedDescription)
}
}

extension AppDelegate: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
completionHandler([.banner, .sound, .badge])
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
// if response.notification.request.identifier == "cyc.moreapp" {
// Constant.myNotification.showMoreApp = true
// }else if response.notification.request.identifier == "cyc.download"{
// Constant.myNotification.showDownload = true
// }
completionHandler()
}

func userNotificationCenter(_ center: UNUserNotificationCenter, openSettingsFor notification: UNNotification?) { }

}



extension UIApplicationDelegate {
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
print("Successfully registered for notifications!")
}

func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
print("Failed to register for notifications: \(error.localizedDescription)")
}
}
Loading

0 comments on commit 420f3c3

Please sign in to comment.