Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 04ad512bcc | |||
| 01a5ae0042 | |||
| 197dcbfc03 | |||
| 5fe5d34888 | |||
| 434df13a41 | |||
| 5b3b2f4a5f | |||
| 487aead433 | |||
| 27c160beaf | |||
| 8500300d18 |
@ -24,6 +24,12 @@
|
||||
5509CEEE2BB526F80056C5C2 /* ColorToString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5509CEED2BB526F70056C5C2 /* ColorToString.swift */; };
|
||||
5509CEF12BB54DD10056C5C2 /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5509CEF02BB54DD10056C5C2 /* Config.swift */; };
|
||||
550B85A22C2BC624008834E5 /* InitAPP.swift in Sources */ = {isa = PBXBuildFile; fileRef = 550B85A12C2BC623008834E5 /* InitAPP.swift */; };
|
||||
551C8C342C79946700B1A88C /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 551C8C332C79946700B1A88C /* GoogleService-Info.plist */; };
|
||||
555027392C81C0ED00A05441 /* QCloudTTS.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 555027382C81C0ED00A05441 /* QCloudTTS.xcframework */; };
|
||||
5550273C2C8322F800A05441 /* PushHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5550273B2C8322F800A05441 /* PushHandler.swift */; };
|
||||
5586E0882C80AD2D00026733 /* TTSManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5586E0872C80AD2D00026733 /* TTSManager.swift */; };
|
||||
558DB7A52E27B049004D6ADB /* WordPuzzleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 558DB7A42E27B049004D6ADB /* WordPuzzleView.swift */; };
|
||||
558DB7B22E2A78A5004D6ADB /* wordlist.txt in Resources */ = {isa = PBXBuildFile; fileRef = 558DB7B12E2A78A5004D6ADB /* wordlist.txt */; };
|
||||
559E6D7C2C34EAE700C971B9 /* IapManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 559E6D7B2C34EAE700C971B9 /* IapManager.swift */; };
|
||||
559E6D7E2C35355200C971B9 /* LogManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 559E6D7D2C35355200C971B9 /* LogManager.swift */; };
|
||||
55A954A22BBBFD0C00BF181E /* GrammarData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55A954A12BBBFD0C00BF181E /* GrammarData.swift */; };
|
||||
@ -33,6 +39,8 @@
|
||||
55BC47492C3A383A00120A7D /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55BC47482C3A383A00120A7D /* LoadingView.swift */; };
|
||||
55BC474F2C3A4E5E00120A7D /* ToastUI in Frameworks */ = {isa = PBXBuildFile; productRef = 55BC474E2C3A4E5E00120A7D /* ToastUI */; };
|
||||
55BC47512C3D431300120A7D /* IAPView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55BC47502C3D431300120A7D /* IAPView.swift */; };
|
||||
55C6DB912E2E2AEA00D4C5E5 /* puzzle.txt in Resources */ = {isa = PBXBuildFile; fileRef = 55C6DB902E2E2AEA00D4C5E5 /* puzzle.txt */; };
|
||||
55C6DB952E2E2ED700D4C5E5 /* PuzzleGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55C6DB942E2E2ED700D4C5E5 /* PuzzleGenerator.swift */; };
|
||||
55D632FA2C0F125D00443894 /* NetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55D632F92C0F125D00443894 /* NetworkManager.swift */; };
|
||||
55DAC6552BBA959500BDD4C8 /* ResultView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55DAC6542BBA959500BDD4C8 /* ResultView.swift */; };
|
||||
55DAC6572BBA984B00BDD4C8 /* InputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55DAC6562BBA984B00BDD4C8 /* InputView.swift */; };
|
||||
@ -86,6 +94,14 @@
|
||||
5509CEED2BB526F70056C5C2 /* ColorToString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorToString.swift; sourceTree = "<group>"; };
|
||||
5509CEF02BB54DD10056C5C2 /* Config.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = "<group>"; };
|
||||
550B85A12C2BC623008834E5 /* InitAPP.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InitAPP.swift; sourceTree = "<group>"; };
|
||||
551C8C332C79946700B1A88C /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
|
||||
555027382C81C0ED00A05441 /* QCloudTTS.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = QCloudTTS.xcframework; sourceTree = "<group>"; };
|
||||
5550273A2C8311CB00A05441 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
5550273B2C8322F800A05441 /* PushHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushHandler.swift; sourceTree = "<group>"; };
|
||||
5586E0832C8092C400026733 /* AIGrammar-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AIGrammar-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
5586E0872C80AD2D00026733 /* TTSManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TTSManager.swift; sourceTree = "<group>"; };
|
||||
558DB7A42E27B049004D6ADB /* WordPuzzleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordPuzzleView.swift; sourceTree = "<group>"; };
|
||||
558DB7B12E2A78A5004D6ADB /* wordlist.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = wordlist.txt; sourceTree = "<group>"; };
|
||||
559E6D7B2C34EAE700C971B9 /* IapManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IapManager.swift; sourceTree = "<group>"; };
|
||||
559E6D7D2C35355200C971B9 /* LogManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogManager.swift; sourceTree = "<group>"; };
|
||||
55A954A12BBBFD0C00BF181E /* GrammarData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GrammarData.swift; sourceTree = "<group>"; };
|
||||
@ -94,6 +110,8 @@
|
||||
55BB127C2BBD6D0600D2BEA4 /* CameraView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraView.swift; sourceTree = "<group>"; };
|
||||
55BC47482C3A383A00120A7D /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = "<group>"; };
|
||||
55BC47502C3D431300120A7D /* IAPView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IAPView.swift; sourceTree = "<group>"; };
|
||||
55C6DB902E2E2AEA00D4C5E5 /* puzzle.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = puzzle.txt; sourceTree = "<group>"; };
|
||||
55C6DB942E2E2ED700D4C5E5 /* PuzzleGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PuzzleGenerator.swift; sourceTree = "<group>"; };
|
||||
55C73D7E2C157C2200041C66 /* AIGrammar.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AIGrammar.entitlements; sourceTree = "<group>"; };
|
||||
55D632F92C0F125D00443894 /* NetworkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = "<group>"; };
|
||||
55DAC6542BBA959500BDD4C8 /* ResultView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultView.swift; sourceTree = "<group>"; };
|
||||
@ -116,6 +134,7 @@
|
||||
55BC474F2C3A4E5E00120A7D /* ToastUI in Frameworks */,
|
||||
67F268687FCD2E4F2F4462C0 /* Pods_AIGrammar.framework in Frameworks */,
|
||||
55EF5C3E2C2263460060CE47 /* StoreKit.framework in Frameworks */,
|
||||
555027392C81C0ED00A05441 /* QCloudTTS.xcframework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -152,12 +171,14 @@
|
||||
5500A3832BB3C7E80065A1D3 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
551C8C332C79946700B1A88C /* GoogleService-Info.plist */,
|
||||
5500A38E2BB3C7E80065A1D3 /* AIGrammar */,
|
||||
5500A3A42BB3C7EC0065A1D3 /* AIGrammarTests */,
|
||||
5500A3AE2BB3C7EC0065A1D3 /* AIGrammarUITests */,
|
||||
5500A38D2BB3C7E80065A1D3 /* Products */,
|
||||
B164443BE53434F82C385E52 /* Pods */,
|
||||
40FEAE98949AC44A40547B20 /* Frameworks */,
|
||||
558DB7A72E292893004D6ADB /* Resource */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@ -174,6 +195,11 @@
|
||||
5500A38E2BB3C7E80065A1D3 /* AIGrammar */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
55C6DB962E2E2F3200D4C5E5 /* Resources */,
|
||||
55C6DB932E2E2EA400D4C5E5 /* Models */,
|
||||
5550273A2C8311CB00A05441 /* Info.plist */,
|
||||
5586E0842C8093DF00026733 /* third-party */,
|
||||
5586E0832C8092C400026733 /* AIGrammar-Bridging-Header.h */,
|
||||
55BC47472C3A380C00120A7D /* CommView */,
|
||||
55C73D7E2C157C2200041C66 /* AIGrammar.entitlements */,
|
||||
55DAC6532BBA956100BDD4C8 /* GrammarSubView */,
|
||||
@ -224,6 +250,7 @@
|
||||
5500A3C52BB40AD30065A1D3 /* TranslateView.swift */,
|
||||
5500A3C72BB40ADE0065A1D3 /* SettingsView.swift */,
|
||||
55BC47502C3D431300120A7D /* IAPView.swift */,
|
||||
558DB7A42E27B049004D6ADB /* WordPuzzleView.swift */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
@ -237,6 +264,8 @@
|
||||
559E6D7B2C34EAE700C971B9 /* IapManager.swift */,
|
||||
559E6D7D2C35355200C971B9 /* LogManager.swift */,
|
||||
55E4E8F42C60CFFC00988503 /* CommFunc.swift */,
|
||||
5586E0872C80AD2D00026733 /* TTSManager.swift */,
|
||||
5550273B2C8322F800A05441 /* PushHandler.swift */,
|
||||
);
|
||||
path = lib;
|
||||
sourceTree = "<group>";
|
||||
@ -250,6 +279,21 @@
|
||||
path = ViewModel;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5586E0842C8093DF00026733 /* third-party */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
555027382C81C0ED00A05441 /* QCloudTTS.xcframework */,
|
||||
);
|
||||
path = "third-party";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
558DB7A72E292893004D6ADB /* Resource */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = Resource;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
55BC47472C3A380C00120A7D /* CommView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -258,6 +302,23 @@
|
||||
path = CommView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
55C6DB932E2E2EA400D4C5E5 /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
55C6DB942E2E2ED700D4C5E5 /* PuzzleGenerator.swift */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
55C6DB962E2E2F3200D4C5E5 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
558DB7B12E2A78A5004D6ADB /* wordlist.txt */,
|
||||
55C6DB902E2E2AEA00D4C5E5 /* puzzle.txt */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
55DAC6532BBA956100BDD4C8 /* GrammarSubView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -401,6 +462,9 @@
|
||||
files = (
|
||||
5500A3972BB3C7EB0065A1D3 /* Preview Assets.xcassets in Resources */,
|
||||
5500A3942BB3C7EB0065A1D3 /* Assets.xcassets in Resources */,
|
||||
55C6DB912E2E2AEA00D4C5E5 /* puzzle.txt in Resources */,
|
||||
558DB7B22E2A78A5004D6ADB /* wordlist.txt in Resources */,
|
||||
551C8C342C79946700B1A88C /* GoogleService-Info.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -529,6 +593,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5500A3992BB3C7EB0065A1D3 /* Persistence.swift in Sources */,
|
||||
558DB7A52E27B049004D6ADB /* WordPuzzleView.swift in Sources */,
|
||||
55DAC6572BBA984B00BDD4C8 /* InputView.swift in Sources */,
|
||||
55A954A22BBBFD0C00BF181E /* GrammarData.swift in Sources */,
|
||||
55BB12792BBD4C9900D2BEA4 /* RichText.swift in Sources */,
|
||||
@ -538,6 +603,8 @@
|
||||
5500A3C42BB40AC40065A1D3 /* WordsView.swift in Sources */,
|
||||
5509CEF12BB54DD10056C5C2 /* Config.swift in Sources */,
|
||||
55BB127B2BBD653100D2BEA4 /* ShareSheet.swift in Sources */,
|
||||
5550273C2C8322F800A05441 /* PushHandler.swift in Sources */,
|
||||
55C6DB952E2E2ED700D4C5E5 /* PuzzleGenerator.swift in Sources */,
|
||||
5500A3C82BB40ADE0065A1D3 /* SettingsView.swift in Sources */,
|
||||
55E4E8F52C60CFFC00988503 /* CommFunc.swift in Sources */,
|
||||
55DAC6552BBA959500BDD4C8 /* ResultView.swift in Sources */,
|
||||
@ -547,6 +614,7 @@
|
||||
5500A3922BB3C7E80065A1D3 /* ContentView.swift in Sources */,
|
||||
55BB127D2BBD6D0600D2BEA4 /* CameraView.swift in Sources */,
|
||||
559E6D7C2C34EAE700C971B9 /* IapManager.swift in Sources */,
|
||||
5586E0882C80AD2D00026733 /* TTSManager.swift in Sources */,
|
||||
55EF5C3C2C2250900060CE47 /* IAPTestView.swift in Sources */,
|
||||
5500A3902BB3C7E80065A1D3 /* AIGrammarApp.swift in Sources */,
|
||||
5500A39C2BB3C7EB0065A1D3 /* AIGrammar.xcdatamodeld in Sources */,
|
||||
@ -641,7 +709,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
@ -698,7 +766,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
@ -720,7 +788,15 @@
|
||||
DEVELOPMENT_ASSET_PATHS = "\"AIGrammar/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = G8UMWM9TLL;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
EXCLUDED_ARCHS = x86_64;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/AIGrammar/third-party",
|
||||
"$(PROJECT_DIR)/AIGrammar/third-party/ios-arm64_armv7",
|
||||
"$(PROJECT_DIR)/AIGrammar/third-party/ios-arm64_i386_x86_64-simulator",
|
||||
);
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = AIGrammar/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = EasyGrammar;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.education";
|
||||
INFOPLIST_KEY_NSCameraUsageDescription = "Camera access is required to capture text for grammar and spelling correction.";
|
||||
@ -733,12 +809,92 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
MARKETING_VERSION = 1.1;
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
"-ObjC",
|
||||
"-l\"c++\"",
|
||||
"-l\"sqlite3\"",
|
||||
"-l\"z\"",
|
||||
"-framework",
|
||||
"\"Alamofire\"",
|
||||
"-framework",
|
||||
"\"CFNetwork\"",
|
||||
"-framework",
|
||||
"\"CoreTelephony\"",
|
||||
"-framework",
|
||||
"\"Cryptor\"",
|
||||
"-framework",
|
||||
"\"CryptorECC\"",
|
||||
"-framework",
|
||||
"\"CryptorRSA\"",
|
||||
"-framework",
|
||||
"\"FBLPromises\"",
|
||||
"-framework",
|
||||
"\"FirebaseABTesting\"",
|
||||
"-framework",
|
||||
"\"FirebaseAnalytics\"",
|
||||
"-framework",
|
||||
"\"FirebaseCore\"",
|
||||
"-framework",
|
||||
"\"FirebaseCoreExtension\"",
|
||||
"-framework",
|
||||
"\"FirebaseCoreInternal\"",
|
||||
"-framework",
|
||||
"\"FirebaseCrashlytics\"",
|
||||
"-framework",
|
||||
"\"FirebaseInstallations\"",
|
||||
"-framework",
|
||||
"\"FirebasePerformance\"",
|
||||
"-framework",
|
||||
"\"FirebaseRemoteConfig\"",
|
||||
"-framework",
|
||||
"\"FirebaseRemoteConfigInterop\"",
|
||||
"-framework",
|
||||
"\"FirebaseSessions\"",
|
||||
"-framework",
|
||||
"\"FirebaseSharedSwift\"",
|
||||
"-framework",
|
||||
"\"Foundation\"",
|
||||
"-framework",
|
||||
"\"GoogleAppMeasurement\"",
|
||||
"-framework",
|
||||
"\"GoogleAppMeasurementIdentitySupport\"",
|
||||
"-framework",
|
||||
"\"GoogleDataTransport\"",
|
||||
"-framework",
|
||||
"\"GoogleUtilities\"",
|
||||
"-framework",
|
||||
"\"KituraContracts\"",
|
||||
"-framework",
|
||||
"\"LoggerAPI\"",
|
||||
"-framework",
|
||||
"\"Logging\"",
|
||||
"-framework",
|
||||
"\"Promises\"",
|
||||
"-framework",
|
||||
"\"Security\"",
|
||||
"-framework",
|
||||
"\"StoreKit\"",
|
||||
"-framework",
|
||||
"\"SwiftJWT\"",
|
||||
"-framework",
|
||||
"\"SwiftyBeaver\"",
|
||||
"-framework",
|
||||
"\"SystemConfiguration\"",
|
||||
"-framework",
|
||||
"\"TrustDecision\"",
|
||||
"-framework",
|
||||
"\"UIKit\"",
|
||||
"-framework",
|
||||
"\"nanopb\"",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.easyprompts.aigrammar;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/AIGrammar/AIGrammar-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
};
|
||||
@ -756,7 +912,15 @@
|
||||
DEVELOPMENT_ASSET_PATHS = "\"AIGrammar/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = G8UMWM9TLL;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
EXCLUDED_ARCHS = x86_64;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/AIGrammar/third-party",
|
||||
"$(PROJECT_DIR)/AIGrammar/third-party/ios-arm64_armv7",
|
||||
"$(PROJECT_DIR)/AIGrammar/third-party/ios-arm64_i386_x86_64-simulator",
|
||||
);
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = AIGrammar/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = EasyGrammar;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.education";
|
||||
INFOPLIST_KEY_NSCameraUsageDescription = "Camera access is required to capture text for grammar and spelling correction.";
|
||||
@ -769,12 +933,93 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
MARKETING_VERSION = 1.1;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
"-ObjC",
|
||||
"-l\"c++\"",
|
||||
"-l\"sqlite3\"",
|
||||
"-l\"z\"",
|
||||
"-framework",
|
||||
"\"Alamofire\"",
|
||||
"-framework",
|
||||
"\"CFNetwork\"",
|
||||
"-framework",
|
||||
"\"CoreTelephony\"",
|
||||
"-framework",
|
||||
"\"Cryptor\"",
|
||||
"-framework",
|
||||
"\"CryptorECC\"",
|
||||
"-framework",
|
||||
"\"CryptorRSA\"",
|
||||
"-framework",
|
||||
"\"FBLPromises\"",
|
||||
"-framework",
|
||||
"\"FirebaseABTesting\"",
|
||||
"-framework",
|
||||
"\"FirebaseAnalytics\"",
|
||||
"-framework",
|
||||
"\"FirebaseCore\"",
|
||||
"-framework",
|
||||
"\"FirebaseCoreExtension\"",
|
||||
"-framework",
|
||||
"\"FirebaseCoreInternal\"",
|
||||
"-framework",
|
||||
"\"FirebaseCrashlytics\"",
|
||||
"-framework",
|
||||
"\"FirebaseInstallations\"",
|
||||
"-framework",
|
||||
"\"FirebasePerformance\"",
|
||||
"-framework",
|
||||
"\"FirebaseRemoteConfig\"",
|
||||
"-framework",
|
||||
"\"FirebaseRemoteConfigInterop\"",
|
||||
"-framework",
|
||||
"\"FirebaseSessions\"",
|
||||
"-framework",
|
||||
"\"FirebaseSharedSwift\"",
|
||||
"-framework",
|
||||
"\"Foundation\"",
|
||||
"-framework",
|
||||
"\"GoogleAppMeasurement\"",
|
||||
"-framework",
|
||||
"\"GoogleAppMeasurementIdentitySupport\"",
|
||||
"-framework",
|
||||
"\"GoogleDataTransport\"",
|
||||
"-framework",
|
||||
"\"GoogleUtilities\"",
|
||||
"-framework",
|
||||
"\"KituraContracts\"",
|
||||
"-framework",
|
||||
"\"LoggerAPI\"",
|
||||
"-framework",
|
||||
"\"Logging\"",
|
||||
"-framework",
|
||||
"\"Promises\"",
|
||||
"-framework",
|
||||
"\"Security\"",
|
||||
"-framework",
|
||||
"\"StoreKit\"",
|
||||
"-framework",
|
||||
"\"SwiftJWT\"",
|
||||
"-framework",
|
||||
"\"SwiftyBeaver\"",
|
||||
"-framework",
|
||||
"\"SystemConfiguration\"",
|
||||
"-framework",
|
||||
"\"TrustDecision\"",
|
||||
"-framework",
|
||||
"\"UIKit\"",
|
||||
"-framework",
|
||||
"\"nanopb\"",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.easyprompts.aigrammar;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/AIGrammar/AIGrammar-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
};
|
||||
@ -796,7 +1041,7 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AIGrammar.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/AIGrammar";
|
||||
};
|
||||
name = Debug;
|
||||
@ -817,7 +1062,7 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AIGrammar.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/AIGrammar";
|
||||
};
|
||||
name = Release;
|
||||
@ -826,7 +1071,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7C535B875DDD6400217E60EC /* Pods-AIGrammar-AIGrammarUITests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = G8UMWM9TLL;
|
||||
@ -836,7 +1081,7 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
TEST_TARGET_NAME = AIGrammar;
|
||||
};
|
||||
name = Debug;
|
||||
@ -845,7 +1090,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C6DB81180B641DF0F1C587D7 /* Pods-AIGrammar-AIGrammarUITests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = G8UMWM9TLL;
|
||||
@ -855,7 +1100,7 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
TEST_TARGET_NAME = AIGrammar;
|
||||
};
|
||||
name = Release;
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
version = "1.7">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
buildImplicitDependencies = "YES"
|
||||
buildArchitectures = "Automatic">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
@ -62,7 +63,9 @@
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
allowLocationSimulation = "YES"
|
||||
consoleMode = "0"
|
||||
structuredConsoleMode = "1">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
{
|
||||
"originHash" : "4cc917013fcb1cfbea2ef0b3ac55f8f52006f5ddd130b6595949a84fd623c817",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "toastui",
|
||||
@ -10,5 +11,5 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"version" : 2
|
||||
"version" : 3
|
||||
}
|
||||
|
||||
BIN
AIGrammar.xcworkspace/xcuserdata/oscar.xcuserdatad/UserInterfaceState.xcuserstate
generated
Normal file
BIN
AIGrammar.xcworkspace/xcuserdata/oscar.xcuserdatad/UserInterfaceState.xcuserstate
generated
Normal file
Binary file not shown.
14
AIGrammar/AIGrammar-Bridging-Header.h
Normal file
14
AIGrammar/AIGrammar-Bridging-Header.h
Normal file
@ -0,0 +1,14 @@
|
||||
//
|
||||
// AIGrammar-Bridging-Header.h
|
||||
// AIGrammar
|
||||
//
|
||||
// Created by oscar on 2024/8/29.
|
||||
//
|
||||
|
||||
#ifndef AIGrammar_Bridging_Header_h
|
||||
#define AIGrammar_Bridging_Header_h
|
||||
|
||||
#import "QCloudTTS/QCloudTTSEngine.h"
|
||||
#import "QCloudTTS/QCloudMediaPlayer2.h"
|
||||
|
||||
#endif /* AIGrammar_Bridging_Header_h */
|
||||
@ -1,5 +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/>
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@ -8,23 +8,102 @@
|
||||
import SwiftUI
|
||||
import TrustDecision
|
||||
|
||||
import Combine
|
||||
import Firebase
|
||||
import FirebaseAnalytics
|
||||
import FirebaseCrashlytics
|
||||
|
||||
@main
|
||||
struct AIGrammarApp: App {
|
||||
|
||||
// 获取 AppDelegate 的实例
|
||||
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
||||
let persistenceController = PersistenceController.shared
|
||||
@StateObject private var appState = NofifyState()
|
||||
@State private var urlToOpen: String?
|
||||
|
||||
init() {
|
||||
// 将当前实例传递给 AppDelegate
|
||||
appDelegate.app = self
|
||||
|
||||
// 初始化部分
|
||||
setupLogging()
|
||||
_ = InitApp.shared
|
||||
|
||||
// firebase 默认info级别,这里修改成线上级别。
|
||||
FirebaseConfiguration.shared.setLoggerLevel(.error)
|
||||
FirebaseApp.configure()
|
||||
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)
|
||||
|
||||
// 测试一下崩溃,需要移除。
|
||||
// Crashlytics.crashlytics().log("Test crash")
|
||||
// fatalError("Test crash from Crashlytics")
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
AllTabView()
|
||||
AllTabView(selectedTab: $appState.selectedTab, showPromotion: $appState.showPromotion, promotionMode: $appState.promotionMode)
|
||||
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
||||
.environmentObject(IAPManager()) // 这里添加 IAPManager
|
||||
.environmentObject(globalEnvironment) // 这里添加 IAPManager
|
||||
.environmentObject(appState)
|
||||
.preferredColorScheme(.light) // 强制整个应用使用亮色模式
|
||||
.sheet(isPresented: $appState.showPromotion) {
|
||||
switch appState.promotionMode {
|
||||
case .halfScreen:
|
||||
PromotionView() // 半屏模式
|
||||
.presentationDetents([.medium])
|
||||
case .fullScreen:
|
||||
PromotionView() // 全屏模式
|
||||
.edgesIgnoringSafeArea(.all)
|
||||
default:
|
||||
EmptyView()
|
||||
}
|
||||
}
|
||||
.onChange(of: urlToOpen) { url in
|
||||
if let url = url, let link = URL(string: url) {
|
||||
UIApplication.shared.open(link)
|
||||
}
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in
|
||||
handlePushNotification()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 这个是在app外打开链接,实际上不应该用到。
|
||||
func openURL(urlString: String) {
|
||||
urlToOpen = urlString
|
||||
}
|
||||
|
||||
func handlePushNotification() {
|
||||
// 确保在主线程中更新视图
|
||||
DispatchQueue.main.async {
|
||||
let pushInfo = globalEnvironment.pushSettings
|
||||
// 切换到对应的tab
|
||||
if pushInfo.gotoTab >= 0 && pushInfo.gotoTab < 4 {
|
||||
self.appState.selectedTab = pushInfo.gotoTab
|
||||
}else {
|
||||
logger.info("invalid goto Tab: \(pushInfo.gotoTab)")
|
||||
}
|
||||
// 是否显示本地页面
|
||||
if pushInfo.showPage && pushInfo.page != "" {
|
||||
self.appState.showPromotion = true
|
||||
switch pushInfo.showMode {
|
||||
case "halfScreen" :
|
||||
self.appState.promotionMode = PromotionDisplayType.halfScreen
|
||||
case "fullScreen" :
|
||||
self.appState.promotionMode = PromotionDisplayType.fullScreen
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
// 是否显示远程页面
|
||||
if pushInfo.showPage && pushInfo.openURL != "" {
|
||||
urlToOpen = pushInfo.openURL
|
||||
}
|
||||
|
||||
logger.info("Push Values. gotoTab: \(pushInfo.gotoTab), showPage: \(pushInfo.showPage), page: \(pushInfo.page), showMode: \(pushInfo.showMode), url: \(pushInfo.openURL)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,36 +9,66 @@ import SwiftUI
|
||||
|
||||
|
||||
struct AllTabView: View {
|
||||
// 当前正在展示的tab
|
||||
@Binding var selectedTab: Int
|
||||
@Binding var showPromotion: Bool
|
||||
@Binding var promotionMode: PromotionDisplayType
|
||||
|
||||
var body: some View {
|
||||
TabView {
|
||||
TabView(selection: $selectedTab) {
|
||||
GrammarCheckView()
|
||||
.tabItem {
|
||||
Image(systemName: "book.fill")
|
||||
Text("Grammar Check")
|
||||
}
|
||||
.tag(0)
|
||||
|
||||
WordsView()
|
||||
.tabItem {
|
||||
Image(systemName: "text.bubble")
|
||||
Text("Words")
|
||||
}
|
||||
.tag(1)
|
||||
|
||||
TranslateView()
|
||||
.tabItem {
|
||||
Image(systemName: "globe")
|
||||
Text("Translate")
|
||||
}
|
||||
.tag(2)
|
||||
|
||||
WordPuzzleView()
|
||||
.tabItem {
|
||||
Image(systemName: "timer.circle")
|
||||
//Image(systemName: "rectangle.3.group")
|
||||
Text("Puzzel")
|
||||
}
|
||||
.tag(3)
|
||||
|
||||
SettingsView()
|
||||
.tabItem {
|
||||
Image(systemName: "gear")
|
||||
Text("Settings")
|
||||
}
|
||||
.tag(4)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct AllTabView_Preview: View{
|
||||
@State private var selectedTab = 2
|
||||
@State private var showPromotion = false
|
||||
@State private var promotionMode: PromotionDisplayType = .halfScreen
|
||||
@State private var urlToOpen: String?
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
AllTabView(selectedTab: $selectedTab, showPromotion: $showPromotion, promotionMode: $promotionMode)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#Preview {
|
||||
AllTabView()
|
||||
AllTabView_Preview()
|
||||
}
|
||||
|
||||
BIN
AIGrammar/Assets.xcassets/AppIcon.appiconset.zip
Normal file
BIN
AIGrammar/Assets.xcassets/AppIcon.appiconset.zip
Normal file
Binary file not shown.
10
AIGrammar/Info.plist
Normal file
10
AIGrammar/Info.plist
Normal file
@ -0,0 +1,10 @@
|
||||
<?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>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>remote-notification</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
112
AIGrammar/Models/PuzzleGenerator.swift
Normal file
112
AIGrammar/Models/PuzzleGenerator.swift
Normal file
@ -0,0 +1,112 @@
|
||||
//
|
||||
// PuzzleGenerator.swift
|
||||
// AIGrammar
|
||||
//
|
||||
// Created by oscar on 2025/7/21.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
class PuzzleGenerator {
|
||||
private(set) var validationWords: Set<String> = []
|
||||
private(set) var puzzleWords: [String] = []
|
||||
|
||||
init() {
|
||||
//loadValidationWords()
|
||||
//loadPuzzleWords()
|
||||
validationWords = Set(loadWords(from: "wordlist"))
|
||||
puzzleWords = loadWords(from: "puzzle")
|
||||
}
|
||||
|
||||
/// 通用加载逻辑
|
||||
private func loadWords(from fileName: String) -> [String] {
|
||||
if let url = Bundle.main.url(forResource: fileName, withExtension: "txt") {
|
||||
do {
|
||||
let content = try String(contentsOf: url)
|
||||
let words = content
|
||||
.components(separatedBy: .newlines)
|
||||
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() }
|
||||
.filter { !$0.isEmpty }
|
||||
logger.info("Loaded \(words.count) words from \(fileName).txt")
|
||||
return words
|
||||
} catch {
|
||||
logger.warning("Failed to load \(fileName).txt: \(error)")
|
||||
}
|
||||
} else {
|
||||
logger.warning("\(fileName).txt not found!")
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
/// 加载验证单词库
|
||||
private func loadValidationWords() {
|
||||
if let url = Bundle.main.url(forResource: "wordlist", withExtension: "txt") {
|
||||
do {
|
||||
let content = try String(contentsOf: url)
|
||||
validationWords = Set(content
|
||||
.components(separatedBy: .newlines)
|
||||
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() }
|
||||
.filter { !$0.isEmpty })
|
||||
logger.info("Loaded validation words: \(validationWords.count)")
|
||||
} catch {
|
||||
logger.warning("Failed to load wordlist.txt: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 加载出题单词库
|
||||
private func loadPuzzleWords() {
|
||||
if let url = Bundle.main.url(forResource: "puzzle", withExtension: "txt") {
|
||||
do {
|
||||
let content = try String(contentsOf: url)
|
||||
puzzleWords = content
|
||||
.components(separatedBy: .newlines)
|
||||
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() }
|
||||
.filter { !$0.isEmpty }
|
||||
logger.info("Loaded puzzle words: \(puzzleWords.count)")
|
||||
} catch {
|
||||
logger.warning("Failed to load puzzle.txt: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 随机生成一套题目
|
||||
func generatePuzzle() -> (Set<String>, [[String]]) {
|
||||
var chosenWords: Set<String> = []
|
||||
var uniqueLetters: Set<Character> = []
|
||||
|
||||
while (uniqueLetters.count < 16 && chosenWords.count < 6) || chosenWords.count < 4 {
|
||||
if let word = puzzleWords.randomElement() {
|
||||
chosenWords.insert(word)
|
||||
uniqueLetters.formUnion(word)
|
||||
}
|
||||
}
|
||||
|
||||
// 保证16个不同字母
|
||||
var selectedLetters = Array(uniqueLetters)
|
||||
let alphabet = Array("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
while selectedLetters.count < 16 {
|
||||
let randomLetter = alphabet.randomElement()!
|
||||
if !selectedLetters.contains(randomLetter) {
|
||||
selectedLetters.append(randomLetter)
|
||||
}
|
||||
}
|
||||
|
||||
let shuffledLetters = selectedLetters.shuffled()
|
||||
|
||||
var letters: [[String]] = Array(repeating: Array(repeating: "", count: 4), count: 4)
|
||||
for i in 0..<4 {
|
||||
for j in 0..<4 {
|
||||
letters[i][j] = String(shuffledLetters[i * 4 + j])
|
||||
}
|
||||
}
|
||||
|
||||
return (chosenWords, letters)
|
||||
}
|
||||
|
||||
/// 校验用户提交的单词
|
||||
func validate(word: String) -> Bool {
|
||||
validationWords.contains(word.uppercased())
|
||||
}
|
||||
}
|
||||
2868
AIGrammar/Resources/puzzle.txt
Normal file
2868
AIGrammar/Resources/puzzle.txt
Normal file
File diff suppressed because it is too large
Load Diff
35774
AIGrammar/Resources/wordlist.txt
Normal file
35774
AIGrammar/Resources/wordlist.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,6 +7,7 @@
|
||||
|
||||
import SwiftUI
|
||||
import ToastUI
|
||||
import FirebaseAnalytics
|
||||
|
||||
fileprivate struct BuyProView: View {
|
||||
var onTryForFree: () -> Void
|
||||
@ -27,6 +28,12 @@ fileprivate struct BuyProView: View {
|
||||
// 按钮动作
|
||||
// 触发显示VIP付费界面的事件
|
||||
onTryForFree()
|
||||
|
||||
// 记录事件
|
||||
Analytics.logEvent(globalAnalyticsEvents.eventEnterPurchase, parameters: [
|
||||
globalAnalyticsEvents.keyPurchaseEntry: globalAnalyticsEvents.valEntryBuyProBtn as NSObject,
|
||||
globalAnalyticsEvents.keyDeviceID: globalEnvironment.deviceID as NSObject
|
||||
])
|
||||
}
|
||||
.padding(.vertical, 6) // 调整高度为默认高度的2/3
|
||||
.padding(.horizontal, 20)
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
// Created by oscar on 2024/7/9.
|
||||
//
|
||||
import SwiftUI
|
||||
import FirebaseAnalytics
|
||||
|
||||
struct VIPPaymentView: View {
|
||||
@Environment(\.presentationMode) var presentationMode
|
||||
@ -159,6 +160,13 @@ struct VIPPaymentView: View {
|
||||
private func buyProduct() {
|
||||
let productId = products[selectedProductIndex].4
|
||||
logger.info("selected productId: \(productId.rawValue)")
|
||||
|
||||
// 记录事件
|
||||
Analytics.logEvent(globalAnalyticsEvents.eventPurchase, parameters: [
|
||||
globalAnalyticsEvents.keyPurchaseItem: productId.rawValue as NSObject,
|
||||
globalAnalyticsEvents.keyDeviceID: globalEnvironment.deviceID as NSObject
|
||||
])
|
||||
|
||||
if let product = iapManager.products.first(where: { $0.id == productId.rawValue }) {
|
||||
Task {
|
||||
await iapManager.buy(product: product) { result in
|
||||
|
||||
@ -9,6 +9,8 @@ import SwiftUI
|
||||
import ToastUI
|
||||
|
||||
import SafariServices
|
||||
import FirebaseAnalytics
|
||||
import SwiftyBeaver
|
||||
|
||||
struct FullScreenSafariView: UIViewControllerRepresentable {
|
||||
let url: URL
|
||||
@ -60,6 +62,8 @@ struct SettingsView: View {
|
||||
@State private var useSandboxEnvironment = false
|
||||
@State private var useDevelopmentEnvironment = false
|
||||
|
||||
@State private var showingLogShareSheet = false
|
||||
@State private var logFileURL: URL?
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
@ -69,6 +73,12 @@ struct SettingsView: View {
|
||||
settingItem(icon: "arrow.up.circle", text: "Upgrade to Premium", isBold: true)
|
||||
.onTapGesture {
|
||||
showVIPPaymentView = true
|
||||
|
||||
// 记录事件
|
||||
Analytics.logEvent(globalAnalyticsEvents.eventEnterPurchase, parameters: [
|
||||
globalAnalyticsEvents.keyPurchaseEntry: globalAnalyticsEvents.valEntrySettingsBtn as NSObject,
|
||||
globalAnalyticsEvents.keyDeviceID: globalEnvironment.deviceID as NSObject
|
||||
])
|
||||
}
|
||||
|
||||
// Feedback
|
||||
@ -114,10 +124,31 @@ struct SettingsView: View {
|
||||
VStack {
|
||||
Toggle("Sandbox", isOn: $useSandboxEnvironment)
|
||||
Toggle("TestEnv", isOn: $useDevelopmentEnvironment)
|
||||
Button("Save") {
|
||||
saveSettings()
|
||||
showingAdvancedSettings = false
|
||||
HStack {
|
||||
Button("View Logs") {
|
||||
if let logURL = getLogFileURL() {
|
||||
if FileManager.default.fileExists(atPath: logURL.path) {
|
||||
logger.info("Log file exists: \(logURL.path)")
|
||||
self.logFileURL = logURL
|
||||
self.showingLogShareSheet = true
|
||||
} else {
|
||||
logger.error("Log file does not exist.")
|
||||
self.toastText = "Log file not found."
|
||||
self.showingToast = true
|
||||
}
|
||||
} else {
|
||||
self.toastText = "Log file not found."
|
||||
self.showingToast = true
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
Button("Save") {
|
||||
saveSettings()
|
||||
showingAdvancedSettings = false
|
||||
}
|
||||
}
|
||||
.padding(.horizontal,15)
|
||||
.padding(.top, 15)
|
||||
}
|
||||
.padding(.vertical,10)
|
||||
.padding(.horizontal, 20)
|
||||
@ -135,6 +166,11 @@ struct SettingsView: View {
|
||||
self.showingAdvancedSettings = false // 确保隐藏组件在视图消失时不显示
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $showingLogShareSheet) {
|
||||
if let url = logFileURL {
|
||||
ShareSheetLog(activityItems: [url])
|
||||
}
|
||||
}
|
||||
.toast(isPresented: $showingToast, dismissAfter: globalEnvironment.toastPresentMsNormal) {
|
||||
HStack {
|
||||
Image(systemName: "exclamationmark.bubble")
|
||||
@ -152,12 +188,12 @@ struct SettingsView: View {
|
||||
LoadingView()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 定义隐藏功能
|
||||
private var gestureArea: some View {
|
||||
Color.clear
|
||||
.contentShape(Rectangle()) // 为透明色定义一个矩形可命中区域
|
||||
.frame(height: 150) // 可以根据需要调整手势区域的大小
|
||||
.frame(height: 50) // 可以根据需要调整手势区域的大小
|
||||
.gesture(
|
||||
DragGesture(minimumDistance: 50, coordinateSpace: .global)
|
||||
.onEnded { value in
|
||||
@ -229,6 +265,20 @@ struct SettingsView: View {
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct ShareSheetLog: UIViewControllerRepresentable {
|
||||
var activityItems: [Any]
|
||||
|
||||
func makeUIViewController(context: Context) -> UIActivityViewController {
|
||||
let controller = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)
|
||||
return controller
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: UIActivityViewController, context: Context) {
|
||||
// Nothing to update here
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingsView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SettingsView()
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
import SwiftUI
|
||||
import AVFoundation
|
||||
import ToastUI
|
||||
import FirebaseAnalytics
|
||||
|
||||
struct SubmitTextEditor: UIViewRepresentable {
|
||||
@Binding var text: String
|
||||
@ -271,7 +272,9 @@ struct TranslateCardView: View {
|
||||
var onEdit: (String) -> Void
|
||||
var onCopy: (String) -> Void
|
||||
var onFeedback: (TranslateFeedback) -> Void
|
||||
let synthesizer = AVSpeechSynthesizer()
|
||||
|
||||
// 创建委托类的实例
|
||||
@State private var isSynthesizing = false
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
@ -285,15 +288,15 @@ struct TranslateCardView: View {
|
||||
Text(translation.input)
|
||||
.padding(.bottom, 3)
|
||||
HStack {
|
||||
/*
|
||||
|
||||
Button(action: {
|
||||
speakText(translation.input)
|
||||
synthesizeAndPlay(text: translation.input, lang: "Original")
|
||||
}) {
|
||||
Image(systemName: "speaker.wave.2")
|
||||
.foregroundColor(.blue)
|
||||
.padding(.trailing)
|
||||
}
|
||||
*/
|
||||
|
||||
Spacer()
|
||||
Button(action: {
|
||||
onEdit(translation.input)
|
||||
@ -315,14 +318,14 @@ struct TranslateCardView: View {
|
||||
.padding(.vertical, 1) // 减少与分割线的间距
|
||||
.padding(.bottom, 3) // 减少与原文之间的间距
|
||||
HStack {
|
||||
/*
|
||||
|
||||
Button(action: {
|
||||
speakText(translation.translation)
|
||||
synthesizeAndPlay(text: translation.translation, lang: "Translated")
|
||||
}) {
|
||||
Image(systemName: "speaker.wave.2")
|
||||
.foregroundColor(.blue)
|
||||
}
|
||||
*/
|
||||
|
||||
Spacer()
|
||||
HStack(spacing: 15) {// 减小图标之间的间距
|
||||
Button(action: {
|
||||
@ -362,14 +365,27 @@ struct TranslateCardView: View {
|
||||
.background(Color.gray.opacity(0.2)) // 设置整个卡片的背景色为LightGray
|
||||
.overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.gray, lineWidth: 1))
|
||||
}
|
||||
|
||||
func speakText(_ text: String) {
|
||||
let utterance = AVSpeechUtterance(string: text)
|
||||
utterance.voice = AVSpeechSynthesisVoice(language: "en-US")
|
||||
synthesizer.speak(utterance)
|
||||
|
||||
func synthesizeAndPlay(text: String, lang: String) {
|
||||
// 记录事件
|
||||
Analytics.logEvent("TTSClick", parameters: [
|
||||
"vendor": "TencentTTS",
|
||||
"lang" : lang
|
||||
])
|
||||
|
||||
isSynthesizing = true
|
||||
TTSManager.shared.synthesizeAndPlay(text: text, isVIP: globalEnvironment.isVip, onSuccess: {
|
||||
isSynthesizing = false
|
||||
logger.info("Synthesis succ.")
|
||||
}, onFailure: { error in
|
||||
isSynthesizing = false
|
||||
logger.error("Synthesis error: \(error)")
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
extension View {
|
||||
func dashed() -> some View {
|
||||
self.overlay(
|
||||
|
||||
7
AIGrammar/View/Untitled.swift
Normal file
7
AIGrammar/View/Untitled.swift
Normal file
@ -0,0 +1,7 @@
|
||||
//
|
||||
// Untitled.swift
|
||||
// AIGrammar
|
||||
//
|
||||
// Created by oscar on 2025/7/16.
|
||||
//
|
||||
|
||||
288
AIGrammar/View/WordPuzzleView.swift
Normal file
288
AIGrammar/View/WordPuzzleView.swift
Normal file
@ -0,0 +1,288 @@
|
||||
//
|
||||
// WordPuzzleViewB.swift
|
||||
// AIGrammar
|
||||
//
|
||||
// Created by oscar on 2025/7/16.
|
||||
//
|
||||
|
||||
import AVFoundation
|
||||
|
||||
var soundID: SystemSoundID = 1104 // 系统键盘点击声
|
||||
|
||||
func playKeyClickSound() {
|
||||
AudioServicesPlaySystemSound(soundID)
|
||||
}
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct WordPuzzleView: View {
|
||||
@StateObject private var viewModel = WordPuzzleViewModel()
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
Color.pink.opacity(0.2).edgesIgnoringSafeArea(.all)
|
||||
|
||||
VStack(spacing: 16) {
|
||||
// Top: score & timer
|
||||
Text("Find the Word!")
|
||||
.font(.largeTitle)
|
||||
.bold()
|
||||
.padding(.bottom, 30)
|
||||
|
||||
HStack {
|
||||
Text("Wins: \(viewModel.dailyWins)")
|
||||
.font(.headline)
|
||||
Spacer()
|
||||
Text("Words: \(viewModel.guessedWords)/4")
|
||||
.font(.headline)
|
||||
Spacer()
|
||||
Text("Time: \(viewModel.timeRemaining)s")
|
||||
.font(.headline)
|
||||
}
|
||||
.padding(.horizontal, 30)
|
||||
.padding(.bottom, 20)
|
||||
|
||||
// Grid
|
||||
GridView(letters: viewModel.letters, selectedPositions: $viewModel.selectedPositions)
|
||||
|
||||
Spacer()
|
||||
// Toast
|
||||
toastView
|
||||
.frame(height: 50)
|
||||
.frame(maxWidth: .infinity)
|
||||
//.background(viewModel.showToast ? viewModel.toastColor : Color.pink.opacity(0.0))
|
||||
.cornerRadius(8)
|
||||
.padding(.bottom, 10)
|
||||
|
||||
HStack {
|
||||
Button("Shuffle") {
|
||||
viewModel.shuffle()
|
||||
}
|
||||
.padding()
|
||||
.background(Color.orange.opacity(0.7))
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(10)
|
||||
.font(.subheadline) // 调整字体大小为标题大小
|
||||
|
||||
Spacer()
|
||||
|
||||
Button("Submit") {
|
||||
viewModel.submit()
|
||||
}
|
||||
.padding()
|
||||
.background(Color.green.opacity(0.7))
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(10)
|
||||
.font(.subheadline) // 调整字体大小为标题大小
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.padding(.bottom, 20)
|
||||
|
||||
}
|
||||
.padding()
|
||||
.onAppear {
|
||||
viewModel.startTimer()
|
||||
}
|
||||
.onDisappear {
|
||||
viewModel.stopTimer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var toastView: some View {
|
||||
HStack {
|
||||
if viewModel.showToast {
|
||||
if viewModel.toastFlag {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.green)
|
||||
} else {
|
||||
Image(systemName: "xmark.octagon.fill")
|
||||
.foregroundColor(.red)
|
||||
}
|
||||
Text(viewModel.toastMessage)
|
||||
.font(.body)
|
||||
}
|
||||
}
|
||||
.opacity(viewModel.showToast ? 1 : 0)
|
||||
.animation(.easeInOut, value: viewModel.showToast)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - GridView
|
||||
struct GridView: View {
|
||||
let letters: [[String]]
|
||||
@Binding var selectedPositions: [(row: Int, col: Int)]
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geo in
|
||||
let size = geo.size.width * 0.8
|
||||
VStack(spacing: 2) {
|
||||
ForEach(0..<letters.count, id: \.self) { row in
|
||||
HStack(spacing: 2) {
|
||||
ForEach(0..<letters[row].count, id: \.self) { col in
|
||||
let selected = selectedPositions.contains { $0.row == row && $0.col == col }
|
||||
Text(letters[row][col])
|
||||
.frame(width: size / CGFloat(letters.count),
|
||||
height: size / CGFloat(letters.count))
|
||||
.background(
|
||||
ZStack {
|
||||
if selected {
|
||||
RoundedRectangle(cornerRadius: 6)
|
||||
.fill(Color.blue.opacity(0.7))
|
||||
} else {
|
||||
RoundedRectangle(cornerRadius: 6)
|
||||
.fill(Color.white)
|
||||
.shadow(color: .gray.opacity(0.3), radius: 2, x: 0, y: 2)
|
||||
RoundedRectangle(cornerRadius: 6)
|
||||
.stroke(Color.gray.opacity(0.3), lineWidth: 0.5)
|
||||
}
|
||||
}
|
||||
)
|
||||
.foregroundColor(selected ? .white : .black)
|
||||
.onTapGesture {
|
||||
toggleSelection(row: row, col: col)
|
||||
playKeyClickSound()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(width: size, height: size)
|
||||
.padding()
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
|
||||
}
|
||||
.frame(height: 300) // 给个固定高度
|
||||
}
|
||||
|
||||
private func toggleSelection(row: Int, col: Int) {
|
||||
if let index = selectedPositions.firstIndex(where: { $0.row == row && $0.col == col }) {
|
||||
selectedPositions.remove(at: index)
|
||||
} else {
|
||||
selectedPositions.append((row, col))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - ViewModel
|
||||
class WordPuzzleViewModel: ObservableObject {
|
||||
@Published var letters: [[String]] = []
|
||||
@Published var selectedPositions: [(row: Int, col: Int)] = []
|
||||
@Published var guessedWords: Int = 0
|
||||
@Published var dailyWins: Int = 0
|
||||
@Published var timeRemaining: Int = 60
|
||||
@Published var shuffleCount: Int = 0
|
||||
|
||||
@Published var showToast = false
|
||||
@Published var toastFlag = false
|
||||
@Published var toastMessage = ""
|
||||
|
||||
private var timer: Timer?
|
||||
private var allWords: Set<String> = []
|
||||
private var submittedWords: Set<String> = []
|
||||
private let generator = PuzzleGenerator()
|
||||
|
||||
init() {
|
||||
generateNewPuzzle()
|
||||
}
|
||||
|
||||
/// 生成新题
|
||||
func generateNewPuzzle() {
|
||||
let (words, grid) = generator.generatePuzzle()
|
||||
allWords = words
|
||||
letters = grid
|
||||
|
||||
guessedWords = 0
|
||||
selectedPositions.removeAll()
|
||||
timeRemaining = 60
|
||||
//shuffleCount = 0
|
||||
|
||||
submittedWords.removeAll()
|
||||
logger.info("New puzzle with words: \(allWords)")
|
||||
}
|
||||
|
||||
func startTimer() {
|
||||
stopTimer()
|
||||
timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { _ in
|
||||
if self.timeRemaining > 0 {
|
||||
self.timeRemaining -= 1
|
||||
} else {
|
||||
self.stopTimer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func stopTimer() {
|
||||
timer?.invalidate()
|
||||
timer = nil
|
||||
}
|
||||
|
||||
func submit() {
|
||||
let word = selectedWord().uppercased()
|
||||
selectedPositions.removeAll()
|
||||
|
||||
guard !word.isEmpty else { return }
|
||||
|
||||
if timeRemaining <= 0 {
|
||||
showToast(message: "Time's up! Shuffle for new game.", succ: false)
|
||||
return
|
||||
}
|
||||
|
||||
if word.count < 3 {
|
||||
showToast(message: "At least three words.", succ: false)
|
||||
return
|
||||
}
|
||||
|
||||
if submittedWords.contains(word) {
|
||||
showToast(message: "Already submitted!", succ: false)
|
||||
return
|
||||
}
|
||||
|
||||
if generator.validate(word: word) {
|
||||
guessedWords += 1
|
||||
submittedWords.insert(word) // 记录
|
||||
showToast(message: "Correct!", succ: true)
|
||||
} else {
|
||||
showToast(message: "Please try again", succ: false)
|
||||
}
|
||||
|
||||
if guessedWords >= 4 {
|
||||
dailyWins += 1
|
||||
showToast(message: "Congratulations! Next puzzle...", succ: true)
|
||||
generateNewPuzzle()
|
||||
}
|
||||
}
|
||||
|
||||
func shuffle() {
|
||||
if shuffleCount >= 10 {
|
||||
showToast(message: "No more shuffles today", succ: false)
|
||||
return
|
||||
}
|
||||
|
||||
shuffleCount += 1
|
||||
generateNewPuzzle()
|
||||
startTimer()
|
||||
}
|
||||
|
||||
private func selectedWord() -> String {
|
||||
selectedPositions.map { letters[$0.row][$0.col] }.joined()
|
||||
}
|
||||
|
||||
private func showToast(message: String, succ: Bool) {
|
||||
toastMessage = message
|
||||
toastFlag = succ
|
||||
showToast = true
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
||||
self.showToast = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct WordPuzzleView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
WordPuzzleView()
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
WordPuzzleView()
|
||||
}
|
||||
@ -83,8 +83,35 @@ class GlobalEnvironment: ObservableObject {
|
||||
logger.info("baseHost: \(self.baseHost)")
|
||||
// 以后定义SandBox的功能,主要是商品列表的区分。
|
||||
}
|
||||
|
||||
// 使用结构体组织相关的设置
|
||||
@Published var pushSettings: PushInfo = PushInfo()
|
||||
struct PushInfo{
|
||||
var gotoTab: Int = 0
|
||||
var showPage: Bool = false
|
||||
var page: String = ""
|
||||
var showMode: String = ""
|
||||
var openURL: String = ""
|
||||
var appAtFront : Bool = false
|
||||
}
|
||||
}
|
||||
|
||||
// 全局实例
|
||||
let globalEnvironment = GlobalEnvironment()
|
||||
|
||||
|
||||
class GlobalAnalyticsEvents: ObservableObject {
|
||||
let eventPurchase = "purchase"
|
||||
let eventEnterPurchase = "enter_purchase_page"
|
||||
|
||||
let keyPurchaseEntry = "purchase_entry_point"
|
||||
let keyPurchaseItem = "purchase_product_id"
|
||||
let keyDeviceID = "device_id"
|
||||
|
||||
let valEntryBuyProBtn = "buy_pro_btn"
|
||||
let valEntrySettingsBtn = "settings_buy_btn"
|
||||
|
||||
}
|
||||
|
||||
let globalAnalyticsEvents = GlobalAnalyticsEvents()
|
||||
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ func setupLogging() {
|
||||
|
||||
|
||||
console.format = "$DHH:mm:ss$d $C$L$c $N.$F:$l - $M"
|
||||
file.format = "$Dyyyy-MM-dd HH:mm:ss.SSS$d $C$L$c $N.$F:$l - $M"
|
||||
|
||||
// 自定义颜色
|
||||
console.levelColor.verbose = "⚪️ " // White
|
||||
@ -41,3 +42,12 @@ func setupLogging() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 获取日志文件路径
|
||||
func getLogFileURL() -> URL? {
|
||||
return logger.destinations
|
||||
.compactMap { $0 as? FileDestination }
|
||||
.first?.logFileURL // 获取第一个FileDestination的日志文件URL
|
||||
}
|
||||
|
||||
|
||||
|
||||
118
AIGrammar/lib/PushHandler.swift
Normal file
118
AIGrammar/lib/PushHandler.swift
Normal file
@ -0,0 +1,118 @@
|
||||
//
|
||||
// PushHandler.swift
|
||||
// AIGrammar
|
||||
//
|
||||
// Created by oscar on 2024/8/31.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
import UserNotifications
|
||||
|
||||
enum PromotionDisplayType {
|
||||
case halfScreen
|
||||
case fullScreen
|
||||
case urlLink(String) // URL 链接,可以传递 URL 字符串
|
||||
}
|
||||
|
||||
class NofifyState: ObservableObject {
|
||||
@Published var selectedTab: Int = 0
|
||||
@Published var showPromotion: Bool = false
|
||||
@Published var promotionMode: PromotionDisplayType = .halfScreen
|
||||
}
|
||||
|
||||
class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {
|
||||
// 保存 AIGrammarApp 的实例
|
||||
var app: AIGrammarApp?
|
||||
|
||||
var window: UIWindow?
|
||||
var rootView: ContentView?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
|
||||
// 设置 UNUserNotificationCenter 的 delegate
|
||||
UNUserNotificationCenter.current().delegate = self
|
||||
|
||||
// 注册推送通知
|
||||
registerForPushNotifications()
|
||||
return true
|
||||
}
|
||||
|
||||
func registerForPushNotifications() {
|
||||
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
|
||||
logger.info("Permission granted: \(granted)")
|
||||
guard granted else { return }
|
||||
self.getNotificationSettings()
|
||||
}
|
||||
}
|
||||
|
||||
func getNotificationSettings() {
|
||||
UNUserNotificationCenter.current().getNotificationSettings { settings in
|
||||
logger.info("Notification settings: \(settings)")
|
||||
guard settings.authorizationStatus == .authorized else { return }
|
||||
DispatchQueue.main.async {
|
||||
UIApplication.shared.registerForRemoteNotifications()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
||||
let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) }
|
||||
let token = tokenParts.joined()
|
||||
logger.info("Device Token: \(token)")
|
||||
// 你可以在此处将 token 发送到你的服务器
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
|
||||
logger.error("Failed to register: \(error)")
|
||||
}
|
||||
|
||||
/*
|
||||
// 处理前台接收推送通知
|
||||
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
||||
logger.info("get push msg in willPresent")
|
||||
globalEnvironment.pushSettings.appAtFront = true
|
||||
//completionHandler([.sound, .banner])
|
||||
}
|
||||
*/
|
||||
|
||||
// 处理用户响应推送通知
|
||||
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|
||||
logger.info("get push msg in didReceive")
|
||||
let userInfo = response.notification.request.content.userInfo
|
||||
|
||||
// 解析相关的参数,保存到全局变量中。等用户唤起主界面后执行
|
||||
globalEnvironment.pushSettings.gotoTab = extractValue(from: userInfo, key: "gotoTab", defaultValue: 0, logMessage: "gotoTab not found or invalid in userInfo")
|
||||
globalEnvironment.pushSettings.showPage = extractValue(from: userInfo, key: "showPage", defaultValue: 0, logMessage: "showPage not found or invalid in userInfo") != 0
|
||||
globalEnvironment.pushSettings.page = extractValue(from: userInfo, key: "page", defaultValue: "", logMessage: "page not found or invalid in userInfo")
|
||||
globalEnvironment.pushSettings.showMode = extractValue(from: userInfo, key: "showMode", defaultValue: "", logMessage: "showMode not found or invalid in userInfo")
|
||||
globalEnvironment.pushSettings.openURL = extractValue(from: userInfo, key: "url", defaultValue: "", logMessage: "url not found or invalid in userInfo")
|
||||
|
||||
// 如果推送过来的时候,已经在前台了,需要触发一下
|
||||
if globalEnvironment.pushSettings.appAtFront {
|
||||
DispatchQueue.main.async {
|
||||
self.app?.handlePushNotification()
|
||||
}
|
||||
globalEnvironment.pushSettings.appAtFront = false
|
||||
}
|
||||
completionHandler()
|
||||
}
|
||||
|
||||
// 解析 userInfo 的通用函数
|
||||
func extractValue<T>(from userInfo: [AnyHashable: Any], key: String, defaultValue: T, logMessage: String) -> T {
|
||||
if let value = userInfo[key] as? T {
|
||||
return value
|
||||
} else {
|
||||
logger.info(logMessage)
|
||||
return defaultValue
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct PromotionView: View {
|
||||
var body: some View {
|
||||
Text("This is the Promotion View")
|
||||
}
|
||||
}
|
||||
100
AIGrammar/lib/TTSManager.swift
Normal file
100
AIGrammar/lib/TTSManager.swift
Normal file
@ -0,0 +1,100 @@
|
||||
//
|
||||
// TTSManager.swift
|
||||
// AIGrammar
|
||||
//
|
||||
// Created by oscar on 2024/8/29.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AVFAudio
|
||||
|
||||
class TTSManager: NSObject, QCloudTTSEngineDelegate {
|
||||
static let shared = TTSManager() // 单例模式
|
||||
|
||||
private var synthesizer: QCloudTTSEngine?
|
||||
private var audioPlayer: AVAudioPlayer?
|
||||
private var onSuccess: (() -> Void)?
|
||||
private var onFailure: ((String) -> Void)?
|
||||
|
||||
// 设定个非会员每天的使用上限
|
||||
private let dailyLimit = 100
|
||||
private let userDefaults = UserDefaults.standard
|
||||
|
||||
private override init() {
|
||||
super.init()
|
||||
setupSynthesizer()
|
||||
}
|
||||
|
||||
private func setupSynthesizer() {
|
||||
synthesizer = QCloudTTSEngine.getShareInstance() as? QCloudTTSEngine
|
||||
synthesizer?.engineInit(.TTS_MODE_ONLINE, delegate: self)
|
||||
synthesizer?.setOnlineAuthParam(1300230265, secretId: "AKIDmcetGuREGiDOBeIJVm4Kd1ZOUqFdD1CQ", secretKey: "UwhP3XrJfrx8IQUfpMvRznYTK5lM4rhR", token: nil)
|
||||
}
|
||||
|
||||
func synthesizeAndPlay(text: String, isVIP: Bool, onSuccess: @escaping () -> Void, onFailure: @escaping (String) -> Void) {
|
||||
if !isVIP {
|
||||
let currentDate = Date()
|
||||
let dateFormatter = DateFormatter()
|
||||
dateFormatter.dateFormat = "yyyy-MM-dd"
|
||||
let currentDateString = dateFormatter.string(from: currentDate)
|
||||
|
||||
let lastDateString = userDefaults.string(forKey: "LastCallDate") ?? ""
|
||||
var callCount = userDefaults.integer(forKey: "CallCount")
|
||||
|
||||
if currentDateString != lastDateString {
|
||||
// 如果日期变化,重置计数器
|
||||
callCount = 0
|
||||
userDefaults.set(currentDateString, forKey: "LastCallDate")
|
||||
}
|
||||
logger.info("nonVIP check limit, cnt: \(callCount), limit: \(dailyLimit)")
|
||||
if callCount >= dailyLimit {
|
||||
onFailure("Daily limit reached. Please try again tomorrow.")
|
||||
return
|
||||
} else {
|
||||
// 增加调用计数
|
||||
callCount += 1
|
||||
userDefaults.set(callCount, forKey: "CallCount")
|
||||
}
|
||||
}
|
||||
|
||||
guard let synthesizer = synthesizer else {
|
||||
onFailure("Synthesizer is not initialized.")
|
||||
return
|
||||
}
|
||||
|
||||
self.onSuccess = onSuccess
|
||||
self.onFailure = onFailure
|
||||
|
||||
let error = synthesizer.synthesize(text, utteranceId: "test")
|
||||
if let error = error {
|
||||
onFailure("Synthesis error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - QCloudTTSEngineDelegate
|
||||
func onSynthesizeData(_ data: Data?, utteranceId: String?, text: String?, engineType: Int, requestId: String?, respJson: String?) {
|
||||
guard let data = data else {
|
||||
onFailure?("Synthesis failed with no data.")
|
||||
return
|
||||
}
|
||||
|
||||
do {
|
||||
audioPlayer = try AVAudioPlayer(data: data)
|
||||
audioPlayer?.prepareToPlay()
|
||||
audioPlayer?.play()
|
||||
onSuccess?()
|
||||
} catch {
|
||||
onFailure?("Failed to play synthesized audio: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
func onError(_ error: TtsError?, utteranceId: String?, text: String?) {
|
||||
if let error = error {
|
||||
onFailure?("Synthesis error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
func onOfflineAuthInfo(_ OfflineAuthInfo: QCloudOfflineAuthInfo) {
|
||||
// 处理离线授权信息,如果需要
|
||||
}
|
||||
}
|
||||
42
AIGrammar/third-party/QCloudTTS.xcframework/Info.plist
vendored
Normal file
42
AIGrammar/third-party/QCloudTTS.xcframework/Info.plist
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
<?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>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_i386_x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>QCloudTTS.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>i386</string>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_armv7</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>QCloudTTS.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@ -0,0 +1,25 @@
|
||||
//
|
||||
// QPlayerError.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by renqiu on 2022/1/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef NS_ENUM (NSInteger,QCPlayerErrorCode){
|
||||
|
||||
QPLAYER_ERROR_CODE_EXCEPTION = -201,
|
||||
QPLAYER_ERROR_CODE_PLAY_QUEUE_IS_FULL = -202,
|
||||
QPLAYER_ERROR_CODE_AUDIO_READ_FAILEDL = -203,
|
||||
QPLAYER_ERROR_CODE_UNKNOW = -204,
|
||||
|
||||
};
|
||||
@interface QCPlayerError : NSObject
|
||||
@property (nonatomic, assign) NSInteger mCode;
|
||||
@property (nonatomic,copy)NSString *message;
|
||||
@property (nonatomic,strong)NSError *errorMessage;
|
||||
+(instancetype)getQCPlayerErrorWithMcode:(NSInteger)mCode ErrorMessage:(NSError*)errorMessage;
|
||||
@end
|
||||
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
//
|
||||
// QCloudMediaPlayer.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by renqiu on 2022/1/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <QCloudTTS/QCPlayerError.h>
|
||||
#import <QCloudTTS/QCloudPlayerDelegate.h>
|
||||
|
||||
/// <#Description#>
|
||||
@interface QCloudMediaPlayer : NSObject
|
||||
@property (assign,nonnull)id <QCloudPlayerDelegate>playerDelegate;
|
||||
//
|
||||
/// 数据入队列
|
||||
/// @param data 加入队列的音频
|
||||
/// @param text 音频对应的文本
|
||||
/// @param utteranceId 音频对应的ID
|
||||
-(void)enqueueWithData:(NSData* _Nonnull )data Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
|
||||
//
|
||||
/// 数据入队列
|
||||
/// @param data 加入队列的音频
|
||||
/// @param text 音频对应的文本
|
||||
/// @param utteranceId 音频对应的ID
|
||||
/// @param server 服务端返回的信息,包含Subtitles时会使用Subtitle来进行时间戳判断
|
||||
-(void)enqueueWithData:(NSData* _Nonnull )data Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId RespJson:(NSString* _Nullable)respjson;
|
||||
|
||||
/// 数据入队列
|
||||
/// @param file 加入队列的音频文件
|
||||
/// @param text 音频文件对应的文本
|
||||
/// @param utteranceId 音频文件对应的ID
|
||||
-(void)enqueueWithFile:(NSURL* _Nullable)file Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
|
||||
//
|
||||
/// 停止播放
|
||||
-(QCPlayerError* _Nullable)StopPlay;
|
||||
/// 暂停播放
|
||||
-(QCPlayerError* _Nullable)PausePlay;
|
||||
/// 恢复播放
|
||||
-(QCPlayerError* _Nullable)ResumePlay;
|
||||
-(NSInteger)getAudioQueueSize;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
//
|
||||
// QCloudMediaPlayer.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by renqiu on 2022/1/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <QCloudTTS/QCPlayerError.h>
|
||||
#import <QCloudTTS/QCloudMediaPlayer.h>
|
||||
|
||||
/// <#Description#>
|
||||
@interface QCloudMediaPlayer2 : NSObject
|
||||
@property (weak)id <QCloudPlayerDelegate> _Nullable playerDelegate;
|
||||
//
|
||||
/// 数据入队列
|
||||
/// @param data 加入队列的音频
|
||||
/// @param text 音频对应的文本
|
||||
/// @param utteranceId 音频对应的ID
|
||||
-(void)enqueueWithData:(NSData* _Nonnull )data Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
/// 数据入队列
|
||||
/// @param file 加入队列的音频文件
|
||||
/// @param text 音频文件对应的文本
|
||||
/// @param utteranceId 音频文件对应的ID
|
||||
-(void)enqueueWithFile:(NSURL* _Nullable)file Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
//
|
||||
/// 停止播放
|
||||
-(QCPlayerError* _Nullable)StopPlay;
|
||||
/// 暂停播放
|
||||
-(QCPlayerError* _Nullable)PausePlay;
|
||||
/// 恢复播放
|
||||
-(QCPlayerError* _Nullable)ResumePlay;
|
||||
-(NSInteger)getAudioQueueSize;
|
||||
|
||||
@end
|
||||
@ -0,0 +1,48 @@
|
||||
//
|
||||
// QCloudOfflineAuthInfo.h
|
||||
// QCloudTTS
|
||||
//
|
||||
// Created by dgw on 2022/6/15.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
/*如果您下载的是在线版TTS SDK ,请忽略此接口文件*/
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// 离线授权错误吗
|
||||
typedef NS_ENUM(NSInteger, AuthErrorCode) {
|
||||
OFFLINE_AUTH_SUCCESS = 0,//"Auth Success"
|
||||
|
||||
OFFLINE_AUTH_NETWORK_CONNECT_FAILED = -10,//"Network connect failed."
|
||||
OFFLINE_AUTH_NETWORK_SERVER_AUTH_FAILED = -11,//"Server Authorization Error !See Response Message."
|
||||
|
||||
OFFLINE_AUTH_PARAMETERS_ERROR = -12,//"Parameter cannot be empty."
|
||||
OFFLINE_AUTH_PACKAGENAME_ERROR = -13,//"Authorization package name error."
|
||||
OFFLINE_AUTH_DEVICE_ID_ERROR = -14,//"Authorization device ID error."
|
||||
OFFLINE_AUTH_GET_DEVICE_ID_FAILED = -15,//"The device is abnormal and the device ID cannot be obtained."
|
||||
OFFLINE_AUTH_PLATFORM_ERROR = -16,//"The platform is not authorized."
|
||||
OFFLINE_AUTH_BIZCODE_ERROR = -17,//"License business does not match."
|
||||
OFFLINE_AUTH_EXPIRED = -18,//"Authorization has expired.")
|
||||
OFFLINE_AUTH_JSON_PARSE_FAILED = -19,//"JSON Parsing Error."
|
||||
OFFLINE_AUTH_DECODE_ERROR = -20,//"Could not decode license, please check input parameters."
|
||||
OFFLINE_AUTH_UNKNOWN_ERROR = -21,//"Unknown authorization error."
|
||||
|
||||
};
|
||||
// 离线授权信息类
|
||||
@interface QCloudOfflineAuthInfo : NSObject
|
||||
|
||||
@property (nonatomic, copy, nullable) NSString* respose; //使用在线拉取授权时,服务器返回到json数据
|
||||
|
||||
@property (nonatomic, assign) AuthErrorCode err_code; //错误码
|
||||
@property (nonatomic, copy, nullable) NSString* err_msg; //错误信息
|
||||
|
||||
@property (nonatomic, copy, nullable) NSString* deviceId; //设备id
|
||||
@property (nonatomic, copy, nullable) NSString* expireTime; //到期时间
|
||||
@property (nonatomic, copy, nullable) NSString* voiceAuthList; //已授权的音色名列表,用分号隔开
|
||||
|
||||
+(instancetype _Nonnull )getQCloudOfflineAuthInfo:(AuthErrorCode)err_code Respose:(NSString*_Nullable)respose;
|
||||
|
||||
+(NSString* _Nonnull )getErrorMsg:(AuthErrorCode)code;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@ -0,0 +1,37 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <QCloudTTS/QCPlayerError.h>
|
||||
|
||||
@protocol QCloudPlayerDelegate <NSObject>
|
||||
//播放开始
|
||||
-(void) onTTSPlayStart;
|
||||
|
||||
//队列所有音频播放完成,音频等待中
|
||||
-(void) onTTSPlayWait;
|
||||
|
||||
//恢复播放
|
||||
-(void) onTTSPlayResume;
|
||||
|
||||
//暂停播放
|
||||
-(void) onTTSPlayPause;
|
||||
|
||||
//播放中止
|
||||
-(void)onTTSPlayStop;
|
||||
|
||||
//即将播放播放下一句,即将播放音频对应的句子,以及这句话utteranceId
|
||||
/// 即将播放播放下一句,即将播放音频对应的句子,以及这句话utteranceId
|
||||
/// @param text 当前播放句子的文本
|
||||
/// @param utteranceId 当前播放音频对应的ID
|
||||
-(void) onTTSPlayNextWithText:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
|
||||
|
||||
|
||||
//播放器异常
|
||||
-(void)onTTSPlayError:(QCPlayerError* _Nullable)playError;
|
||||
|
||||
/// 当前播放的字符,当前播放的字符在所在的句子中的下标.
|
||||
/// @param currentWord 当前读到的单个字,是一个估算值不一定准确
|
||||
/// @param currentIdex 当前播放句子中读到文字的下标
|
||||
-(void)onTTSPlayProgressWithCurrentWord:(NSString*_Nullable)currentWord CurrentIndex:(NSInteger)currentIdex;
|
||||
|
||||
|
||||
@end
|
||||
@ -0,0 +1,222 @@
|
||||
//
|
||||
// QCloudTTSEngine.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by dgw on 2022/1/10.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <QCloudTTS/TtsError.h>
|
||||
#import <QCloudTTS/QCloudOfflineAuthInfo.h>
|
||||
|
||||
|
||||
typedef NS_ENUM(NSUInteger, TtsMode) {
|
||||
TTS_MODE_ONLINE = 0, //在线模式
|
||||
TTS_MODE_OFFLINE = 1, //离线模式
|
||||
TTS_MODE_MIX = 2 //离在线混合模式
|
||||
};
|
||||
|
||||
|
||||
|
||||
/// 回调接口
|
||||
@protocol QCloudTTSEngineDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
/// 合成结果回调
|
||||
/// @param data 音频数据
|
||||
/// @param utteranceId utteranceId
|
||||
/// @param text text
|
||||
/// @param type 该句话是以何种引擎生成的:0:在线 1:离线
|
||||
/// @deprecated
|
||||
-(void) onSynthesizeData:(NSData *_Nullable)data UtteranceId:(NSString *_Nullable)utteranceId Text:(NSString *_Nullable)text EngineType:(NSInteger)type;
|
||||
|
||||
/// 合成结果回调
|
||||
/// @param data 音频数据
|
||||
/// @param utteranceId utteranceId
|
||||
/// @param text text
|
||||
/// @param type 该句话是以何种引擎生成的:0:在线 1:离线
|
||||
/// @param requestId 请求ID,仅engineType为0时不为nil,用于排查问题
|
||||
-(void) onSynthesizeData:(NSData *_Nullable)data UtteranceId:(NSString *_Nullable)utteranceId Text:(NSString *_Nullable)text EngineType:(NSInteger)type RequestId:(NSString* _Nullable)requestId;
|
||||
|
||||
/// 合成结果回调
|
||||
/// @param data 音频数据
|
||||
/// @param utteranceId utteranceId
|
||||
/// @param text text
|
||||
/// @param type 该句话是以何种引擎生成的:0:在线 1:离线
|
||||
/// @param respJson 请求结果
|
||||
-(void) onSynthesizeData:(NSData *_Nullable)data UtteranceId:(NSString *_Nullable)utteranceId Text:(NSString *_Nullable)text EngineType:(NSInteger)type RequestId:(NSString* _Nullable)requestId RespJson:(NSString* _Nullable)respJson;
|
||||
|
||||
@required
|
||||
/// 错误回调
|
||||
/// @param error 错误信息
|
||||
/// @param utteranceId utteranceId
|
||||
/// @param text text
|
||||
-(void) onError:(TtsError *_Nullable)error UtteranceId:(NSString *_Nullable)utteranceId Text:(NSString *_Nullable)text;
|
||||
|
||||
|
||||
/// 返回离线合成模块授权信息,使用混合或者离线模式时,收到此方法成功回调后才可以调用合成接口
|
||||
/// 如果您下载的是在线版TTS SDK ,或者只使用在线合成模式,请忽略此方法
|
||||
/// @param OfflineAuthInfo 授权信息,当OfflineAuthInfo.err_msg为0时授权成功,详见QCloudOfflineAuthInfo.h
|
||||
-(void) onOfflineAuthInfo:(QCloudOfflineAuthInfo* _Nonnull )OfflineAuthInfo;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/// 语音合成引擎接口
|
||||
@interface QCloudTTSEngine : NSObject
|
||||
|
||||
|
||||
/// 获得QCloudTTSEngine实例
|
||||
+(id _Nullable )getShareInstance;
|
||||
|
||||
/// 销毁QCloudTTSEngine实例
|
||||
+(void) instanceRelease;
|
||||
|
||||
|
||||
/// 初始化引擎
|
||||
/// @param mode 引擎模式,在线、离线、混合,如切换引擎,需要先执行instanceRelease
|
||||
/// @param delegate 用于接收结果的代理
|
||||
-(void) engineInit:(TtsMode)mode Delegate:(id<QCloudTTSEngineDelegate> _Nonnull) delegate;
|
||||
|
||||
|
||||
/// 取消合成,清空内部合成队列
|
||||
-(TtsError *_Nullable) cancel;
|
||||
|
||||
/// 合成接口,支持持续调用添加文本
|
||||
/// @param text 需要合成的文本
|
||||
/// @param utteranceId 用于标记文本的id,合成完成后随音频文件或者错误接口返回,可为空
|
||||
-(TtsError *_Nullable) synthesize:(NSString *_Nonnull)text UtteranceId:(NSString *_Nullable)utteranceId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// 配置在线引擎鉴权参数
|
||||
/// @param appId appId
|
||||
/// @param secretId secretId
|
||||
/// @param secretKey secretKey
|
||||
/// @param token token,可为空,如果使用sts临时证书鉴权,secretId和secretKey均入参临时的,同时需要入参对应的token,
|
||||
/// sts临时证书具体详见https://cloud.tencent.com/document/product/598/33416 (开发调试时建议先用普通方式鉴权,token填nil)
|
||||
-(void) setOnlineAuthParam:(NSInteger)appId SecretId:(NSString* _Nonnull)secretId SecretKey:(NSString* _Nonnull)secretKey Token:(NSString* _Nullable)token;
|
||||
|
||||
|
||||
|
||||
///online语音相关设置
|
||||
|
||||
/// 设置在线语速,对setOnlineParam的封装
|
||||
/// @param voiceSpeed 默认0,代表正常速度
|
||||
-(void)setOnlineVoiceSpeed:(float)voiceSpeed;
|
||||
|
||||
/// 设置在线音色ID,对setOnlineParam的封装
|
||||
/// @param voiceType 默认1001,音色id可查看官网文档https://cloud.tencent.com/document/product/1073/37995
|
||||
-(void)setOnlineVoiceType:(int)voiceType;
|
||||
|
||||
/// 设置在线引擎音量,对setOnlineParam的封装
|
||||
/// @param voiceVolume 默认0,代表正常音量,没有静音选项
|
||||
-(void)setOnlineVoiceVolume:(float)voiceVolume;
|
||||
|
||||
/// 设置主语言类型,对setOnlineParam的封装
|
||||
/// @param primaryLanguage 1:中文 2:英文 默认1
|
||||
-(void)setOnlineVoiceLanguage:(int)primaryLanguage;
|
||||
|
||||
///在线编码格式,如无业务特殊需求不建议更改(默认"mp3",目前支持"mp3","wav","pcm",若更改为pcm不支持直接播放,对setOnlineParam的封装
|
||||
-(void)setOnlineCodec:(NSString* _Nonnull) code;
|
||||
|
||||
/// 项目ID
|
||||
/// @param projectId 默认0, 对setOnlineParam的封装
|
||||
-(void)setOnlineProjectId:(int)projectId;
|
||||
|
||||
/// 是否开启时间戳功能,默认为false,对setOnlineParam的封装
|
||||
- (void)setOnlineEnableSubtitle:(Boolean)val;
|
||||
|
||||
/// 断句敏感阈值,默认值为:0,对setOnlineParam的封装
|
||||
- (void)setOnlineSegmentRate:(int)val;
|
||||
|
||||
/// 控制合成音频的情感,仅支持多情感音色使用,对setOnlineParam的封装
|
||||
- (void)setOnlineEmotionCategory:(NSString* _Nullable)val;
|
||||
|
||||
/// 控制合成音频情感程度,对setOnlineParam的封装
|
||||
- (void)setOnlineEmotionIntensity:(int)val;
|
||||
|
||||
/// 设置自定义参数,可使用该方法控制请求时的参数
|
||||
/// @param value为nil时将删除参数,否则会在请求中添加参数
|
||||
- (void)setOnlineParam:(NSString* _Nonnull)key value:(NSObject* _Nullable)value;
|
||||
|
||||
/// 设置区域
|
||||
/// @param region 默认为ap-shanghai,无特殊需求请勿更改
|
||||
- (void)setOnlineRegion:(NSString *)region;
|
||||
|
||||
//设置是否输出日志
|
||||
-(void)setEnableDebugLog:(BOOL)enableDebugLog;
|
||||
|
||||
|
||||
|
||||
|
||||
/// timeoutIntervalForRequest ,0.5s - 30s 默认15000ms(15s)
|
||||
/// @param timeout [2200,60000] 单位ms
|
||||
- (void)setTimeoutIntervalForRequest:(int)timeout;
|
||||
|
||||
|
||||
/// timeoutIntervalForResource 2.2s - 60s 默认30000ms(30s)
|
||||
/// @param timeout [500,30000] 单位ms
|
||||
-(void)setTimeoutIntervalForResource:(int) timeout;
|
||||
|
||||
|
||||
/// Mix模式下,出现网络错误后的检测间隔时间, 默认值5分钟
|
||||
///注意:每次检测时将使用所入参的一句文本请求服务器,如果后端合成成功将会额外消耗该句字数的合成额度
|
||||
/// @param checkNetworkIntervalTime 大于等于0 单位s, 等于0时持续检测,直到成功
|
||||
-(void)setCheckNetworkIntervalTime:(int) checkNetworkIntervalTime;
|
||||
|
||||
|
||||
//以下为离线语音相关参数配置
|
||||
|
||||
//resourceDir 离线资源路径
|
||||
-(void)setOfflineResourceDir:(NSString * _Nonnull) resourceDir;
|
||||
|
||||
//voiceSpeed [0.5,2.0]
|
||||
-(void)setOfflineVoiceSpeed:(float) voiceSpeed;
|
||||
|
||||
//voiceType 离线音色名称,名称配置位于音色资源目录\voices\config.json 中,可自行指定更多的音色,demo中仅提供"pb"、"femalen"两种
|
||||
-(void)setOfflineVoiceType:(NSString *_Nonnull) voiceType;
|
||||
|
||||
//voiceVolume >0
|
||||
-(void)setOfflineVoiceVolume:(float) voiceVolume;
|
||||
|
||||
/// 配置离线TTS授权参数: 在线下载密钥(第一次激活设备需要联网)
|
||||
/// @param licPk 密钥对应的licPk,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param licKey 密钥对应的licKey,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param secretId 腾讯云secretId (可能与在线模式不是同一个账号,需要输入购买离线SDK对应的账号的secretId)
|
||||
/// @param secretKey 腾讯云 secretKey(可能与在线模式不是同一个账号,需要输入购买离线SDK对应的账号的secretKey)
|
||||
/// @param token token,可为空,如果使用sts临时证书鉴权,secretId和secretKey均入参临时的,同时需要入参对应的token,
|
||||
-(void)setOfflineAuthParamDoOnline:(NSString* _Nonnull)licPk
|
||||
LicKey:(NSString* _Nonnull)licKey
|
||||
SecretId:(NSString* _Nonnull)secretId
|
||||
SecretKey:(NSString* _Nonnull)secretKey
|
||||
Token:(NSString* _Nullable)token;
|
||||
|
||||
/// 配置离线TTS授权参数: 在线下载密钥(第一次激活设备需要联网)
|
||||
/// @param licPk 密钥对应的licPk,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param licKey 密钥对应的licKey,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param secretId 腾讯云secretId (可能与在线模式不是同一个账号,需要输入购买离线SDK对应的账号的secretId)
|
||||
/// @param secretKey 腾讯云 secretKey(可能与在线模式不是同一个账号,需要输入购买离线SDK对应的账号的secretKey)
|
||||
/// @param token token,可为空,如果使用sts临时证书鉴权,secretId和secretKey均入参临时的,同时需要入参对应的token,
|
||||
/// @param refreshAuth 是否强制联网刷新授权(NO:仅第一次联网激活下载授权文件; YES:联网刷新授权文件,无网络下将激活失败)
|
||||
-(void)setOfflineAuthParamDoOnline:(NSString* _Nonnull)licPk
|
||||
LicKey:(NSString* _Nonnull)licKey
|
||||
SecretId:(NSString* _Nonnull)secretId
|
||||
SecretKey:(NSString* _Nonnull)secretKey
|
||||
Token:(NSString* _Nullable)token
|
||||
RefreshAuth:(BOOL)refreshAuth;
|
||||
|
||||
|
||||
/// 配置离线TTS授权参数: 直接传入密钥(第一次激活也不需要联网)
|
||||
/// @param lic 授权密钥 ,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param licPk 该密钥对应的licPk,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param licSign 该密钥对应的licSign,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
-(void)setOfflineAuthParamDoOffline:(NSString* _Nonnull)lic
|
||||
LicPk:(NSString* _Nonnull)licPk
|
||||
LicSign:(NSString* _Nonnull)licSign;
|
||||
@end
|
||||
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
//
|
||||
// TtsError.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by dgw on 2022/1/10.
|
||||
//
|
||||
|
||||
#ifndef TtsError_h
|
||||
#define TtsError_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef NS_ENUM(NSInteger, TtsErrorCode) {
|
||||
|
||||
TTS_ERROR_CODE_UNINITIALIZED = -100, //Engine uninitialized
|
||||
TTS_ERROR_CODE_GENERATE_SIGN_FAIL = -101, //generate sign failed
|
||||
TTS_ERROR_CODE_NETWORK_CONNECT_FAILED = 102, //network connect failed
|
||||
TTS_ERROR_CODE_DECODE_FAIL = -103, //JSON Response Parsing Error
|
||||
TTS_ERROR_CODE_SERVER_RESPONSE_ERROR = -104, //Server response error
|
||||
TTS_ERROR_CODE_CANCEL_FAILURE = -106, //Cancel failure,please try again later
|
||||
|
||||
TTS_ERROR_CODE_OFFLINE_FAILURE = -107,//Offline synthesize failed, please check your text and VoiceType
|
||||
TTS_ERROR_CODE_OFFLINE_INIT_FAILURE = -108,//Offline engine initialization failed, please check resource files
|
||||
TTS_ERROR_CODE_OFFLINE_AUTH_FAILURE = -109,//Offline engine auth failure
|
||||
TTS_ERROR_CODE_OFFLINE_TEXT_TOO_LONG = -110, //Offline synthesize failed,text too long,MAX <= 1024 byte
|
||||
TTS_ERROR_CODE_OFFLINE_VOICE_AUTH_FAILURE = -111, //This voice not authorized, please change it
|
||||
|
||||
TTS_ERROR_CODE_OFFLINE_NOSUPPORT = -900 //This SDK only supports online mode
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// 后端返回的错误信息
|
||||
@interface TtsServiceError : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString* _Nullable err_code;
|
||||
@property (nonatomic, copy) NSString* _Nullable msg;
|
||||
@property (nonatomic, copy) NSString* _Nullable respose;
|
||||
|
||||
+(instancetype _Nonnull)getTtsServiceError:(NSString *_Nullable)err_code ErrorMsg:(NSString* _Nullable)msg Respose:(NSString* _Nullable)respose;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/// 错误信息类
|
||||
@interface TtsError : NSObject
|
||||
|
||||
@property (nonatomic, assign) TtsErrorCode err_code; //错误码
|
||||
|
||||
@property (nonatomic, copy, nullable) NSString* msg; //错误信息
|
||||
|
||||
@property (nonatomic, copy, nullable) NSError * error; //系统抛出的错误信息(不一定有,可能为空)
|
||||
|
||||
@property (nonatomic, strong ,nullable) TtsServiceError * serviceError;//服务器返回的错误信息(不一定有,可能为空)
|
||||
|
||||
+(instancetype _Nonnull)getTtsError:(TtsErrorCode)err_code
|
||||
TtsServiceError:(TtsServiceError* _Nullable)serviceError
|
||||
NSErrorMsg:(NSError *_Nullable)error;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* TtsError_h */
|
||||
BIN
AIGrammar/third-party/QCloudTTS.xcframework/ios-arm64_armv7/QCloudTTS.framework/Info.plist
vendored
Normal file
BIN
AIGrammar/third-party/QCloudTTS.xcframework/ios-arm64_armv7/QCloudTTS.framework/Info.plist
vendored
Normal file
Binary file not shown.
BIN
AIGrammar/third-party/QCloudTTS.xcframework/ios-arm64_armv7/QCloudTTS.framework/QCloudTTS
vendored
Normal file
BIN
AIGrammar/third-party/QCloudTTS.xcframework/ios-arm64_armv7/QCloudTTS.framework/QCloudTTS
vendored
Normal file
Binary file not shown.
@ -0,0 +1,25 @@
|
||||
//
|
||||
// QPlayerError.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by renqiu on 2022/1/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef NS_ENUM (NSInteger,QCPlayerErrorCode){
|
||||
|
||||
QPLAYER_ERROR_CODE_EXCEPTION = -201,
|
||||
QPLAYER_ERROR_CODE_PLAY_QUEUE_IS_FULL = -202,
|
||||
QPLAYER_ERROR_CODE_AUDIO_READ_FAILEDL = -203,
|
||||
QPLAYER_ERROR_CODE_UNKNOW = -204,
|
||||
|
||||
};
|
||||
@interface QCPlayerError : NSObject
|
||||
@property (nonatomic, assign) NSInteger mCode;
|
||||
@property (nonatomic,copy)NSString *message;
|
||||
@property (nonatomic,strong)NSError *errorMessage;
|
||||
+(instancetype)getQCPlayerErrorWithMcode:(NSInteger)mCode ErrorMessage:(NSError*)errorMessage;
|
||||
@end
|
||||
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
//
|
||||
// QCloudMediaPlayer.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by renqiu on 2022/1/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <QCloudTTS/QCPlayerError.h>
|
||||
#import <QCloudTTS/QCloudPlayerDelegate.h>
|
||||
|
||||
/// <#Description#>
|
||||
@interface QCloudMediaPlayer : NSObject
|
||||
@property (assign,nonnull)id <QCloudPlayerDelegate>playerDelegate;
|
||||
//
|
||||
/// 数据入队列
|
||||
/// @param data 加入队列的音频
|
||||
/// @param text 音频对应的文本
|
||||
/// @param utteranceId 音频对应的ID
|
||||
-(void)enqueueWithData:(NSData* _Nonnull )data Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
|
||||
//
|
||||
/// 数据入队列
|
||||
/// @param data 加入队列的音频
|
||||
/// @param text 音频对应的文本
|
||||
/// @param utteranceId 音频对应的ID
|
||||
/// @param server 服务端返回的信息,包含Subtitles时会使用Subtitle来进行时间戳判断
|
||||
-(void)enqueueWithData:(NSData* _Nonnull )data Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId RespJson:(NSString* _Nullable)respjson;
|
||||
|
||||
/// 数据入队列
|
||||
/// @param file 加入队列的音频文件
|
||||
/// @param text 音频文件对应的文本
|
||||
/// @param utteranceId 音频文件对应的ID
|
||||
-(void)enqueueWithFile:(NSURL* _Nullable)file Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
|
||||
//
|
||||
/// 停止播放
|
||||
-(QCPlayerError* _Nullable)StopPlay;
|
||||
/// 暂停播放
|
||||
-(QCPlayerError* _Nullable)PausePlay;
|
||||
/// 恢复播放
|
||||
-(QCPlayerError* _Nullable)ResumePlay;
|
||||
-(NSInteger)getAudioQueueSize;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
//
|
||||
// QCloudMediaPlayer.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by renqiu on 2022/1/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <QCloudTTS/QCPlayerError.h>
|
||||
#import <QCloudTTS/QCloudMediaPlayer.h>
|
||||
|
||||
/// <#Description#>
|
||||
@interface QCloudMediaPlayer2 : NSObject
|
||||
@property (weak)id <QCloudPlayerDelegate> _Nullable playerDelegate;
|
||||
//
|
||||
/// 数据入队列
|
||||
/// @param data 加入队列的音频
|
||||
/// @param text 音频对应的文本
|
||||
/// @param utteranceId 音频对应的ID
|
||||
-(void)enqueueWithData:(NSData* _Nonnull )data Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
/// 数据入队列
|
||||
/// @param file 加入队列的音频文件
|
||||
/// @param text 音频文件对应的文本
|
||||
/// @param utteranceId 音频文件对应的ID
|
||||
-(void)enqueueWithFile:(NSURL* _Nullable)file Text:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
//
|
||||
/// 停止播放
|
||||
-(QCPlayerError* _Nullable)StopPlay;
|
||||
/// 暂停播放
|
||||
-(QCPlayerError* _Nullable)PausePlay;
|
||||
/// 恢复播放
|
||||
-(QCPlayerError* _Nullable)ResumePlay;
|
||||
-(NSInteger)getAudioQueueSize;
|
||||
|
||||
@end
|
||||
@ -0,0 +1,48 @@
|
||||
//
|
||||
// QCloudOfflineAuthInfo.h
|
||||
// QCloudTTS
|
||||
//
|
||||
// Created by dgw on 2022/6/15.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
/*如果您下载的是在线版TTS SDK ,请忽略此接口文件*/
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// 离线授权错误吗
|
||||
typedef NS_ENUM(NSInteger, AuthErrorCode) {
|
||||
OFFLINE_AUTH_SUCCESS = 0,//"Auth Success"
|
||||
|
||||
OFFLINE_AUTH_NETWORK_CONNECT_FAILED = -10,//"Network connect failed."
|
||||
OFFLINE_AUTH_NETWORK_SERVER_AUTH_FAILED = -11,//"Server Authorization Error !See Response Message."
|
||||
|
||||
OFFLINE_AUTH_PARAMETERS_ERROR = -12,//"Parameter cannot be empty."
|
||||
OFFLINE_AUTH_PACKAGENAME_ERROR = -13,//"Authorization package name error."
|
||||
OFFLINE_AUTH_DEVICE_ID_ERROR = -14,//"Authorization device ID error."
|
||||
OFFLINE_AUTH_GET_DEVICE_ID_FAILED = -15,//"The device is abnormal and the device ID cannot be obtained."
|
||||
OFFLINE_AUTH_PLATFORM_ERROR = -16,//"The platform is not authorized."
|
||||
OFFLINE_AUTH_BIZCODE_ERROR = -17,//"License business does not match."
|
||||
OFFLINE_AUTH_EXPIRED = -18,//"Authorization has expired.")
|
||||
OFFLINE_AUTH_JSON_PARSE_FAILED = -19,//"JSON Parsing Error."
|
||||
OFFLINE_AUTH_DECODE_ERROR = -20,//"Could not decode license, please check input parameters."
|
||||
OFFLINE_AUTH_UNKNOWN_ERROR = -21,//"Unknown authorization error."
|
||||
|
||||
};
|
||||
// 离线授权信息类
|
||||
@interface QCloudOfflineAuthInfo : NSObject
|
||||
|
||||
@property (nonatomic, copy, nullable) NSString* respose; //使用在线拉取授权时,服务器返回到json数据
|
||||
|
||||
@property (nonatomic, assign) AuthErrorCode err_code; //错误码
|
||||
@property (nonatomic, copy, nullable) NSString* err_msg; //错误信息
|
||||
|
||||
@property (nonatomic, copy, nullable) NSString* deviceId; //设备id
|
||||
@property (nonatomic, copy, nullable) NSString* expireTime; //到期时间
|
||||
@property (nonatomic, copy, nullable) NSString* voiceAuthList; //已授权的音色名列表,用分号隔开
|
||||
|
||||
+(instancetype _Nonnull )getQCloudOfflineAuthInfo:(AuthErrorCode)err_code Respose:(NSString*_Nullable)respose;
|
||||
|
||||
+(NSString* _Nonnull )getErrorMsg:(AuthErrorCode)code;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@ -0,0 +1,37 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <QCloudTTS/QCPlayerError.h>
|
||||
|
||||
@protocol QCloudPlayerDelegate <NSObject>
|
||||
//播放开始
|
||||
-(void) onTTSPlayStart;
|
||||
|
||||
//队列所有音频播放完成,音频等待中
|
||||
-(void) onTTSPlayWait;
|
||||
|
||||
//恢复播放
|
||||
-(void) onTTSPlayResume;
|
||||
|
||||
//暂停播放
|
||||
-(void) onTTSPlayPause;
|
||||
|
||||
//播放中止
|
||||
-(void)onTTSPlayStop;
|
||||
|
||||
//即将播放播放下一句,即将播放音频对应的句子,以及这句话utteranceId
|
||||
/// 即将播放播放下一句,即将播放音频对应的句子,以及这句话utteranceId
|
||||
/// @param text 当前播放句子的文本
|
||||
/// @param utteranceId 当前播放音频对应的ID
|
||||
-(void) onTTSPlayNextWithText:(NSString* _Nullable)text UtteranceId:(NSString* _Nullable)utteranceId;
|
||||
|
||||
|
||||
|
||||
//播放器异常
|
||||
-(void)onTTSPlayError:(QCPlayerError* _Nullable)playError;
|
||||
|
||||
/// 当前播放的字符,当前播放的字符在所在的句子中的下标.
|
||||
/// @param currentWord 当前读到的单个字,是一个估算值不一定准确
|
||||
/// @param currentIdex 当前播放句子中读到文字的下标
|
||||
-(void)onTTSPlayProgressWithCurrentWord:(NSString*_Nullable)currentWord CurrentIndex:(NSInteger)currentIdex;
|
||||
|
||||
|
||||
@end
|
||||
@ -0,0 +1,222 @@
|
||||
//
|
||||
// QCloudTTSEngine.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by dgw on 2022/1/10.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <QCloudTTS/TtsError.h>
|
||||
#import <QCloudTTS/QCloudOfflineAuthInfo.h>
|
||||
|
||||
|
||||
typedef NS_ENUM(NSUInteger, TtsMode) {
|
||||
TTS_MODE_ONLINE = 0, //在线模式
|
||||
TTS_MODE_OFFLINE = 1, //离线模式
|
||||
TTS_MODE_MIX = 2 //离在线混合模式
|
||||
};
|
||||
|
||||
|
||||
|
||||
/// 回调接口
|
||||
@protocol QCloudTTSEngineDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
/// 合成结果回调
|
||||
/// @param data 音频数据
|
||||
/// @param utteranceId utteranceId
|
||||
/// @param text text
|
||||
/// @param type 该句话是以何种引擎生成的:0:在线 1:离线
|
||||
/// @deprecated
|
||||
-(void) onSynthesizeData:(NSData *_Nullable)data UtteranceId:(NSString *_Nullable)utteranceId Text:(NSString *_Nullable)text EngineType:(NSInteger)type;
|
||||
|
||||
/// 合成结果回调
|
||||
/// @param data 音频数据
|
||||
/// @param utteranceId utteranceId
|
||||
/// @param text text
|
||||
/// @param type 该句话是以何种引擎生成的:0:在线 1:离线
|
||||
/// @param requestId 请求ID,仅engineType为0时不为nil,用于排查问题
|
||||
-(void) onSynthesizeData:(NSData *_Nullable)data UtteranceId:(NSString *_Nullable)utteranceId Text:(NSString *_Nullable)text EngineType:(NSInteger)type RequestId:(NSString* _Nullable)requestId;
|
||||
|
||||
/// 合成结果回调
|
||||
/// @param data 音频数据
|
||||
/// @param utteranceId utteranceId
|
||||
/// @param text text
|
||||
/// @param type 该句话是以何种引擎生成的:0:在线 1:离线
|
||||
/// @param respJson 请求结果
|
||||
-(void) onSynthesizeData:(NSData *_Nullable)data UtteranceId:(NSString *_Nullable)utteranceId Text:(NSString *_Nullable)text EngineType:(NSInteger)type RequestId:(NSString* _Nullable)requestId RespJson:(NSString* _Nullable)respJson;
|
||||
|
||||
@required
|
||||
/// 错误回调
|
||||
/// @param error 错误信息
|
||||
/// @param utteranceId utteranceId
|
||||
/// @param text text
|
||||
-(void) onError:(TtsError *_Nullable)error UtteranceId:(NSString *_Nullable)utteranceId Text:(NSString *_Nullable)text;
|
||||
|
||||
|
||||
/// 返回离线合成模块授权信息,使用混合或者离线模式时,收到此方法成功回调后才可以调用合成接口
|
||||
/// 如果您下载的是在线版TTS SDK ,或者只使用在线合成模式,请忽略此方法
|
||||
/// @param OfflineAuthInfo 授权信息,当OfflineAuthInfo.err_msg为0时授权成功,详见QCloudOfflineAuthInfo.h
|
||||
-(void) onOfflineAuthInfo:(QCloudOfflineAuthInfo* _Nonnull )OfflineAuthInfo;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/// 语音合成引擎接口
|
||||
@interface QCloudTTSEngine : NSObject
|
||||
|
||||
|
||||
/// 获得QCloudTTSEngine实例
|
||||
+(id _Nullable )getShareInstance;
|
||||
|
||||
/// 销毁QCloudTTSEngine实例
|
||||
+(void) instanceRelease;
|
||||
|
||||
|
||||
/// 初始化引擎
|
||||
/// @param mode 引擎模式,在线、离线、混合,如切换引擎,需要先执行instanceRelease
|
||||
/// @param delegate 用于接收结果的代理
|
||||
-(void) engineInit:(TtsMode)mode Delegate:(id<QCloudTTSEngineDelegate> _Nonnull) delegate;
|
||||
|
||||
|
||||
/// 取消合成,清空内部合成队列
|
||||
-(TtsError *_Nullable) cancel;
|
||||
|
||||
/// 合成接口,支持持续调用添加文本
|
||||
/// @param text 需要合成的文本
|
||||
/// @param utteranceId 用于标记文本的id,合成完成后随音频文件或者错误接口返回,可为空
|
||||
-(TtsError *_Nullable) synthesize:(NSString *_Nonnull)text UtteranceId:(NSString *_Nullable)utteranceId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// 配置在线引擎鉴权参数
|
||||
/// @param appId appId
|
||||
/// @param secretId secretId
|
||||
/// @param secretKey secretKey
|
||||
/// @param token token,可为空,如果使用sts临时证书鉴权,secretId和secretKey均入参临时的,同时需要入参对应的token,
|
||||
/// sts临时证书具体详见https://cloud.tencent.com/document/product/598/33416 (开发调试时建议先用普通方式鉴权,token填nil)
|
||||
-(void) setOnlineAuthParam:(NSInteger)appId SecretId:(NSString* _Nonnull)secretId SecretKey:(NSString* _Nonnull)secretKey Token:(NSString* _Nullable)token;
|
||||
|
||||
|
||||
|
||||
///online语音相关设置
|
||||
|
||||
/// 设置在线语速,对setOnlineParam的封装
|
||||
/// @param voiceSpeed 默认0,代表正常速度
|
||||
-(void)setOnlineVoiceSpeed:(float)voiceSpeed;
|
||||
|
||||
/// 设置在线音色ID,对setOnlineParam的封装
|
||||
/// @param voiceType 默认1001,音色id可查看官网文档https://cloud.tencent.com/document/product/1073/37995
|
||||
-(void)setOnlineVoiceType:(int)voiceType;
|
||||
|
||||
/// 设置在线引擎音量,对setOnlineParam的封装
|
||||
/// @param voiceVolume 默认0,代表正常音量,没有静音选项
|
||||
-(void)setOnlineVoiceVolume:(float)voiceVolume;
|
||||
|
||||
/// 设置主语言类型,对setOnlineParam的封装
|
||||
/// @param primaryLanguage 1:中文 2:英文 默认1
|
||||
-(void)setOnlineVoiceLanguage:(int)primaryLanguage;
|
||||
|
||||
///在线编码格式,如无业务特殊需求不建议更改(默认"mp3",目前支持"mp3","wav","pcm",若更改为pcm不支持直接播放,对setOnlineParam的封装
|
||||
-(void)setOnlineCodec:(NSString* _Nonnull) code;
|
||||
|
||||
/// 项目ID
|
||||
/// @param projectId 默认0, 对setOnlineParam的封装
|
||||
-(void)setOnlineProjectId:(int)projectId;
|
||||
|
||||
/// 是否开启时间戳功能,默认为false,对setOnlineParam的封装
|
||||
- (void)setOnlineEnableSubtitle:(Boolean)val;
|
||||
|
||||
/// 断句敏感阈值,默认值为:0,对setOnlineParam的封装
|
||||
- (void)setOnlineSegmentRate:(int)val;
|
||||
|
||||
/// 控制合成音频的情感,仅支持多情感音色使用,对setOnlineParam的封装
|
||||
- (void)setOnlineEmotionCategory:(NSString* _Nullable)val;
|
||||
|
||||
/// 控制合成音频情感程度,对setOnlineParam的封装
|
||||
- (void)setOnlineEmotionIntensity:(int)val;
|
||||
|
||||
/// 设置自定义参数,可使用该方法控制请求时的参数
|
||||
/// @param value为nil时将删除参数,否则会在请求中添加参数
|
||||
- (void)setOnlineParam:(NSString* _Nonnull)key value:(NSObject* _Nullable)value;
|
||||
|
||||
/// 设置区域
|
||||
/// @param region 默认为ap-shanghai,无特殊需求请勿更改
|
||||
- (void)setOnlineRegion:(NSString *)region;
|
||||
|
||||
//设置是否输出日志
|
||||
-(void)setEnableDebugLog:(BOOL)enableDebugLog;
|
||||
|
||||
|
||||
|
||||
|
||||
/// timeoutIntervalForRequest ,0.5s - 30s 默认15000ms(15s)
|
||||
/// @param timeout [2200,60000] 单位ms
|
||||
- (void)setTimeoutIntervalForRequest:(int)timeout;
|
||||
|
||||
|
||||
/// timeoutIntervalForResource 2.2s - 60s 默认30000ms(30s)
|
||||
/// @param timeout [500,30000] 单位ms
|
||||
-(void)setTimeoutIntervalForResource:(int) timeout;
|
||||
|
||||
|
||||
/// Mix模式下,出现网络错误后的检测间隔时间, 默认值5分钟
|
||||
///注意:每次检测时将使用所入参的一句文本请求服务器,如果后端合成成功将会额外消耗该句字数的合成额度
|
||||
/// @param checkNetworkIntervalTime 大于等于0 单位s, 等于0时持续检测,直到成功
|
||||
-(void)setCheckNetworkIntervalTime:(int) checkNetworkIntervalTime;
|
||||
|
||||
|
||||
//以下为离线语音相关参数配置
|
||||
|
||||
//resourceDir 离线资源路径
|
||||
-(void)setOfflineResourceDir:(NSString * _Nonnull) resourceDir;
|
||||
|
||||
//voiceSpeed [0.5,2.0]
|
||||
-(void)setOfflineVoiceSpeed:(float) voiceSpeed;
|
||||
|
||||
//voiceType 离线音色名称,名称配置位于音色资源目录\voices\config.json 中,可自行指定更多的音色,demo中仅提供"pb"、"femalen"两种
|
||||
-(void)setOfflineVoiceType:(NSString *_Nonnull) voiceType;
|
||||
|
||||
//voiceVolume >0
|
||||
-(void)setOfflineVoiceVolume:(float) voiceVolume;
|
||||
|
||||
/// 配置离线TTS授权参数: 在线下载密钥(第一次激活设备需要联网)
|
||||
/// @param licPk 密钥对应的licPk,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param licKey 密钥对应的licKey,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param secretId 腾讯云secretId (可能与在线模式不是同一个账号,需要输入购买离线SDK对应的账号的secretId)
|
||||
/// @param secretKey 腾讯云 secretKey(可能与在线模式不是同一个账号,需要输入购买离线SDK对应的账号的secretKey)
|
||||
/// @param token token,可为空,如果使用sts临时证书鉴权,secretId和secretKey均入参临时的,同时需要入参对应的token,
|
||||
-(void)setOfflineAuthParamDoOnline:(NSString* _Nonnull)licPk
|
||||
LicKey:(NSString* _Nonnull)licKey
|
||||
SecretId:(NSString* _Nonnull)secretId
|
||||
SecretKey:(NSString* _Nonnull)secretKey
|
||||
Token:(NSString* _Nullable)token;
|
||||
|
||||
/// 配置离线TTS授权参数: 在线下载密钥(第一次激活设备需要联网)
|
||||
/// @param licPk 密钥对应的licPk,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param licKey 密钥对应的licKey,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param secretId 腾讯云secretId (可能与在线模式不是同一个账号,需要输入购买离线SDK对应的账号的secretId)
|
||||
/// @param secretKey 腾讯云 secretKey(可能与在线模式不是同一个账号,需要输入购买离线SDK对应的账号的secretKey)
|
||||
/// @param token token,可为空,如果使用sts临时证书鉴权,secretId和secretKey均入参临时的,同时需要入参对应的token,
|
||||
/// @param refreshAuth 是否强制联网刷新授权(NO:仅第一次联网激活下载授权文件; YES:联网刷新授权文件,无网络下将激活失败)
|
||||
-(void)setOfflineAuthParamDoOnline:(NSString* _Nonnull)licPk
|
||||
LicKey:(NSString* _Nonnull)licKey
|
||||
SecretId:(NSString* _Nonnull)secretId
|
||||
SecretKey:(NSString* _Nonnull)secretKey
|
||||
Token:(NSString* _Nullable)token
|
||||
RefreshAuth:(BOOL)refreshAuth;
|
||||
|
||||
|
||||
/// 配置离线TTS授权参数: 直接传入密钥(第一次激活也不需要联网)
|
||||
/// @param lic 授权密钥 ,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param licPk 该密钥对应的licPk,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
/// @param licSign 该密钥对应的licSign,请在腾讯云官网页面获取,或者由腾讯云商务线下下发
|
||||
-(void)setOfflineAuthParamDoOffline:(NSString* _Nonnull)lic
|
||||
LicPk:(NSString* _Nonnull)licPk
|
||||
LicSign:(NSString* _Nonnull)licSign;
|
||||
@end
|
||||
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
//
|
||||
// TtsError.h
|
||||
// cloud-tts-sdk-ios
|
||||
//
|
||||
// Created by dgw on 2022/1/10.
|
||||
//
|
||||
|
||||
#ifndef TtsError_h
|
||||
#define TtsError_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef NS_ENUM(NSInteger, TtsErrorCode) {
|
||||
|
||||
TTS_ERROR_CODE_UNINITIALIZED = -100, //Engine uninitialized
|
||||
TTS_ERROR_CODE_GENERATE_SIGN_FAIL = -101, //generate sign failed
|
||||
TTS_ERROR_CODE_NETWORK_CONNECT_FAILED = 102, //network connect failed
|
||||
TTS_ERROR_CODE_DECODE_FAIL = -103, //JSON Response Parsing Error
|
||||
TTS_ERROR_CODE_SERVER_RESPONSE_ERROR = -104, //Server response error
|
||||
TTS_ERROR_CODE_CANCEL_FAILURE = -106, //Cancel failure,please try again later
|
||||
|
||||
TTS_ERROR_CODE_OFFLINE_FAILURE = -107,//Offline synthesize failed, please check your text and VoiceType
|
||||
TTS_ERROR_CODE_OFFLINE_INIT_FAILURE = -108,//Offline engine initialization failed, please check resource files
|
||||
TTS_ERROR_CODE_OFFLINE_AUTH_FAILURE = -109,//Offline engine auth failure
|
||||
TTS_ERROR_CODE_OFFLINE_TEXT_TOO_LONG = -110, //Offline synthesize failed,text too long,MAX <= 1024 byte
|
||||
TTS_ERROR_CODE_OFFLINE_VOICE_AUTH_FAILURE = -111, //This voice not authorized, please change it
|
||||
|
||||
TTS_ERROR_CODE_OFFLINE_NOSUPPORT = -900 //This SDK only supports online mode
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// 后端返回的错误信息
|
||||
@interface TtsServiceError : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString* _Nullable err_code;
|
||||
@property (nonatomic, copy) NSString* _Nullable msg;
|
||||
@property (nonatomic, copy) NSString* _Nullable respose;
|
||||
|
||||
+(instancetype _Nonnull)getTtsServiceError:(NSString *_Nullable)err_code ErrorMsg:(NSString* _Nullable)msg Respose:(NSString* _Nullable)respose;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/// 错误信息类
|
||||
@interface TtsError : NSObject
|
||||
|
||||
@property (nonatomic, assign) TtsErrorCode err_code; //错误码
|
||||
|
||||
@property (nonatomic, copy, nullable) NSString* msg; //错误信息
|
||||
|
||||
@property (nonatomic, copy, nullable) NSError * error; //系统抛出的错误信息(不一定有,可能为空)
|
||||
|
||||
@property (nonatomic, strong ,nullable) TtsServiceError * serviceError;//服务器返回的错误信息(不一定有,可能为空)
|
||||
|
||||
+(instancetype _Nonnull)getTtsError:(TtsErrorCode)err_code
|
||||
TtsServiceError:(TtsServiceError* _Nullable)serviceError
|
||||
NSErrorMsg:(NSError *_Nullable)error;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* TtsError_h */
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,207 @@
|
||||
<?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>files</key>
|
||||
<dict>
|
||||
<key>Headers/QCPlayerError.h</key>
|
||||
<data>
|
||||
GcBglYzaVwjgHfWYqQ+ZUSG3Uao=
|
||||
</data>
|
||||
<key>Headers/QCloudMediaPlayer.h</key>
|
||||
<data>
|
||||
cSuhgHCm42prRzNangBO/0w2qVA=
|
||||
</data>
|
||||
<key>Headers/QCloudMediaPlayer2.h</key>
|
||||
<data>
|
||||
WJT6QPmSe5jTGllxIhKljhOzgds=
|
||||
</data>
|
||||
<key>Headers/QCloudOfflineAuthInfo.h</key>
|
||||
<data>
|
||||
tolrRjjKQqWWjKFyUooedkLsIpc=
|
||||
</data>
|
||||
<key>Headers/QCloudPlayerDelegate.h</key>
|
||||
<data>
|
||||
EegDLAlAPciyhnxDnXB4oChNttQ=
|
||||
</data>
|
||||
<key>Headers/QCloudTTSEngine.h</key>
|
||||
<data>
|
||||
UQB6vhAlGndL5YeDl1ZEw3vyc2M=
|
||||
</data>
|
||||
<key>Headers/TtsError.h</key>
|
||||
<data>
|
||||
325otzQ/Cu8q0kGDUVU4SMibWZU=
|
||||
</data>
|
||||
<key>Info.plist</key>
|
||||
<data>
|
||||
2dDQqFGhXP8TDAtqPWpKsMxer5Y=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Headers/QCPlayerError.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
GcBglYzaVwjgHfWYqQ+ZUSG3Uao=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
B5vdIZRO7860RHiBmzU42oztYKV5/+TSI8nZImlfEHI=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/QCloudMediaPlayer.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
cSuhgHCm42prRzNangBO/0w2qVA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
dkOfBxGqa1bMsg4SkwH8H4qtwDba0not3AqU/goz0Mk=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/QCloudMediaPlayer2.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
WJT6QPmSe5jTGllxIhKljhOzgds=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
aWSR35tX7sKARPhOHbJmpq4FYVNmlR7ST5aqDc4aLn4=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/QCloudOfflineAuthInfo.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
tolrRjjKQqWWjKFyUooedkLsIpc=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
KLQptLzwtaJYFeFD49+ue23NLWqaZAyjWljo3VimNwg=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/QCloudPlayerDelegate.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
EegDLAlAPciyhnxDnXB4oChNttQ=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
LrSEc56s6we6W+qm6wzJ4RFsfJXfvIM0MDzD1swuSqE=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/QCloudTTSEngine.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
UQB6vhAlGndL5YeDl1ZEw3vyc2M=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
hsHHpz1PLxxiMLlxsy6ZqRbS7NlmoYybdFTUHQnrsXA=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/TtsError.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
325otzQ/Cu8q0kGDUVU4SMibWZU=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
Jtc052fx72HaSNcpnKz0cL2f8VNTIYa1+DhDUcQX2v8=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
30
GoogleService-Info.plist
Normal file
30
GoogleService-Info.plist
Normal file
@ -0,0 +1,30 @@
|
||||
<?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>API_KEY</key>
|
||||
<string>AIzaSyBDPG2ofY3F9gjYTyutQfPNXueaaWPTVME</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>763286281388</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>com.easyprompts.aigrammar</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>easygrammar-52c5b</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>easygrammar-52c5b.appspot.com</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_APPINVITE_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_GCM_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:763286281388:ios:c469d8138ccfa1d6e95309</string>
|
||||
</dict>
|
||||
</plist>
|
||||
16
Podfile
16
Podfile
@ -1,6 +1,17 @@
|
||||
# Uncomment the next line to define a global platform for your project
|
||||
# platform :ios, '9.0'
|
||||
|
||||
platform :ios, '13.4'
|
||||
source 'https://github.com/CocoaPods/Specs.git' # download from github,not cdn
|
||||
post_install do |installer|
|
||||
installer.generated_projects.each do |project|
|
||||
project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
target 'AIGrammar' do
|
||||
# Comment the next line if you don't want to use dynamic frameworks
|
||||
use_frameworks!
|
||||
@ -11,7 +22,10 @@ target 'AIGrammar' do
|
||||
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git'
|
||||
pod 'SwiftJWT'
|
||||
pod 'SwiftyBeaver', :git => 'https://github.com/SwiftyBeaver/SwiftyBeaver.git'
|
||||
|
||||
|
||||
pod 'Firebase/Analytics'
|
||||
pod 'FirebaseCrashlytics'
|
||||
pod 'FirebasePerformance'
|
||||
|
||||
|
||||
target 'AIGrammarTests' do
|
||||
|
||||
179
Podfile.lock
179
Podfile.lock
@ -3,11 +3,147 @@ PODS:
|
||||
- BlueCryptor (1.0.32)
|
||||
- BlueECC (1.2.5)
|
||||
- BlueRSA (1.0.200)
|
||||
- Firebase/Analytics (11.1.0):
|
||||
- Firebase/Core
|
||||
- Firebase/Core (11.1.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseAnalytics (~> 11.1.0)
|
||||
- Firebase/CoreOnly (11.1.0):
|
||||
- FirebaseCore (= 11.1.0)
|
||||
- FirebaseABTesting (11.1.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseAnalytics (11.1.0):
|
||||
- FirebaseAnalytics/AdIdSupport (= 11.1.0)
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseInstallations (~> 11.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- nanopb (~> 3.30910.0)
|
||||
- FirebaseAnalytics/AdIdSupport (11.1.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseInstallations (~> 11.0)
|
||||
- GoogleAppMeasurement (= 11.1.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- nanopb (~> 3.30910.0)
|
||||
- FirebaseCore (11.1.0):
|
||||
- FirebaseCoreInternal (~> 11.0)
|
||||
- GoogleUtilities/Environment (~> 8.0)
|
||||
- GoogleUtilities/Logger (~> 8.0)
|
||||
- FirebaseCoreExtension (11.1.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseCoreInternal (11.1.0):
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- FirebaseCrashlytics (11.1.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseInstallations (~> 11.0)
|
||||
- FirebaseRemoteConfigInterop (~> 11.0)
|
||||
- FirebaseSessions (~> 11.0)
|
||||
- GoogleDataTransport (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 8.0)
|
||||
- nanopb (~> 3.30910.0)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- FirebaseInstallations (11.1.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- GoogleUtilities/Environment (~> 8.0)
|
||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- FirebasePerformance (11.1.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseInstallations (~> 11.0)
|
||||
- FirebaseRemoteConfig (~> 11.0)
|
||||
- FirebaseSessions (~> 11.0)
|
||||
- GoogleDataTransport (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||
- nanopb (~> 3.30910.0)
|
||||
- FirebaseRemoteConfig (11.1.0):
|
||||
- FirebaseABTesting (~> 11.0)
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseInstallations (~> 11.0)
|
||||
- FirebaseRemoteConfigInterop (~> 11.0)
|
||||
- FirebaseSharedSwift (~> 11.0)
|
||||
- GoogleUtilities/Environment (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- FirebaseRemoteConfigInterop (11.1.0)
|
||||
- FirebaseSessions (11.1.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseCoreExtension (~> 11.0)
|
||||
- FirebaseInstallations (~> 11.0)
|
||||
- GoogleDataTransport (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 8.0)
|
||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||
- nanopb (~> 3.30910.0)
|
||||
- PromisesSwift (~> 2.1)
|
||||
- FirebaseSharedSwift (11.1.0)
|
||||
- GoogleAppMeasurement (11.1.0):
|
||||
- GoogleAppMeasurement/AdIdSupport (= 11.1.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- nanopb (~> 3.30910.0)
|
||||
- GoogleAppMeasurement/AdIdSupport (11.1.0):
|
||||
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.1.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- nanopb (~> 3.30910.0)
|
||||
- GoogleAppMeasurement/WithoutAdIdSupport (11.1.0):
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- nanopb (~> 3.30910.0)
|
||||
- GoogleDataTransport (10.1.0):
|
||||
- nanopb (~> 3.30910.0)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- GoogleUtilities/AppDelegateSwizzler (8.0.2):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Environment (8.0.2):
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Logger (8.0.2):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/MethodSwizzler (8.0.2):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Network (8.0.2):
|
||||
- GoogleUtilities/Logger
|
||||
- "GoogleUtilities/NSData+zlib"
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Reachability
|
||||
- "GoogleUtilities/NSData+zlib (8.0.2)":
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Privacy (8.0.2)
|
||||
- GoogleUtilities/Reachability (8.0.2):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/UserDefaults (8.0.2):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Privacy
|
||||
- KituraContracts (1.2.1):
|
||||
- LoggerAPI (~> 1.7)
|
||||
- LoggerAPI (1.9.200):
|
||||
- Logging (~> 1.1)
|
||||
- Logging (1.4.0)
|
||||
- nanopb (3.30910.0):
|
||||
- nanopb/decode (= 3.30910.0)
|
||||
- nanopb/encode (= 3.30910.0)
|
||||
- nanopb/decode (3.30910.0)
|
||||
- nanopb/encode (3.30910.0)
|
||||
- PromisesObjC (2.4.0)
|
||||
- PromisesSwift (2.4.0):
|
||||
- PromisesObjC (= 2.4.0)
|
||||
- SwiftJWT (3.6.200):
|
||||
- BlueCryptor (~> 1.0)
|
||||
- BlueECC (~> 1.1)
|
||||
@ -19,6 +155,9 @@ PODS:
|
||||
|
||||
DEPENDENCIES:
|
||||
- Alamofire (from `https://github.com/Alamofire/Alamofire.git`)
|
||||
- Firebase/Analytics
|
||||
- FirebaseCrashlytics
|
||||
- FirebasePerformance
|
||||
- SwiftJWT
|
||||
- SwiftyBeaver (from `https://github.com/SwiftyBeaver/SwiftyBeaver.git`)
|
||||
- TrustDecision (= 1.4)
|
||||
@ -28,9 +167,28 @@ SPEC REPOS:
|
||||
- BlueCryptor
|
||||
- BlueECC
|
||||
- BlueRSA
|
||||
- Firebase
|
||||
- FirebaseABTesting
|
||||
- FirebaseAnalytics
|
||||
- FirebaseCore
|
||||
- FirebaseCoreExtension
|
||||
- FirebaseCoreInternal
|
||||
- FirebaseCrashlytics
|
||||
- FirebaseInstallations
|
||||
- FirebasePerformance
|
||||
- FirebaseRemoteConfig
|
||||
- FirebaseRemoteConfigInterop
|
||||
- FirebaseSessions
|
||||
- FirebaseSharedSwift
|
||||
- GoogleAppMeasurement
|
||||
- GoogleDataTransport
|
||||
- GoogleUtilities
|
||||
- KituraContracts
|
||||
- LoggerAPI
|
||||
- Logging
|
||||
- nanopb
|
||||
- PromisesObjC
|
||||
- PromisesSwift
|
||||
- SwiftJWT
|
||||
- TrustDecision
|
||||
|
||||
@ -53,13 +211,32 @@ SPEC CHECKSUMS:
|
||||
BlueCryptor: b0aee3d9b8f367b49b30de11cda90e1735571c24
|
||||
BlueECC: 0d18e93347d3ec6d41416de21c1ffa4d4cd3c2cc
|
||||
BlueRSA: dfeef51db96bcc4edec654956c1581adbda4e6a3
|
||||
Firebase: fdb3bd378401f26a7adfcf446b0a630f8c20c0e8
|
||||
FirebaseABTesting: c2e22c3aab99afa81d0561708b2c1c356c556976
|
||||
FirebaseAnalytics: 9fcdb2e9844174bb405b34cc47092c9b91993d83
|
||||
FirebaseCore: 6e2a2782e234b14d48e880ed369ac55cda87fed7
|
||||
FirebaseCoreExtension: aa5c9779c2d0d39d83f1ceb3fdbafe80c4feecfa
|
||||
FirebaseCoreInternal: adefedc9a88dbe393c4884640a73ec9e8e790f8c
|
||||
FirebaseCrashlytics: 95cfe27373ff2edab39c28583d93cbf2dfff401d
|
||||
FirebaseInstallations: d0a8fea5a6fa91abc661591cf57c0f0d70863e57
|
||||
FirebasePerformance: 9303f34779bd99384838437c2b1fc1c1c9ff0d17
|
||||
FirebaseRemoteConfig: 05521e937b72e01847a7128da5a492327364c705
|
||||
FirebaseRemoteConfigInterop: abf8b1bbc0bf1b84abd22b66746926410bf91a87
|
||||
FirebaseSessions: 78f137e68dc01ca71606169ba4ac73b98c13752a
|
||||
FirebaseSharedSwift: 260a35e08943ec810d820a70bc0359136351d0c5
|
||||
GoogleAppMeasurement: 8bb20efc67c8fc1cff9c42a06c256caf55289bbf
|
||||
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
||||
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
|
||||
KituraContracts: e845e60dc8627ad0a76fa55ef20a45451d8f830b
|
||||
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
|
||||
Logging: beeb016c9c80cf77042d62e83495816847ef108b
|
||||
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
|
||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
||||
SwiftJWT: 88c412708f58c169d431d344c87bc79a87c830ae
|
||||
SwiftyBeaver: ade157e4f857812e7d7f15f2e3396bb8733f8a1c
|
||||
TrustDecision: 201ad3e5e834567998dffc22536ca36d600beb16
|
||||
|
||||
PODFILE CHECKSUM: f88829971628b679a467fb6f7d0bc97d7284c177
|
||||
PODFILE CHECKSUM: 8ebe73981770e981311b8d934ff3b340a89ad447
|
||||
|
||||
COCOAPODS: 1.15.2
|
||||
|
||||
88
Pods/Firebase/CoreOnly/Sources/Firebase.h
generated
Executable file
88
Pods/Firebase/CoreOnly/Sources/Firebase.h
generated
Executable file
@ -0,0 +1,88 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <FirebaseCore/FirebaseCore.h>
|
||||
|
||||
#if !defined(__has_include)
|
||||
#error "Firebase.h won't import anything if your compiler doesn't support __has_include. Please \
|
||||
import the headers individually."
|
||||
#else
|
||||
#if __has_include(<FirebaseAnalytics/FirebaseAnalytics.h>)
|
||||
#import <FirebaseAnalytics/FirebaseAnalytics.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseAppCheck/FirebaseAppCheck.h>)
|
||||
#import <FirebaseAppCheck/FirebaseAppCheck.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseAppDistribution/FirebaseAppDistribution.h>)
|
||||
#import <FirebaseAppDistribution/FirebaseAppDistribution.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseAuth/FirebaseAuth.h>)
|
||||
#import <FirebaseAuth/FirebaseAuth.h>
|
||||
#if __has_include("FirebaseAuth-umbrella.h")
|
||||
#if __has_include(<UIKit/UIKit.h>)
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
#import <FirebaseAuthInterop/FIRAuthInterop.h>
|
||||
#import <FirebaseAuth/FirebaseAuth-Swift.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseCrashlytics/FirebaseCrashlytics.h>)
|
||||
#import <FirebaseCrashlytics/FirebaseCrashlytics.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseDatabase/FirebaseDatabase.h>)
|
||||
#import <FirebaseDatabase/FirebaseDatabase.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseDynamicLinks/FirebaseDynamicLinks.h>)
|
||||
#import <FirebaseDynamicLinks/FirebaseDynamicLinks.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseFirestore/FirebaseFirestore.h>)
|
||||
#import <FirebaseFirestore/FirebaseFirestore.h>
|
||||
#endif
|
||||
|
||||
#if __has_include("FirebaseFunctions-umbrella.h")
|
||||
#import <FirebaseFunctions/FirebaseFunctions-Swift.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseInAppMessaging/FirebaseInAppMessaging.h>)
|
||||
#import <FirebaseInAppMessaging/FirebaseInAppMessaging.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseInstallations/FirebaseInstallations.h>)
|
||||
#import <FirebaseInstallations/FirebaseInstallations.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
|
||||
#import <FirebaseMessaging/FirebaseMessaging.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebasePerformance/FirebasePerformance.h>)
|
||||
#import <FirebasePerformance/FirebasePerformance.h>
|
||||
#endif
|
||||
|
||||
#if __has_include(<FirebaseRemoteConfig/FirebaseRemoteConfig.h>)
|
||||
#import <FirebaseRemoteConfig/FirebaseRemoteConfig.h>
|
||||
#endif
|
||||
|
||||
#if __has_include("FirebaseStorage-umbrella.h")
|
||||
#import <FirebaseStorage/FirebaseStorage-Swift.h>
|
||||
#endif
|
||||
|
||||
#endif // defined(__has_include)
|
||||
4
Pods/Firebase/CoreOnly/Sources/module.modulemap
generated
Executable file
4
Pods/Firebase/CoreOnly/Sources/module.modulemap
generated
Executable file
@ -0,0 +1,4 @@
|
||||
module Firebase {
|
||||
export *
|
||||
header "Firebase.h"
|
||||
}
|
||||
202
Pods/Firebase/LICENSE
generated
Normal file
202
Pods/Firebase/LICENSE
generated
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
302
Pods/Firebase/README.md
generated
Normal file
302
Pods/Firebase/README.md
generated
Normal file
@ -0,0 +1,302 @@
|
||||
<p align="center">
|
||||
<a href="https://cocoapods.org/pods/Firebase">
|
||||
<img src="https://img.shields.io/github/v/release/Firebase/firebase-ios-sdk?style=flat&label=CocoaPods"/>
|
||||
</a>
|
||||
<a href="https://swiftpackageindex.com/firebase/firebase-ios-sdk">
|
||||
<img src="https://img.shields.io/github/v/release/Firebase/firebase-ios-sdk?style=flat&label=Swift%20Package%20Index&color=red"/>
|
||||
</a>
|
||||
<a href="https://cocoapods.org/pods/Firebase">
|
||||
<img src="https://img.shields.io/github/license/Firebase/firebase-ios-sdk?style=flat"/>
|
||||
</a><br/>
|
||||
<a href="https://swiftpackageindex.com/firebase/firebase-ios-sdk">
|
||||
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffirebase%2Ffirebase-ios-sdk%2Fbadge%3Ftype%3Dplatforms"/>
|
||||
</a>
|
||||
<a href="https://swiftpackageindex.com/firebase/firebase-ios-sdk">
|
||||
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffirebase%2Ffirebase-ios-sdk%2Fbadge%3Ftype%3Dswift-versions"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# Firebase Apple Open Source Development
|
||||
|
||||
This repository contains the source code for all Apple platform Firebase SDKs except FirebaseAnalytics.
|
||||
|
||||
Firebase is an app development platform with tools to help you build, grow, and
|
||||
monetize your app. More information about Firebase can be found on the
|
||||
[official Firebase website](https://firebase.google.com).
|
||||
|
||||
## Installation
|
||||
|
||||
See the subsections below for details about the different installation methods. Where
|
||||
available, it's recommended to install any libraries with a `Swift` suffix to get the
|
||||
best experience when writing your app in Swift.
|
||||
|
||||
1. [Standard pod install](#standard-pod-install)
|
||||
2. [Swift Package Manager](#swift-package-manager)
|
||||
3. [Installing from the GitHub repo](#installing-from-github)
|
||||
4. [Experimental Carthage](#carthage-ios-only)
|
||||
|
||||
### Standard pod install
|
||||
|
||||
For instructions on the standard pod install, visit:
|
||||
[https://firebase.google.com/docs/ios/setup](https://firebase.google.com/docs/ios/setup).
|
||||
|
||||
### Swift Package Manager
|
||||
|
||||
Instructions for [Swift Package Manager](https://swift.org/package-manager/) support can be
|
||||
found in the [SwiftPackageManager.md](SwiftPackageManager.md) Markdown file.
|
||||
|
||||
### Installing from GitHub
|
||||
|
||||
These instructions can be used to access the Firebase repo at other branches,
|
||||
tags, or commits.
|
||||
|
||||
#### Background
|
||||
|
||||
See [the Podfile Syntax Reference](https://guides.cocoapods.org/syntax/podfile.html#pod)
|
||||
for instructions and options about overriding pod source locations.
|
||||
|
||||
#### Accessing Firebase Source Snapshots
|
||||
|
||||
All official releases are tagged in this repo and available via CocoaPods. To access a local
|
||||
source snapshot or unreleased branch, use Podfile directives like the following:
|
||||
|
||||
To access FirebaseFirestore via a branch:
|
||||
```ruby
|
||||
pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'main'
|
||||
pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'main'
|
||||
```
|
||||
|
||||
To access FirebaseMessaging via a checked-out version of the firebase-ios-sdk repo:
|
||||
```ruby
|
||||
pod 'FirebaseCore', :path => '/path/to/firebase-ios-sdk'
|
||||
pod 'FirebaseMessaging', :path => '/path/to/firebase-ios-sdk'
|
||||
```
|
||||
|
||||
### Carthage (iOS only)
|
||||
|
||||
Instructions for the experimental Carthage distribution can be found at
|
||||
[Carthage.md](Carthage.md).
|
||||
|
||||
### Using Firebase from a Framework or a library
|
||||
|
||||
For details on using Firebase from a Framework or a library, refer to [firebase_in_libraries.md](docs/firebase_in_libraries.md).
|
||||
|
||||
## Development
|
||||
|
||||
To develop Firebase software in this repository, ensure that you have at least
|
||||
the following software:
|
||||
|
||||
* Xcode 15.2 (or later)
|
||||
|
||||
CocoaPods is still the canonical way to develop, but much of the repo now supports
|
||||
development with Swift Package Manager.
|
||||
|
||||
### CocoaPods
|
||||
|
||||
Install the following:
|
||||
* CocoaPods 1.12.0 (or later)
|
||||
* [CocoaPods generate](https://github.com/square/cocoapods-generate)
|
||||
|
||||
For the pod that you want to develop:
|
||||
|
||||
```ruby
|
||||
pod gen Firebase{name here}.podspec --local-sources=./ --auto-open --platforms=ios
|
||||
```
|
||||
|
||||
Note: If the CocoaPods cache is out of date, you may need to run
|
||||
`pod repo update` before the `pod gen` command.
|
||||
|
||||
Note: Set the `--platforms` option to `macos` or `tvos` to develop/test for
|
||||
those platforms. Since 10.2, Xcode does not properly handle multi-platform
|
||||
CocoaPods workspaces.
|
||||
|
||||
Firestore has a self-contained Xcode project. See
|
||||
[Firestore/README](Firestore/README.md) Markdown file.
|
||||
|
||||
#### Development for Catalyst
|
||||
* `pod gen {name here}.podspec --local-sources=./ --auto-open --platforms=ios`
|
||||
* Check the Mac box in the App-iOS Build Settings
|
||||
* Sign the App in the Settings Signing & Capabilities tab
|
||||
* Click Pods in the Project Manager
|
||||
* Add Signing to the iOS host app and unit test targets
|
||||
* Select the Unit-unit scheme
|
||||
* Run it to build and test
|
||||
|
||||
Alternatively, disable signing in each target:
|
||||
* Go to Build Settings tab
|
||||
* Click `+`
|
||||
* Select `Add User-Defined Setting`
|
||||
* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO`
|
||||
|
||||
### Swift Package Manager
|
||||
* To enable test schemes: `./scripts/setup_spm_tests.sh`
|
||||
* `open Package.swift` or double click `Package.swift` in Finder.
|
||||
* Xcode will open the project
|
||||
* Choose a scheme for a library to build or test suite to run
|
||||
* Choose a target platform by selecting the run destination along with the scheme
|
||||
|
||||
### Adding a New Firebase Pod
|
||||
|
||||
Refer to [AddNewPod](AddNewPod.md) Markdown file for details.
|
||||
|
||||
### Managing Headers and Imports
|
||||
|
||||
For information about managing headers and imports, see [HeadersImports](HeadersImports.md) Markdown file.
|
||||
|
||||
### Code Formatting
|
||||
|
||||
To ensure that the code is formatted consistently, run the script
|
||||
[./scripts/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/main/scripts/check.sh)
|
||||
before creating a pull request (PR).
|
||||
|
||||
GitHub Actions will verify that any code changes are done in a style-compliant
|
||||
way. Install `clang-format` and `mint`:
|
||||
|
||||
```console
|
||||
brew install clang-format@18
|
||||
brew install mint
|
||||
```
|
||||
|
||||
### Running Unit Tests
|
||||
|
||||
Select a scheme and press Command-u to build a component and run its unit tests.
|
||||
|
||||
### Running Sample Apps
|
||||
To run the sample apps and integration tests, you'll need a valid
|
||||
`GoogleService-Info.plist
|
||||
` file. The Firebase Xcode project contains dummy plist
|
||||
files without real values, but they can be replaced with real plist files. To get your own
|
||||
`GoogleService-Info.plist` files:
|
||||
|
||||
1. Go to the [Firebase Console](https://console.firebase.google.com/)
|
||||
2. Create a new Firebase project, if you don't already have one
|
||||
3. For each sample app you want to test, create a new Firebase app with the sample app's bundle
|
||||
identifier (e.g., `com.google.Database-Example`)
|
||||
4. Download the resulting `GoogleService-Info.plist` and add it to the Xcode project.
|
||||
|
||||
### Coverage Report Generation
|
||||
|
||||
For coverage report generation instructions, see [scripts/code_coverage_report/README](scripts/code_coverage_report/README.md) Markdown file.
|
||||
|
||||
## Specific Component Instructions
|
||||
See the sections below for any special instructions for those components.
|
||||
|
||||
### Firebase Auth
|
||||
|
||||
For specific Firebase Auth development, refer to the [Auth Sample README](FirebaseAuth/Tests/Sample/README.md) for instructions about
|
||||
building and running the FirebaseAuth pod along with various samples and tests.
|
||||
|
||||
### Firebase Database
|
||||
|
||||
The Firebase Database Integration tests can be run against a locally running Database Emulator
|
||||
or against a production instance.
|
||||
|
||||
To run against a local emulator instance, invoke `./scripts/run_database_emulator.sh start` before
|
||||
running the integration test.
|
||||
|
||||
To run against a production instance, provide a valid `GoogleServices-Info.plist` and copy it to
|
||||
`FirebaseDatabase/Tests/Resources/GoogleService-Info.plist`. Your Security Rule must be set to
|
||||
[public](https://firebase.google.com/docs/database/security/quickstart) while your tests are
|
||||
running.
|
||||
|
||||
### Firebase Dynamic Links
|
||||
|
||||
Firebase Dynamic Links is **deprecated** and should not be used in new projects. The service will shut down on August 25, 2025.
|
||||
|
||||
Please see our [Dynamic Links Deprecation FAQ documentation](https://firebase.google.com/support/dynamic-links-faq) for more guidance.
|
||||
|
||||
### Firebase Performance Monitoring
|
||||
|
||||
For specific Firebase Performance Monitoring development, see
|
||||
[the Performance README](FirebasePerformance/README.md) for instructions about building the SDK
|
||||
and [the Performance TestApp README](FirebasePerformance/Tests/TestApp/README.md) for instructions about
|
||||
integrating Performance with the dev test App.
|
||||
|
||||
### Firebase Storage
|
||||
|
||||
To run the Storage Integration tests, follow the instructions in
|
||||
[StorageIntegration.swift](FirebaseStorage/Tests/Integration/StorageIntegration.swift).
|
||||
|
||||
#### Push Notifications
|
||||
|
||||
Push notifications can only be delivered to specially provisioned App IDs in the developer portal.
|
||||
In order to test receiving push notifications, you will need to:
|
||||
|
||||
1. Change the bundle identifier of the sample app to something you own in your Apple Developer
|
||||
account and enable that App ID for push notifications.
|
||||
2. You'll also need to
|
||||
[upload your APNs Provider Authentication Key or certificate to the
|
||||
Firebase Console](https://firebase.google.com/docs/cloud-messaging/ios/certs)
|
||||
at **Project Settings > Cloud Messaging > [Your Firebase App]**.
|
||||
3. Ensure your iOS device is added to your Apple Developer portal as a test device.
|
||||
|
||||
#### iOS Simulator
|
||||
|
||||
The iOS Simulator cannot register for remote notifications and will not receive push notifications.
|
||||
To receive push notifications, follow the steps above and run the app on a physical device.
|
||||
|
||||
### Vertex AI for Firebase
|
||||
|
||||
See the [Vertex AI for Firebase README](FirebaseVertexAI#development) for
|
||||
instructions about building and testing the SDK.
|
||||
|
||||
## Building with Firebase on Apple platforms
|
||||
|
||||
Firebase provides official beta support for macOS, Catalyst, and tvOS. visionOS and watchOS
|
||||
are community supported. Thanks to community contributions for many of the multi-platform PRs.
|
||||
|
||||
At this time, most of Firebase's products are available across Apple platforms. There are still
|
||||
a few gaps, especially on visionOS and watchOS. For details about the current support matrix, see
|
||||
[this chart](https://firebase.google.com/docs/ios/learn-more#firebase_library_support_by_platform)
|
||||
in Firebase's documentation.
|
||||
|
||||
### visionOS
|
||||
|
||||
Where supported, visionOS works as expected with the exception of Firestore via Swift Package
|
||||
Manager where it is required to use the source distribution.
|
||||
|
||||
To enable the Firestore source distribution, quit Xcode and open the desired
|
||||
project from the command line with the `FIREBASE_SOURCE_FIRESTORE` environment
|
||||
variable: `open --env FIREBASE_SOURCE_FIRESTORE /path/to/project.xcodeproj`.
|
||||
To go back to using the binary distribution of Firestore, quit Xcode and open
|
||||
Xcode like normal, without the environment variable.
|
||||
|
||||
### watchOS
|
||||
Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and
|
||||
work on watchOS. See the [Independent Watch App Sample](Example/watchOSSample).
|
||||
|
||||
Keep in mind that watchOS is not officially supported by Firebase. While we can catch basic unit
|
||||
test issues with GitHub Actions, there may be some changes where the SDK no longer works as expected
|
||||
on watchOS. If you encounter this, please
|
||||
[file an issue](https://github.com/firebase/firebase-ios-sdk/issues).
|
||||
|
||||
During app setup in the console, you may get to a step that mentions something like "Checking if the
|
||||
app has communicated with our servers". This relies on Analytics and will not work on watchOS.
|
||||
**It's safe to ignore the message and continue**, the rest of the SDKs will work as expected.
|
||||
|
||||
#### Additional Crashlytics Notes
|
||||
* watchOS has limited support. Due to watchOS restrictions, mach exceptions and signal crashes are
|
||||
not recorded. (Crashes in SwiftUI are generated as mach exceptions, so will not be recorded)
|
||||
|
||||
## Combine
|
||||
Thanks to contributions from the community, _FirebaseCombineSwift_ contains support for Apple's Combine
|
||||
framework. This module is currently under development and not yet supported for use in production
|
||||
environments. For more details, please refer to the [docs](FirebaseCombineSwift/README.md).
|
||||
|
||||
## Roadmap
|
||||
|
||||
See [Roadmap](ROADMAP.md) for more about the Firebase Apple SDK Open Source
|
||||
plans and directions.
|
||||
|
||||
## Contributing
|
||||
|
||||
See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase
|
||||
Apple SDK.
|
||||
|
||||
## License
|
||||
|
||||
The contents of this repository are licensed under the
|
||||
[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
Your use of Firebase is governed by the
|
||||
[Terms of Service for Firebase Services](https://firebase.google.com/terms/).
|
||||
79
Pods/FirebaseABTesting/FirebaseABTesting/Sources/ABTConditionalUserPropertyController.h
generated
Normal file
79
Pods/FirebaseABTesting/FirebaseABTesting/Sources/ABTConditionalUserPropertyController.h
generated
Normal file
@ -0,0 +1,79 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "FirebaseABTesting/Sources/Private/ABTExperimentPayload.h"
|
||||
|
||||
#import "Interop/Analytics/Public/FIRAnalyticsInterop.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class FIRLifecycleEvents;
|
||||
|
||||
/// This class dynamically calls Firebase Analytics API to collect or update experiments
|
||||
/// information.
|
||||
/// The experiment in Firebase Analytics is named as conditional user property (CUP) object defined
|
||||
/// in FIRAConditionalUserProperty.h.
|
||||
@interface ABTConditionalUserPropertyController : NSObject
|
||||
|
||||
/// Returns the ABTConditionalUserPropertyController singleton.
|
||||
+ (instancetype)sharedInstanceWithAnalytics:(id<FIRAnalyticsInterop> _Nullable)analytics;
|
||||
|
||||
/// Returns the list of currently set experiments from Firebase Analytics for the provided origin.
|
||||
- (NSArray *)experimentsWithOrigin:(NSString *)origin;
|
||||
|
||||
/// Returns the experiment ID from Firebase Analytics given an experiment object. Returns empty
|
||||
/// string if can't find Firebase Analytics service.
|
||||
- (NSString *)experimentIDOfExperiment:(nullable id)experiment;
|
||||
|
||||
/// Returns the variant ID from Firebase Analytics given an experiment object. Returns empty string
|
||||
/// if can't find Firebase Analytics service.
|
||||
- (NSString *)variantIDOfExperiment:(nullable id)experiment;
|
||||
|
||||
/// Returns whether the experiment is the same as the one in the provided payload.
|
||||
- (BOOL)isExperiment:(id)experiment theSameAsPayload:(ABTExperimentPayload *)payload;
|
||||
|
||||
/// Clears the experiment in Firebase Analytics.
|
||||
/// @param experimentID Experiment ID to clear.
|
||||
/// @param variantID Variant ID to clear.
|
||||
/// @param origin Impacted originating service, it is defined at Firebase Analytics
|
||||
/// FIREventOrigins.h.
|
||||
/// @param payload Payload to overwrite event name in events. DO NOT use payload's experiment
|
||||
/// ID and variant ID as the experiment to clear.
|
||||
/// @param events Events name for clearing the experiment.
|
||||
- (void)clearExperiment:(NSString *)experimentID
|
||||
variantID:(NSString *)variantID
|
||||
withOrigin:(NSString *)origin
|
||||
payload:(nullable ABTExperimentPayload *)payload
|
||||
events:(FIRLifecycleEvents *)events;
|
||||
|
||||
/// Sets the experiment in Firebase Analytics.
|
||||
/// @param origin Impacted originating service, it is defined at Firebase Analytics
|
||||
/// FIREventOrigins.h.
|
||||
/// @param payload Payload to overwrite event name in events. DO NOT use payload's experiment
|
||||
/// ID and variant ID as the experiment to set.
|
||||
/// @param events Events name for setting the experiment.
|
||||
/// @param policy Overflow policy when the number of experiments is over the limit.
|
||||
- (void)setExperimentWithOrigin:(NSString *)origin
|
||||
payload:(ABTExperimentPayload *)payload
|
||||
events:(FIRLifecycleEvents *)events
|
||||
policy:(ABTExperimentPayloadExperimentOverflowPolicy)policy;
|
||||
|
||||
/**
|
||||
* Unavailable. Use sharedInstanceWithAnalytics: instead.
|
||||
*/
|
||||
- (instancetype)init __attribute__((unavailable("Use +sharedInstanceWithAnalytics: instead.")));
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
288
Pods/FirebaseABTesting/FirebaseABTesting/Sources/ABTConditionalUserPropertyController.m
generated
Normal file
288
Pods/FirebaseABTesting/FirebaseABTesting/Sources/ABTConditionalUserPropertyController.m
generated
Normal file
@ -0,0 +1,288 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import "FirebaseABTesting/Sources/ABTConditionalUserPropertyController.h"
|
||||
|
||||
#import "FirebaseABTesting/Sources/ABTConstants.h"
|
||||
#import "FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRLifecycleEvents.h"
|
||||
#import "FirebaseCore/Extension/FirebaseCoreInternal.h"
|
||||
#import "Interop/Analytics/Public/FIRAnalyticsInterop.h"
|
||||
|
||||
@implementation ABTConditionalUserPropertyController {
|
||||
dispatch_queue_t _analyticOperationQueue;
|
||||
id<FIRAnalyticsInterop> _Nullable _analytics;
|
||||
}
|
||||
|
||||
/// Returns the ABTConditionalUserPropertyController singleton.
|
||||
+ (instancetype)sharedInstanceWithAnalytics:(id<FIRAnalyticsInterop> _Nullable)analytics {
|
||||
static ABTConditionalUserPropertyController *sharedInstance = nil;
|
||||
static dispatch_once_t onceToken = 0;
|
||||
dispatch_once(&onceToken, ^{
|
||||
sharedInstance = [[ABTConditionalUserPropertyController alloc] initWithAnalytics:analytics];
|
||||
});
|
||||
return sharedInstance;
|
||||
}
|
||||
|
||||
- (instancetype)initWithAnalytics:(id<FIRAnalyticsInterop> _Nullable)analytics {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_analyticOperationQueue =
|
||||
dispatch_queue_create("com.google.FirebaseABTesting.analytics", DISPATCH_QUEUE_SERIAL);
|
||||
_analytics = analytics;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - experiments proxy methods on Firebase Analytics
|
||||
|
||||
- (NSArray *)experimentsWithOrigin:(NSString *)origin {
|
||||
return [_analytics conditionalUserProperties:origin propertyNamePrefix:@""];
|
||||
}
|
||||
|
||||
- (void)clearExperiment:(NSString *)experimentID
|
||||
variantID:(NSString *)variantID
|
||||
withOrigin:(NSString *)origin
|
||||
payload:(ABTExperimentPayload *)payload
|
||||
events:(FIRLifecycleEvents *)events {
|
||||
// Payload always overwrite event names.
|
||||
NSString *clearExperimentEventName = events.clearExperimentEventName;
|
||||
if (payload && payload.clearEventToLog && payload.clearEventToLog.length) {
|
||||
clearExperimentEventName = payload.clearEventToLog;
|
||||
}
|
||||
|
||||
[_analytics clearConditionalUserProperty:experimentID
|
||||
forOrigin:origin
|
||||
clearEventName:clearExperimentEventName
|
||||
clearEventParameters:@{experimentID : variantID}];
|
||||
|
||||
FIRLogDebug(kFIRLoggerABTesting, @"I-ABT000015", @"Clear Experiment ID %@, variant ID %@.",
|
||||
experimentID, variantID);
|
||||
}
|
||||
|
||||
- (void)setExperimentWithOrigin:(NSString *)origin
|
||||
payload:(ABTExperimentPayload *)payload
|
||||
events:(FIRLifecycleEvents *)events
|
||||
policy:(ABTExperimentPayloadExperimentOverflowPolicy)policy {
|
||||
NSInteger maxNumOfExperiments = [self maxNumberOfExperimentsOfOrigin:origin];
|
||||
if (maxNumOfExperiments < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear experiments if overflow
|
||||
NSArray *experiments = [self experimentsWithOrigin:origin];
|
||||
if (!experiments) {
|
||||
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000003",
|
||||
@"Failed to get conditional user properties from Firebase Analytics.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (payload.experimentId == nil) {
|
||||
// When doing experiment test on devices, the payload could be empty. Returning here to prevent
|
||||
// app crash.
|
||||
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000020", @"Experiment Id in payload is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (maxNumOfExperiments <= experiments.count) {
|
||||
ABTExperimentPayloadExperimentOverflowPolicy overflowPolicy =
|
||||
[self overflowPolicyWithPayload:payload originalPolicy:policy];
|
||||
id experimentToClear = experiments.firstObject;
|
||||
if (overflowPolicy == ABTExperimentPayloadExperimentOverflowPolicyDiscardOldest &&
|
||||
experimentToClear) {
|
||||
NSString *expID = [self experimentIDOfExperiment:experimentToClear];
|
||||
NSString *varID = [self variantIDOfExperiment:experimentToClear];
|
||||
|
||||
[self clearExperiment:expID variantID:varID withOrigin:origin payload:payload events:events];
|
||||
FIRLogDebug(kFIRLoggerABTesting, @"I-ABT000016",
|
||||
@"Clear experiment ID %@ variant ID %@ due to "
|
||||
@"overflow policy.",
|
||||
expID, varID);
|
||||
|
||||
} else {
|
||||
FIRLogDebug(kFIRLoggerABTesting, @"I-ABT000017",
|
||||
@"Experiment ID %@ variant ID %@ won't be set due to "
|
||||
@"overflow policy.",
|
||||
payload.experimentId, payload.variantId);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Clear experiment if other variant ID exists.
|
||||
NSString *experimentID = payload.experimentId;
|
||||
NSString *variantID = payload.variantId;
|
||||
for (id experiment in experiments) {
|
||||
NSString *expID = [self experimentIDOfExperiment:experiment];
|
||||
NSString *varID = [self variantIDOfExperiment:experiment];
|
||||
if ([expID isEqualToString:experimentID] && ![varID isEqualToString:variantID]) {
|
||||
FIRLogDebug(kFIRLoggerABTesting, @"I-ABT000018",
|
||||
@"Clear experiment ID %@ with variant ID %@ because "
|
||||
@"only one variant ID can be existed "
|
||||
@"at any time.",
|
||||
expID, varID);
|
||||
[self clearExperiment:expID variantID:varID withOrigin:origin payload:payload events:events];
|
||||
}
|
||||
}
|
||||
|
||||
// Set experiment
|
||||
NSDictionary<NSString *, id> *experiment = [self createExperimentFromOrigin:origin
|
||||
payload:payload
|
||||
events:events];
|
||||
|
||||
[_analytics setConditionalUserProperty:experiment];
|
||||
|
||||
FIRLogDebug(kFIRLoggerABTesting, @"I-ABT000019",
|
||||
@"Set conditional user property, experiment ID %@ with "
|
||||
@"variant ID %@ triggered event %@.",
|
||||
experimentID, variantID, payload.triggerEvent);
|
||||
|
||||
// Log setEvent (experiment lifecycle event to be set when an experiment is set)
|
||||
[self logEventWithOrigin:origin payload:payload events:events];
|
||||
}
|
||||
|
||||
- (NSMutableDictionary<NSString *, id> *)createExperimentFromOrigin:(NSString *)origin
|
||||
payload:(ABTExperimentPayload *)payload
|
||||
events:(FIRLifecycleEvents *)events {
|
||||
NSMutableDictionary<NSString *, id> *experiment = [[NSMutableDictionary alloc] init];
|
||||
NSString *experimentID = payload.experimentId;
|
||||
NSString *variantID = payload.variantId;
|
||||
|
||||
NSDictionary *eventParams = @{experimentID : variantID};
|
||||
|
||||
[experiment setValue:origin forKey:kABTExperimentDictionaryOriginKey];
|
||||
|
||||
NSTimeInterval creationTimestamp = (double)(payload.experimentStartTimeMillis / ABT_MSEC_PER_SEC);
|
||||
[experiment setValue:@(creationTimestamp) forKey:kABTExperimentDictionaryCreationTimestampKey];
|
||||
[experiment setValue:experimentID forKey:kABTExperimentDictionaryExperimentIDKey];
|
||||
[experiment setValue:variantID forKey:kABTExperimentDictionaryVariantIDKey];
|
||||
|
||||
// For the experiment to be immediately activated/triggered, its trigger event must be null.
|
||||
// Double check if payload's trigger event is empty string, it must be set to null to trigger.
|
||||
if (payload && payload.triggerEvent && payload.triggerEvent.length) {
|
||||
[experiment setValue:payload.triggerEvent forKey:kABTExperimentDictionaryTriggeredEventNameKey];
|
||||
} else {
|
||||
[experiment setValue:nil forKey:kABTExperimentDictionaryTriggeredEventNameKey];
|
||||
}
|
||||
|
||||
// Set timeout event name and params.
|
||||
NSString *timeoutEventName = events.timeoutExperimentEventName;
|
||||
if (payload && payload.timeoutEventToLog && payload.timeoutEventToLog.length) {
|
||||
timeoutEventName = payload.timeoutEventToLog;
|
||||
}
|
||||
NSDictionary<NSString *, id> *timeoutEvent = [self eventDictionaryWithOrigin:origin
|
||||
eventName:timeoutEventName
|
||||
params:eventParams];
|
||||
[experiment setValue:timeoutEvent forKey:kABTExperimentDictionaryTimedOutEventKey];
|
||||
|
||||
// Set trigger timeout information on how long to wait for trigger event.
|
||||
NSTimeInterval triggerTimeout = (double)(payload.triggerTimeoutMillis / ABT_MSEC_PER_SEC);
|
||||
[experiment setValue:@(triggerTimeout) forKey:kABTExperimentDictionaryTriggerTimeoutKey];
|
||||
|
||||
// Set activate event name and params.
|
||||
NSString *activateEventName = events.activateExperimentEventName;
|
||||
if (payload && payload.activateEventToLog && payload.activateEventToLog.length) {
|
||||
activateEventName = payload.activateEventToLog;
|
||||
}
|
||||
NSDictionary<NSString *, id> *triggeredEvent = [self eventDictionaryWithOrigin:origin
|
||||
eventName:activateEventName
|
||||
params:eventParams];
|
||||
[experiment setValue:triggeredEvent forKey:kABTExperimentDictionaryTriggeredEventKey];
|
||||
|
||||
// Set time to live information for how long the experiment lasts.
|
||||
NSTimeInterval timeToLive = (double)(payload.timeToLiveMillis / ABT_MSEC_PER_SEC);
|
||||
[experiment setValue:@(timeToLive) forKey:kABTExperimentDictionaryTimeToLiveKey];
|
||||
|
||||
// Set expired event name and params.
|
||||
NSString *expiredEventName = events.expireExperimentEventName;
|
||||
if (payload && payload.ttlExpiryEventToLog && payload.ttlExpiryEventToLog.length) {
|
||||
expiredEventName = payload.ttlExpiryEventToLog;
|
||||
}
|
||||
NSDictionary<NSString *, id> *expiredEvent = [self eventDictionaryWithOrigin:origin
|
||||
eventName:expiredEventName
|
||||
params:eventParams];
|
||||
[experiment setValue:expiredEvent forKey:kABTExperimentDictionaryExpiredEventKey];
|
||||
return experiment;
|
||||
}
|
||||
|
||||
- (NSDictionary<NSString *, id> *)
|
||||
eventDictionaryWithOrigin:(nonnull NSString *)origin
|
||||
eventName:(nonnull NSString *)eventName
|
||||
params:(nonnull NSDictionary<NSString *, NSString *> *)params {
|
||||
return @{
|
||||
kABTEventDictionaryOriginKey : origin,
|
||||
kABTEventDictionaryNameKey : eventName,
|
||||
kABTEventDictionaryTimestampKey : @([NSDate date].timeIntervalSince1970),
|
||||
kABTEventDictionaryParametersKey : params
|
||||
};
|
||||
}
|
||||
|
||||
#pragma mark - experiment properties
|
||||
- (NSString *)experimentIDOfExperiment:(id)experiment {
|
||||
if (!experiment) {
|
||||
return @"";
|
||||
}
|
||||
return [experiment valueForKey:kABTExperimentDictionaryExperimentIDKey];
|
||||
}
|
||||
|
||||
- (NSString *)variantIDOfExperiment:(id)experiment {
|
||||
if (!experiment) {
|
||||
return @"";
|
||||
}
|
||||
return [experiment valueForKey:kABTExperimentDictionaryVariantIDKey];
|
||||
}
|
||||
|
||||
- (NSInteger)maxNumberOfExperimentsOfOrigin:(NSString *)origin {
|
||||
if (!_analytics) {
|
||||
return 0;
|
||||
}
|
||||
return [_analytics maxUserProperties:origin];
|
||||
}
|
||||
|
||||
#pragma mark - analytics internal methods
|
||||
|
||||
- (void)logEventWithOrigin:(NSString *)origin
|
||||
payload:(ABTExperimentPayload *)payload
|
||||
events:(FIRLifecycleEvents *)events {
|
||||
NSString *setExperimentEventName = events.setExperimentEventName;
|
||||
if (payload && payload.setEventToLog && payload.setEventToLog.length) {
|
||||
setExperimentEventName = payload.setEventToLog;
|
||||
}
|
||||
NSDictionary<NSString *, NSString *> *params;
|
||||
params = payload.experimentId ? @{payload.experimentId : payload.variantId} : @{};
|
||||
[_analytics logEventWithOrigin:origin name:setExperimentEventName parameters:params];
|
||||
}
|
||||
|
||||
#pragma mark - helper
|
||||
|
||||
- (BOOL)isExperiment:(id)experiment theSameAsPayload:(ABTExperimentPayload *)payload {
|
||||
NSString *experimentID = [self experimentIDOfExperiment:experiment];
|
||||
NSString *variantID = [self variantIDOfExperiment:experiment];
|
||||
return [experimentID isEqualToString:payload.experimentId] &&
|
||||
[variantID isEqualToString:payload.variantId];
|
||||
}
|
||||
|
||||
- (ABTExperimentPayloadExperimentOverflowPolicy)
|
||||
overflowPolicyWithPayload:(ABTExperimentPayload *)payload
|
||||
originalPolicy:(ABTExperimentPayloadExperimentOverflowPolicy)originalPolicy {
|
||||
if ([payload overflowPolicyIsValid]) {
|
||||
return payload.overflowPolicy;
|
||||
}
|
||||
if (originalPolicy == ABTExperimentPayloadExperimentOverflowPolicyIgnoreNewest ||
|
||||
originalPolicy == ABTExperimentPayloadExperimentOverflowPolicyDiscardOldest) {
|
||||
return originalPolicy;
|
||||
}
|
||||
return ABTExperimentPayloadExperimentOverflowPolicyDiscardOldest;
|
||||
}
|
||||
|
||||
@end
|
||||
50
Pods/FirebaseABTesting/FirebaseABTesting/Sources/ABTConstants.h
generated
Normal file
50
Pods/FirebaseABTesting/FirebaseABTesting/Sources/ABTConstants.h
generated
Normal file
@ -0,0 +1,50 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "FirebaseCore/Extension/FIRLogger.h"
|
||||
|
||||
#define ABT_MSEC_PER_SEC 1000ull
|
||||
|
||||
#pragma mark - Keys for experiment dictionaries.
|
||||
|
||||
static NSString *const kABTExperimentDictionaryCreationTimestampKey = @"creationTimestamp";
|
||||
static NSString *const kABTExperimentDictionaryExperimentIDKey = @"name";
|
||||
static NSString *const kABTExperimentDictionaryExpiredEventKey = @"expiredEvent";
|
||||
static NSString *const kABTExperimentDictionaryOriginKey = @"origin";
|
||||
static NSString *const kABTExperimentDictionaryTimedOutEventKey = @"timedOutEvent";
|
||||
static NSString *const kABTExperimentDictionaryTimeToLiveKey = @"timeToLive";
|
||||
static NSString *const kABTExperimentDictionaryTriggeredEventKey = @"triggeredEvent";
|
||||
static NSString *const kABTExperimentDictionaryTriggeredEventNameKey = @"triggerEventName";
|
||||
static NSString *const kABTExperimentDictionaryTriggerTimeoutKey = @"triggerTimeout";
|
||||
static NSString *const kABTExperimentDictionaryVariantIDKey = @"value";
|
||||
|
||||
#pragma mark - Keys for event dictionaries.
|
||||
|
||||
static NSString *const kABTEventDictionaryNameKey = @"name";
|
||||
static NSString *const kABTEventDictionaryOriginKey = @"origin";
|
||||
static NSString *const kABTEventDictionaryParametersKey = @"parameters";
|
||||
static NSString *const kABTEventDictionaryTimestampKey = @"timestamp";
|
||||
|
||||
#pragma mark - Errors
|
||||
|
||||
static NSString *const kABTErrorDomain = @"com.google.abtesting";
|
||||
|
||||
typedef NS_ENUM(NSUInteger, ABTInternalErrorCode) {
|
||||
kABTInternalErrorFailedToFetchConditionalUserProperties = 1
|
||||
};
|
||||
|
||||
#pragma mark - Logger Service String
|
||||
|
||||
extern FIRLoggerService kFIRLoggerABTesting;
|
||||
151
Pods/FirebaseABTesting/FirebaseABTesting/Sources/ABTExperimentPayload.m
generated
Normal file
151
Pods/FirebaseABTesting/FirebaseABTesting/Sources/ABTExperimentPayload.m
generated
Normal file
@ -0,0 +1,151 @@
|
||||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import "FirebaseABTesting/Sources/Private/ABTExperimentPayload.h"
|
||||
|
||||
static NSString *const kExperimentPayloadKeyExperimentID = @"experimentId";
|
||||
static NSString *const kExperimentPayloadKeyVariantID = @"variantId";
|
||||
|
||||
// Start time can either be a date string or integer (milliseconds since 1970).
|
||||
static NSString *const kExperimentPayloadKeyExperimentStartTime = @"experimentStartTime";
|
||||
static NSString *const kExperimentPayloadKeyExperimentStartTimeMillis =
|
||||
@"experimentStartTimeMillis";
|
||||
static NSString *const kExperimentPayloadKeyTriggerEvent = @"triggerEvent";
|
||||
static NSString *const kExperimentPayloadKeyTriggerTimeoutMillis = @"triggerTimeoutMillis";
|
||||
static NSString *const kExperimentPayloadKeyTimeToLiveMillis = @"timeToLiveMillis";
|
||||
static NSString *const kExperimentPayloadKeySetEventToLog = @"setEventToLog";
|
||||
static NSString *const kExperimentPayloadKeyActivateEventToLog = @"activateEventToLog";
|
||||
static NSString *const kExperimentPayloadKeyClearEventToLog = @"clearEventToLog";
|
||||
static NSString *const kExperimentPayloadKeyTimeoutEventToLog = @"timeoutEventToLog";
|
||||
static NSString *const kExperimentPayloadKeyTTLExpiryEventToLog = @"ttlExpiryEventToLog";
|
||||
|
||||
static NSString *const kExperimentPayloadKeyOverflowPolicy = @"overflowPolicy";
|
||||
static NSString *const kExperimentPayloadValueDiscardOldestOverflowPolicy = @"DISCARD_OLDEST";
|
||||
static NSString *const kExperimentPayloadValueIgnoreNewestOverflowPolicy = @"IGNORE_NEWEST";
|
||||
|
||||
static NSString *const kExperimentPayloadKeyOngoingExperiments = @"ongoingExperiments";
|
||||
|
||||
@implementation ABTExperimentLite
|
||||
|
||||
- (instancetype)initWithExperimentId:(NSString *)experimentId {
|
||||
if (self = [super init]) {
|
||||
_experimentId = experimentId;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ABTExperimentPayload
|
||||
|
||||
+ (NSDateFormatter *)experimentStartTimeFormatter {
|
||||
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"];
|
||||
[dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
|
||||
// Locale needs to be hardcoded. See
|
||||
// https://developer.apple.com/library/ios/#qa/qa1480/_index.html for more details.
|
||||
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]];
|
||||
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
|
||||
return dateFormatter;
|
||||
}
|
||||
|
||||
+ (nullable instancetype)parseFromData:(NSData *)data {
|
||||
NSError *error;
|
||||
NSDictionary *experimentDictionary =
|
||||
[NSJSONSerialization JSONObjectWithData:data
|
||||
options:NSJSONReadingAllowFragments
|
||||
error:&error];
|
||||
if (error != nil) {
|
||||
return nil;
|
||||
} else {
|
||||
return [[ABTExperimentPayload alloc] initWithDictionary:experimentDictionary];
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype)initWithDictionary:(NSDictionary<NSString *, id> *)dictionary {
|
||||
if (self = [super init]) {
|
||||
_experimentId = dictionary[kExperimentPayloadKeyExperimentID];
|
||||
_variantId = dictionary[kExperimentPayloadKeyVariantID];
|
||||
_triggerEvent = dictionary[kExperimentPayloadKeyTriggerEvent];
|
||||
_setEventToLog = dictionary[kExperimentPayloadKeySetEventToLog];
|
||||
_activateEventToLog = dictionary[kExperimentPayloadKeyActivateEventToLog];
|
||||
_clearEventToLog = dictionary[kExperimentPayloadKeyClearEventToLog];
|
||||
_timeoutEventToLog = dictionary[kExperimentPayloadKeyTimeoutEventToLog];
|
||||
_ttlExpiryEventToLog = dictionary[kExperimentPayloadKeyTTLExpiryEventToLog];
|
||||
|
||||
// Experiment start time can either be in the form of a date string or milliseconds since 1970.
|
||||
if (dictionary[kExperimentPayloadKeyExperimentStartTime]) {
|
||||
// Convert from date string.
|
||||
NSDate *experimentStartTime = [[[self class] experimentStartTimeFormatter]
|
||||
dateFromString:dictionary[kExperimentPayloadKeyExperimentStartTime]];
|
||||
_experimentStartTimeMillis =
|
||||
[@([experimentStartTime timeIntervalSince1970] * 1000) longLongValue];
|
||||
} else if (dictionary[kExperimentPayloadKeyExperimentStartTimeMillis]) {
|
||||
// Simply store milliseconds.
|
||||
_experimentStartTimeMillis =
|
||||
[dictionary[kExperimentPayloadKeyExperimentStartTimeMillis] longLongValue];
|
||||
;
|
||||
}
|
||||
|
||||
_triggerTimeoutMillis = [dictionary[kExperimentPayloadKeyTriggerTimeoutMillis] longLongValue];
|
||||
_timeToLiveMillis = [dictionary[kExperimentPayloadKeyTimeToLiveMillis] longLongValue];
|
||||
|
||||
// Overflow policy can be an integer, or string e.g. "DISCARD_OLDEST" or "IGNORE_NEWEST".
|
||||
if ([dictionary[kExperimentPayloadKeyOverflowPolicy] isKindOfClass:[NSString class]]) {
|
||||
// If it's a string, pick against the preset string values.
|
||||
NSString *policy = dictionary[kExperimentPayloadKeyOverflowPolicy];
|
||||
if ([policy isEqualToString:kExperimentPayloadValueDiscardOldestOverflowPolicy]) {
|
||||
_overflowPolicy = ABTExperimentPayloadExperimentOverflowPolicyDiscardOldest;
|
||||
} else if ([policy isEqualToString:kExperimentPayloadValueIgnoreNewestOverflowPolicy]) {
|
||||
_overflowPolicy = ABTExperimentPayloadExperimentOverflowPolicyIgnoreNewest;
|
||||
} else {
|
||||
_overflowPolicy = ABTExperimentPayloadExperimentOverflowPolicyUnrecognizedValue;
|
||||
}
|
||||
} else {
|
||||
_overflowPolicy = [dictionary[kExperimentPayloadKeyOverflowPolicy] intValue];
|
||||
}
|
||||
|
||||
NSMutableArray<ABTExperimentLite *> *ongoingExperiments = [[NSMutableArray alloc] init];
|
||||
|
||||
NSArray<NSDictionary<NSString *, NSString *> *> *ongoingExperimentsArray =
|
||||
dictionary[kExperimentPayloadKeyOngoingExperiments];
|
||||
|
||||
for (NSDictionary<NSString *, NSString *> *experimentDictionary in ongoingExperimentsArray) {
|
||||
NSString *experimentId = experimentDictionary[kExperimentPayloadKeyExperimentID];
|
||||
if (experimentId) {
|
||||
ABTExperimentLite *liteExperiment =
|
||||
[[ABTExperimentLite alloc] initWithExperimentId:experimentId];
|
||||
[ongoingExperiments addObject:liteExperiment];
|
||||
}
|
||||
}
|
||||
|
||||
_ongoingExperiments = [ongoingExperiments copy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)clearTriggerEvent {
|
||||
_triggerEvent = nil;
|
||||
}
|
||||
|
||||
- (BOOL)overflowPolicyIsValid {
|
||||
return self.overflowPolicy == ABTExperimentPayloadExperimentOverflowPolicyIgnoreNewest ||
|
||||
self.overflowPolicy == ABTExperimentPayloadExperimentOverflowPolicyDiscardOldest;
|
||||
}
|
||||
|
||||
- (void)setOverflowPolicy:(ABTExperimentPayloadExperimentOverflowPolicy)overflowPolicy {
|
||||
_overflowPolicy = overflowPolicy;
|
||||
}
|
||||
|
||||
@end
|
||||
310
Pods/FirebaseABTesting/FirebaseABTesting/Sources/FIRExperimentController.m
generated
Normal file
310
Pods/FirebaseABTesting/FirebaseABTesting/Sources/FIRExperimentController.m
generated
Normal file
@ -0,0 +1,310 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import "FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRExperimentController.h"
|
||||
|
||||
#import "FirebaseABTesting/Sources/ABTConditionalUserPropertyController.h"
|
||||
#import "FirebaseABTesting/Sources/ABTConstants.h"
|
||||
#import "FirebaseABTesting/Sources/Private/ABTExperimentPayload.h"
|
||||
#import "FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRLifecycleEvents.h"
|
||||
#import "FirebaseCore/Extension/FirebaseCoreInternal.h"
|
||||
|
||||
#import "Interop/Analytics/Public/FIRAnalyticsInterop.h"
|
||||
|
||||
/// Logger Service String.
|
||||
FIRLoggerService kFIRLoggerABTesting = @"[FirebaseABTesting]";
|
||||
|
||||
/// Default experiment overflow policy.
|
||||
const ABTExperimentPayloadExperimentOverflowPolicy FIRDefaultExperimentOverflowPolicy =
|
||||
ABTExperimentPayloadExperimentOverflowPolicyDiscardOldest;
|
||||
|
||||
/// Deserialize the experiment payloads.
|
||||
ABTExperimentPayload *ABTDeserializeExperimentPayload(NSData *payload) {
|
||||
// Verify that we have a JSON object.
|
||||
NSError *error;
|
||||
id JSONObject = [NSJSONSerialization JSONObjectWithData:payload options:kNilOptions error:&error];
|
||||
if (JSONObject == nil) {
|
||||
FIRLogError(kFIRLoggerABTesting, @"I-ABT000001", @"Failed to parse experiment payload: %@",
|
||||
error.debugDescription);
|
||||
}
|
||||
return [ABTExperimentPayload parseFromData:payload];
|
||||
}
|
||||
|
||||
/// Returns a list of experiments to be set given the payloads and current list of experiments from
|
||||
/// Firebase Analytics. If an experiment is in payloads but not in experiments, it should be set to
|
||||
/// Firebase Analytics.
|
||||
NSArray<ABTExperimentPayload *> *ABTExperimentsToSetFromPayloads(
|
||||
NSArray<NSData *> *payloads,
|
||||
NSArray<NSDictionary<NSString *, NSString *> *> *experiments,
|
||||
id<FIRAnalyticsInterop> _Nullable analytics) {
|
||||
NSArray<NSData *> *payloadsCopy = [payloads copy];
|
||||
NSArray *experimentsCopy = [experiments copy];
|
||||
NSMutableArray *experimentsToSet = [[NSMutableArray alloc] init];
|
||||
ABTConditionalUserPropertyController *controller =
|
||||
[ABTConditionalUserPropertyController sharedInstanceWithAnalytics:analytics];
|
||||
|
||||
// Check if the experiment is in payloads but not in experiments.
|
||||
for (NSData *payload in payloadsCopy) {
|
||||
ABTExperimentPayload *experimentPayload = ABTDeserializeExperimentPayload(payload);
|
||||
if (!experimentPayload) {
|
||||
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000002",
|
||||
@"Either payload is not set or it cannot be deserialized.");
|
||||
continue;
|
||||
}
|
||||
|
||||
BOOL isExperimentSet = NO;
|
||||
for (id experiment in experimentsCopy) {
|
||||
if ([controller isExperiment:experiment theSameAsPayload:experimentPayload]) {
|
||||
isExperimentSet = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isExperimentSet) {
|
||||
[experimentsToSet addObject:experimentPayload];
|
||||
}
|
||||
}
|
||||
return [experimentsToSet copy];
|
||||
}
|
||||
|
||||
/// Returns a list of experiments to be cleared given the payloads and current list of
|
||||
/// experiments from Firebase Analytics. If an experiment is in experiments but not in payloads, it
|
||||
/// should be cleared in Firebase Analytics.
|
||||
NSArray *ABTExperimentsToClearFromPayloads(
|
||||
NSArray<NSData *> *payloads,
|
||||
NSArray<NSDictionary<NSString *, NSString *> *> *experiments,
|
||||
id<FIRAnalyticsInterop> _Nullable analytics) {
|
||||
NSMutableArray *experimentsToClear = [[NSMutableArray alloc] init];
|
||||
ABTConditionalUserPropertyController *controller =
|
||||
[ABTConditionalUserPropertyController sharedInstanceWithAnalytics:analytics];
|
||||
|
||||
// Check if the experiment is in experiments but not payloads.
|
||||
for (id experiment in [experiments copy]) {
|
||||
BOOL doesExperimentNoLongerExist = YES;
|
||||
for (NSData *payload in [payloads copy]) {
|
||||
ABTExperimentPayload *experimentPayload = ABTDeserializeExperimentPayload(payload);
|
||||
if (!experimentPayload) {
|
||||
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000002",
|
||||
@"Either payload is not set or it cannot be deserialized.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if ([controller isExperiment:experiment theSameAsPayload:experimentPayload]) {
|
||||
doesExperimentNoLongerExist = NO;
|
||||
}
|
||||
}
|
||||
if (doesExperimentNoLongerExist) {
|
||||
[experimentsToClear addObject:experiment];
|
||||
}
|
||||
}
|
||||
return experimentsToClear;
|
||||
}
|
||||
|
||||
// ABT doesn't provide any functionality to other components,
|
||||
// so it provides a private, empty protocol that it conforms to and use it for registration.
|
||||
|
||||
@protocol FIRABTInstanceProvider
|
||||
@end
|
||||
|
||||
@interface FIRExperimentController () <FIRABTInstanceProvider, FIRLibrary>
|
||||
@property(nonatomic, readwrite, strong) id<FIRAnalyticsInterop> _Nullable analytics;
|
||||
@end
|
||||
|
||||
@implementation FIRExperimentController
|
||||
|
||||
+ (void)load {
|
||||
[FIRApp registerInternalLibrary:(Class<FIRLibrary>)self withName:@"fire-abt"];
|
||||
}
|
||||
|
||||
+ (nonnull NSArray<FIRComponent *> *)componentsToRegister {
|
||||
FIRComponentCreationBlock creationBlock =
|
||||
^id _Nullable(FIRComponentContainer *container, BOOL *isCacheable) {
|
||||
// Ensure it's cached so it returns the same instance every time ABTesting is called.
|
||||
*isCacheable = YES;
|
||||
id<FIRAnalyticsInterop> analytics = FIR_COMPONENT(FIRAnalyticsInterop, container);
|
||||
return [[FIRExperimentController alloc] initWithAnalytics:analytics];
|
||||
};
|
||||
FIRComponent *abtProvider = [FIRComponent componentWithProtocol:@protocol(FIRABTInstanceProvider)
|
||||
instantiationTiming:FIRInstantiationTimingLazy
|
||||
creationBlock:creationBlock];
|
||||
|
||||
return @[ abtProvider ];
|
||||
}
|
||||
|
||||
- (instancetype)initWithAnalytics:(nullable id<FIRAnalyticsInterop>)analytics {
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_analytics = analytics;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (FIRExperimentController *)sharedInstance {
|
||||
FIRApp *defaultApp = [FIRApp defaultApp]; // Missing configure will be logged here.
|
||||
id<FIRABTInstanceProvider> instance = FIR_COMPONENT(FIRABTInstanceProvider, defaultApp.container);
|
||||
|
||||
// We know the instance coming from the container is a FIRExperimentController instance, cast it.
|
||||
return (FIRExperimentController *)instance;
|
||||
}
|
||||
|
||||
- (void)updateExperimentsWithServiceOrigin:(NSString *)origin
|
||||
events:(FIRLifecycleEvents *)events
|
||||
policy:(ABTExperimentPayloadExperimentOverflowPolicy)policy
|
||||
lastStartTime:(NSTimeInterval)lastStartTime
|
||||
payloads:(NSArray<NSData *> *)payloads
|
||||
completionHandler:
|
||||
(nullable void (^)(NSError *_Nullable error))completionHandler {
|
||||
FIRExperimentController *__weak weakSelf = self;
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
|
||||
FIRExperimentController *strongSelf = weakSelf;
|
||||
[strongSelf updateExperimentConditionalUserPropertiesWithServiceOrigin:origin
|
||||
events:events
|
||||
policy:policy
|
||||
lastStartTime:lastStartTime
|
||||
payloads:payloads
|
||||
completionHandler:completionHandler];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)
|
||||
updateExperimentConditionalUserPropertiesWithServiceOrigin:(NSString *)origin
|
||||
events:(FIRLifecycleEvents *)events
|
||||
policy:
|
||||
(ABTExperimentPayloadExperimentOverflowPolicy)
|
||||
policy
|
||||
lastStartTime:(NSTimeInterval)lastStartTime
|
||||
payloads:(NSArray<NSData *> *)payloads
|
||||
completionHandler:
|
||||
(nullable void (^)(NSError *_Nullable error))
|
||||
completionHandler {
|
||||
ABTConditionalUserPropertyController *controller =
|
||||
[ABTConditionalUserPropertyController sharedInstanceWithAnalytics:_analytics];
|
||||
|
||||
// Get the list of experiments from Firebase Analytics.
|
||||
NSArray *experiments = [controller experimentsWithOrigin:origin];
|
||||
if (!experiments) {
|
||||
NSString *errorDescription =
|
||||
@"Failed to get conditional user properties from Firebase Analytics.";
|
||||
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000003", @"%@", errorDescription);
|
||||
|
||||
if (completionHandler) {
|
||||
completionHandler([NSError
|
||||
errorWithDomain:kABTErrorDomain
|
||||
code:kABTInternalErrorFailedToFetchConditionalUserProperties
|
||||
userInfo:@{NSLocalizedDescriptionKey : errorDescription}]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
NSArray<ABTExperimentPayload *> *experimentsToSet =
|
||||
ABTExperimentsToSetFromPayloads(payloads, experiments, _analytics);
|
||||
NSArray<NSDictionary<NSString *, NSString *> *> *experimentsToClear =
|
||||
ABTExperimentsToClearFromPayloads(payloads, experiments, _analytics);
|
||||
|
||||
for (id experiment in experimentsToClear) {
|
||||
NSString *experimentID = [controller experimentIDOfExperiment:experiment];
|
||||
NSString *variantID = [controller variantIDOfExperiment:experiment];
|
||||
[controller clearExperiment:experimentID
|
||||
variantID:variantID
|
||||
withOrigin:origin
|
||||
payload:nil
|
||||
events:events];
|
||||
}
|
||||
|
||||
for (ABTExperimentPayload *experimentPayload in experimentsToSet) {
|
||||
if (experimentPayload.experimentStartTimeMillis > lastStartTime * ABT_MSEC_PER_SEC) {
|
||||
[controller setExperimentWithOrigin:origin
|
||||
payload:experimentPayload
|
||||
events:events
|
||||
policy:policy];
|
||||
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000008",
|
||||
@"Set Experiment ID %@, variant ID %@ to Firebase Analytics.",
|
||||
experimentPayload.experimentId, experimentPayload.variantId);
|
||||
|
||||
} else {
|
||||
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000009",
|
||||
@"Not setting experiment ID %@, variant ID %@ due to the last update time %lld.",
|
||||
experimentPayload.experimentId, experimentPayload.variantId,
|
||||
(long)lastStartTime * ABT_MSEC_PER_SEC);
|
||||
}
|
||||
}
|
||||
|
||||
if (completionHandler) {
|
||||
completionHandler(nil);
|
||||
}
|
||||
}
|
||||
|
||||
- (NSTimeInterval)latestExperimentStartTimestampBetweenTimestamp:(NSTimeInterval)timestamp
|
||||
andPayloads:(NSArray<NSData *> *)payloads {
|
||||
for (NSData *payload in [payloads copy]) {
|
||||
ABTExperimentPayload *experimentPayload = ABTDeserializeExperimentPayload(payload);
|
||||
if (!experimentPayload) {
|
||||
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000002",
|
||||
@"Either payload is not set or it cannot be deserialized.");
|
||||
continue;
|
||||
}
|
||||
if (experimentPayload.experimentStartTimeMillis > timestamp * ABT_MSEC_PER_SEC) {
|
||||
timestamp = (double)(experimentPayload.experimentStartTimeMillis / ABT_MSEC_PER_SEC);
|
||||
}
|
||||
}
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
- (void)validateRunningExperimentsForServiceOrigin:(NSString *)origin
|
||||
runningExperimentPayloads:(NSArray<ABTExperimentPayload *> *)payloads {
|
||||
ABTConditionalUserPropertyController *controller =
|
||||
[ABTConditionalUserPropertyController sharedInstanceWithAnalytics:_analytics];
|
||||
|
||||
FIRLifecycleEvents *lifecycleEvents = [[FIRLifecycleEvents alloc] init];
|
||||
|
||||
// Get the list of experiments from Firebase Analytics.
|
||||
NSArray<NSDictionary<NSString *, NSString *> *> *activeExperiments =
|
||||
[controller experimentsWithOrigin:origin];
|
||||
|
||||
NSMutableSet *runningExperimentIDs = [NSMutableSet setWithCapacity:payloads.count];
|
||||
for (ABTExperimentPayload *payload in payloads) {
|
||||
[runningExperimentIDs addObject:payload.experimentId];
|
||||
}
|
||||
|
||||
for (NSDictionary<NSString *, NSString *> *activeExperimentDictionary in activeExperiments) {
|
||||
NSString *experimentID = activeExperimentDictionary[@"name"];
|
||||
if (![runningExperimentIDs containsObject:experimentID]) {
|
||||
NSString *variantID = activeExperimentDictionary[@"value"];
|
||||
|
||||
[controller clearExperiment:experimentID
|
||||
variantID:variantID
|
||||
withOrigin:origin
|
||||
payload:nil
|
||||
events:lifecycleEvents];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)activateExperiment:(ABTExperimentPayload *)experimentPayload
|
||||
forServiceOrigin:(NSString *)origin {
|
||||
ABTConditionalUserPropertyController *controller =
|
||||
[ABTConditionalUserPropertyController sharedInstanceWithAnalytics:_analytics];
|
||||
|
||||
FIRLifecycleEvents *lifecycleEvents = [[FIRLifecycleEvents alloc] init];
|
||||
|
||||
// Ensure that trigger event is nil, which will immediately set the experiment to active.
|
||||
[experimentPayload clearTriggerEvent];
|
||||
|
||||
[controller setExperimentWithOrigin:origin
|
||||
payload:experimentPayload
|
||||
events:lifecycleEvents
|
||||
policy:experimentPayload.overflowPolicy];
|
||||
}
|
||||
|
||||
@end
|
||||
88
Pods/FirebaseABTesting/FirebaseABTesting/Sources/FIRLifecycleEvents.m
generated
Normal file
88
Pods/FirebaseABTesting/FirebaseABTesting/Sources/FIRLifecycleEvents.m
generated
Normal file
@ -0,0 +1,88 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import "FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRLifecycleEvents.h"
|
||||
|
||||
#import "FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRExperimentController.h"
|
||||
|
||||
/// Default name of the analytics event to be logged when an experiment is set.
|
||||
NSString *const FIRSetExperimentEventName = @"_exp_set";
|
||||
/// Default name of the analytics event to be logged when an experiment is activated.
|
||||
NSString *const FIRActivateExperimentEventName = @"_exp_activate";
|
||||
/// Default name of the analytics event to be logged when an experiment is cleared.
|
||||
NSString *const FIRClearExperimentEventName = @"_exp_clear";
|
||||
/// Default name of the analytics event to be logged when an experiment times out for being
|
||||
/// activated.
|
||||
NSString *const FIRTimeoutExperimentEventName = @"_exp_timeout";
|
||||
/// Default name of the analytics event to be logged when an experiment is expired as it reaches the
|
||||
/// end of TTL.
|
||||
NSString *const FIRExpireExperimentEventName = @"_exp_expire";
|
||||
/// Prefix for lifecycle event names.
|
||||
static NSString *const kLifecycleEventPrefix = @"_";
|
||||
|
||||
@implementation FIRLifecycleEvents
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_setExperimentEventName = FIRSetExperimentEventName;
|
||||
_activateExperimentEventName = FIRActivateExperimentEventName;
|
||||
_clearExperimentEventName = FIRClearExperimentEventName;
|
||||
_timeoutExperimentEventName = FIRTimeoutExperimentEventName;
|
||||
_expireExperimentEventName = FIRExpireExperimentEventName;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setSetExperimentEventName:(NSString *)setExperimentEventName {
|
||||
if (setExperimentEventName && [setExperimentEventName hasPrefix:kLifecycleEventPrefix]) {
|
||||
_setExperimentEventName = setExperimentEventName;
|
||||
} else {
|
||||
_setExperimentEventName = FIRSetExperimentEventName;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setActivateExperimentEventName:(NSString *)activateExperimentEventName {
|
||||
if (activateExperimentEventName &&
|
||||
[activateExperimentEventName hasPrefix:kLifecycleEventPrefix]) {
|
||||
_activateExperimentEventName = activateExperimentEventName;
|
||||
} else {
|
||||
_activateExperimentEventName = FIRActivateExperimentEventName;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setClearExperimentEventName:(NSString *)clearExperimentEventName {
|
||||
if (clearExperimentEventName && [clearExperimentEventName hasPrefix:kLifecycleEventPrefix]) {
|
||||
_clearExperimentEventName = clearExperimentEventName;
|
||||
} else {
|
||||
_clearExperimentEventName = FIRClearExperimentEventName;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setTimeoutExperimentEventName:(NSString *)timeoutExperimentEventName {
|
||||
if (timeoutExperimentEventName && [timeoutExperimentEventName hasPrefix:kLifecycleEventPrefix]) {
|
||||
_timeoutExperimentEventName = timeoutExperimentEventName;
|
||||
} else {
|
||||
_timeoutExperimentEventName = FIRTimeoutExperimentEventName;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setExpireExperimentEventName:(NSString *)expireExperimentEventName {
|
||||
if (expireExperimentEventName && [_timeoutExperimentEventName hasPrefix:kLifecycleEventPrefix]) {
|
||||
_expireExperimentEventName = expireExperimentEventName;
|
||||
} else {
|
||||
_expireExperimentEventName = FIRExpireExperimentEventName;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
96
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Private/ABTExperimentPayload.h
generated
Normal file
96
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Private/ABTExperimentPayload.h
generated
Normal file
@ -0,0 +1,96 @@
|
||||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// Policy for handling the case where there's an overflow of experiments for an installation
|
||||
/// instance.
|
||||
typedef NS_ENUM(int32_t, ABTExperimentPayloadExperimentOverflowPolicy) {
|
||||
ABTExperimentPayloadExperimentOverflowPolicyUnrecognizedValue = 999,
|
||||
ABTExperimentPayloadExperimentOverflowPolicyUnspecified = 0,
|
||||
ABTExperimentPayloadExperimentOverflowPolicyDiscardOldest = 1,
|
||||
ABTExperimentPayloadExperimentOverflowPolicyIgnoreNewest = 2,
|
||||
};
|
||||
|
||||
@interface ABTExperimentLite : NSObject
|
||||
@property(nonatomic, readonly, copy) NSString *experimentId;
|
||||
|
||||
- (instancetype)initWithExperimentId:(NSString *)experimentId NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
@interface ABTExperimentPayload : NSObject
|
||||
|
||||
/// Unique identifier for this experiment.
|
||||
@property(nonatomic, readonly, copy) NSString *experimentId;
|
||||
|
||||
/// Unique identifier for the variant to which an installation instance has been assigned.
|
||||
@property(nonatomic, readonly, copy) NSString *variantId;
|
||||
|
||||
/// Epoch time that represents when the experiment was started.
|
||||
@property(nonatomic, readonly) int64_t experimentStartTimeMillis;
|
||||
|
||||
/// The event that triggers this experiment into ON state.
|
||||
@property(nonatomic, nullable, readonly, copy) NSString *triggerEvent;
|
||||
|
||||
/// Duration in milliseconds for which the experiment can stay in STANDBY state (un-triggered).
|
||||
@property(nonatomic, readonly) int64_t triggerTimeoutMillis;
|
||||
|
||||
/// Duration in milliseconds for which the experiment can stay in ON state (triggered).
|
||||
@property(nonatomic, readonly) int64_t timeToLiveMillis;
|
||||
|
||||
/// The event logged when impact service sets the experiment.
|
||||
@property(nonatomic, readonly, copy) NSString *setEventToLog;
|
||||
|
||||
/// The event logged when an experiment goes to the ON state.
|
||||
@property(nonatomic, readonly, copy) NSString *activateEventToLog;
|
||||
|
||||
/// The event logged when an experiment is cleared.
|
||||
@property(nonatomic, readonly, copy) NSString *clearEventToLog;
|
||||
|
||||
/// The event logged when an experiment times out after `triggerTimeoutMillis` milliseconds.
|
||||
@property(nonatomic, readonly, copy) NSString *timeoutEventToLog;
|
||||
|
||||
/// The event logged when an experiment times out after `timeToLiveMillis` milliseconds.
|
||||
@property(nonatomic, readonly, copy) NSString *ttlExpiryEventToLog;
|
||||
|
||||
@property(nonatomic, readonly) ABTExperimentPayloadExperimentOverflowPolicy overflowPolicy;
|
||||
|
||||
/// A list of all other ongoing (started, and not yet stopped) experiments at the time this
|
||||
/// experiment was started. Does not include this experiment; only the others.
|
||||
@property(nonatomic, readonly) NSArray<ABTExperimentLite *> *ongoingExperiments;
|
||||
|
||||
/// Parses an ABTExperimentPayload directly from JSON data.
|
||||
/// @param data JSON object as NSData. Must be reconstructible as an NSDictionary<NSString* , id>.
|
||||
+ (nullable instancetype)parseFromData:(NSData *)data;
|
||||
|
||||
/// Initializes an ABTExperimentPayload from a dictionary with experiment metadata.
|
||||
- (instancetype)initWithDictionary:(NSDictionary<NSString *, id> *)dictionary
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/// Clears the trigger event associated with this payload.
|
||||
- (void)clearTriggerEvent;
|
||||
|
||||
/// Checks if the overflow policy is a valid enum object.
|
||||
- (BOOL)overflowPolicyIsValid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
20
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Private/FirebaseABTestingInternal.h
generated
Normal file
20
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Private/FirebaseABTestingInternal.h
generated
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// An umbrella header, for any other libraries in this repo to access Firebase Public and Private
|
||||
// headers. Any package manager complexity should be handled here.
|
||||
|
||||
#import <FirebaseABTesting/FirebaseABTesting.h>
|
||||
|
||||
#import "FirebaseABTesting/Sources/Private/ABTExperimentPayload.h"
|
||||
83
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRExperimentController.h
generated
Normal file
83
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRExperimentController.h
generated
Normal file
@ -0,0 +1,83 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class ABTExperimentPayload;
|
||||
|
||||
// Forward declaration to avoid importing into the module header
|
||||
typedef NS_ENUM(int32_t, ABTExperimentPayloadExperimentOverflowPolicy);
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class FIRLifecycleEvents;
|
||||
|
||||
/// The default experiment overflow policy, that is to discard the experiment with the oldest start
|
||||
/// time when users start the experiment on the web console.
|
||||
extern const ABTExperimentPayloadExperimentOverflowPolicy FIRDefaultExperimentOverflowPolicy;
|
||||
|
||||
/// This class is for Firebase services to handle experiments updates to Firebase Analytics.
|
||||
/// Experiments can be set, cleared and updated through this controller.
|
||||
NS_SWIFT_NAME(ExperimentController)
|
||||
@interface FIRExperimentController : NSObject
|
||||
|
||||
/// Returns the FIRExperimentController singleton.
|
||||
+ (FIRExperimentController *)sharedInstance;
|
||||
|
||||
/// Updates the list of experiments with an optional completion handler. Experiments already
|
||||
/// existing in payloads are not affected, whose state and payload is preserved. This method
|
||||
/// compares whether the experiments have changed or not by their variant ID. This runs in a
|
||||
/// background queue and calls the completion handler when finished executing.
|
||||
/// @param origin The originating service affected by the experiment.
|
||||
/// @param events A list of event names to be used for logging experiment lifecycle events,
|
||||
/// if they are not defined in the payload.
|
||||
/// @param policy The policy to handle new experiments when slots are full.
|
||||
/// @param lastStartTime The last known experiment start timestamp for this affected service.
|
||||
/// (Timestamps are specified by the number of seconds from 00:00:00 UTC on 1
|
||||
/// January 1970.).
|
||||
/// @param payloads List of experiment metadata.
|
||||
/// @param completionHandler Code to be executed after experiments are updated in the background
|
||||
/// thread.
|
||||
- (void)updateExperimentsWithServiceOrigin:(NSString *)origin
|
||||
events:(FIRLifecycleEvents *)events
|
||||
policy:(ABTExperimentPayloadExperimentOverflowPolicy)policy
|
||||
lastStartTime:(NSTimeInterval)lastStartTime
|
||||
payloads:(NSArray<NSData *> *)payloads
|
||||
completionHandler:
|
||||
(nullable void (^)(NSError *_Nullable error))completionHandler;
|
||||
|
||||
/// Returns the latest experiment start timestamp given a current latest timestamp and a list of
|
||||
/// experiment payloads. Timestamps are specified by the number of seconds from 00:00:00 UTC on 1
|
||||
/// January 1970.
|
||||
/// @param timestamp Current latest experiment start timestamp. If not known, affected service
|
||||
/// should specify -1;
|
||||
/// @param payloads List of experiment metadata.
|
||||
- (NSTimeInterval)latestExperimentStartTimestampBetweenTimestamp:(NSTimeInterval)timestamp
|
||||
andPayloads:(NSArray<NSData *> *)payloads;
|
||||
|
||||
/// Expires experiments that aren't in the list of running experiment payloads.
|
||||
/// @param origin The originating service affected by the experiment.
|
||||
/// @param payloads The list of valid, running experiments.
|
||||
- (void)validateRunningExperimentsForServiceOrigin:(NSString *)origin
|
||||
runningExperimentPayloads:(NSArray<ABTExperimentPayload *> *)payloads;
|
||||
|
||||
/// Directly sets a given experiment to be active.
|
||||
/// @param experimentPayload The payload for the experiment that should be activated.
|
||||
/// @param origin The originating service affected by the experiment.
|
||||
- (void)activateExperiment:(ABTExperimentPayload *)experimentPayload
|
||||
forServiceOrigin:(NSString *)origin;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
66
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRLifecycleEvents.h
generated
Normal file
66
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRLifecycleEvents.h
generated
Normal file
@ -0,0 +1,66 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// Default event name for when an experiment is set.
|
||||
extern NSString *const FIRSetExperimentEventName NS_SWIFT_NAME(DefaultSetExperimentEventName);
|
||||
/// Default event name for when an experiment is activated.
|
||||
// clang-format off
|
||||
// clang-format12 will merge lines and exceed 100 character limit.
|
||||
extern NSString *const FIRActivateExperimentEventName
|
||||
NS_SWIFT_NAME(DefaultActivateExperimentEventName);
|
||||
/// Default event name for when an experiment is cleared.
|
||||
extern NSString *const FIRClearExperimentEventName NS_SWIFT_NAME(DefaultClearExperimentEventName);
|
||||
/// Default event name for when an experiment times out for being activated.
|
||||
extern NSString *const FIRTimeoutExperimentEventName
|
||||
NS_SWIFT_NAME(DefaultTimeoutExperimentEventName);
|
||||
// clang-format on
|
||||
/// Default event name for when an experiment is expired as it reaches the end of TTL.
|
||||
extern NSString *const FIRExpireExperimentEventName NS_SWIFT_NAME(DefaultExpireExperimentEventName);
|
||||
|
||||
/// An Experiment Lifecycle Event Object that specifies the name of the experiment event to be
|
||||
/// logged by Firebase Analytics.
|
||||
NS_SWIFT_NAME(LifecycleEvents)
|
||||
@interface FIRLifecycleEvents : NSObject
|
||||
|
||||
/// Event name for when an experiment is set. It defaults to `SetExperimentEventName` and can be
|
||||
/// overridden. If experiment payload has a valid string of this field, always use
|
||||
/// experiment payload.
|
||||
@property(nonatomic, copy) NSString *setExperimentEventName;
|
||||
|
||||
/// Event name for when an experiment is activated. It defaults to `ActivateExperimentEventName`
|
||||
/// and can be overridden. If experiment payload has a valid string of this field, always use
|
||||
/// experiment payload.
|
||||
@property(nonatomic, copy) NSString *activateExperimentEventName;
|
||||
|
||||
/// Event name for when an experiment is cleared. It is default to `ClearExperimentEventName` and
|
||||
/// can be overridden. If experiment payload has a valid string of this field, always use experiment
|
||||
/// payload.
|
||||
@property(nonatomic, copy) NSString *clearExperimentEventName;
|
||||
/// Event name for when an experiment is timeout from being STANDBY. It is default to
|
||||
/// `TimeoutExperimentEventName` and can be overridden. If experiment payload has a valid string
|
||||
/// of this field, always use experiment payload.
|
||||
@property(nonatomic, copy) NSString *timeoutExperimentEventName;
|
||||
|
||||
/// Event name when an experiment is expired when it reaches the end of its TTL.
|
||||
/// It is default to `ExpireExperimentEventName` and can be overridden. If experiment payload has a
|
||||
/// valid string of this field, always use experiment payload.
|
||||
@property(nonatomic, copy) NSString *expireExperimentEventName;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
16
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Public/FirebaseABTesting/FirebaseABTesting.h
generated
Executable file
16
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Public/FirebaseABTesting/FirebaseABTesting.h
generated
Executable file
@ -0,0 +1,16 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import "FIRExperimentController.h"
|
||||
#import "FIRLifecycleEvents.h"
|
||||
18
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Resources/PrivacyInfo.xcprivacy
generated
Normal file
18
Pods/FirebaseABTesting/FirebaseABTesting/Sources/Resources/PrivacyInfo.xcprivacy
generated
Normal file
@ -0,0 +1,18 @@
|
||||
<?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>NSPrivacyTracking</key>
|
||||
<false/>
|
||||
<key>NSPrivacyTrackingDomains</key>
|
||||
<array>
|
||||
</array>
|
||||
<key>NSPrivacyCollectedDataTypes</key>
|
||||
<array>
|
||||
</array>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
156
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRAppInternal.h
generated
Normal file
156
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRAppInternal.h
generated
Normal file
@ -0,0 +1,156 @@
|
||||
/*
|
||||
* Copyright 2017 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <FirebaseCore/FIRApp.h>
|
||||
|
||||
@class FIRComponentContainer;
|
||||
@class FIRHeartbeatLogger;
|
||||
@protocol FIRLibrary;
|
||||
|
||||
/**
|
||||
* The internal interface to `FirebaseApp`. This is meant for first-party integrators, who need to
|
||||
* receive `FirebaseApp` notifications, log info about the success or failure of their
|
||||
* configuration, and access other internal functionality of `FirebaseApp`.
|
||||
*/
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, FIRConfigType) {
|
||||
FIRConfigTypeCore = 1,
|
||||
FIRConfigTypeSDK = 2,
|
||||
};
|
||||
|
||||
extern NSString *const kFIRDefaultAppName;
|
||||
extern NSString *const kFIRAppReadyToConfigureSDKNotification;
|
||||
extern NSString *const kFIRAppDeleteNotification;
|
||||
extern NSString *const kFIRAppIsDefaultAppKey;
|
||||
extern NSString *const kFIRAppNameKey;
|
||||
extern NSString *const kFIRGoogleAppIDKey;
|
||||
extern NSString *const kFirebaseCoreErrorDomain;
|
||||
|
||||
/**
|
||||
* The format string for the `UserDefaults` key used for storing the data collection enabled flag.
|
||||
* This includes formatting to append the `FirebaseApp`'s name.
|
||||
*/
|
||||
extern NSString *const kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat;
|
||||
|
||||
/**
|
||||
* The plist key used for storing the data collection enabled flag.
|
||||
*/
|
||||
extern NSString *const kFIRGlobalAppDataCollectionEnabledPlistKey;
|
||||
|
||||
/** @var FirebaseAuthStateDidChangeInternalNotification
|
||||
@brief The name of the @c NotificationCenter notification which is posted when the auth state
|
||||
changes (e.g. a new token has been produced, a user logs in or out). The object parameter of
|
||||
the notification is a dictionary possibly containing the key:
|
||||
@c FirebaseAuthStateDidChangeInternalNotificationTokenKey (the new access token.) If it does not
|
||||
contain this key it indicates a sign-out event took place.
|
||||
*/
|
||||
extern NSString *const FIRAuthStateDidChangeInternalNotification;
|
||||
|
||||
/** @var FirebaseAuthStateDidChangeInternalNotificationTokenKey
|
||||
@brief A key present in the dictionary object parameter of the
|
||||
@c FirebaseAuthStateDidChangeInternalNotification notification. The value associated with this
|
||||
key will contain the new access token.
|
||||
*/
|
||||
extern NSString *const FIRAuthStateDidChangeInternalNotificationTokenKey;
|
||||
|
||||
/** @var FirebaseAuthStateDidChangeInternalNotificationAppKey
|
||||
@brief A key present in the dictionary object parameter of the
|
||||
@c FirebaseAuthStateDidChangeInternalNotification notification. The value associated with this
|
||||
key will contain the FirebaseApp associated with the auth instance.
|
||||
*/
|
||||
extern NSString *const FIRAuthStateDidChangeInternalNotificationAppKey;
|
||||
|
||||
/** @var FirebaseAuthStateDidChangeInternalNotificationUIDKey
|
||||
@brief A key present in the dictionary object parameter of the
|
||||
@c FirebaseAuthStateDidChangeInternalNotification notification. The value associated with this
|
||||
key will contain the new user's UID (or nil if there is no longer a user signed in).
|
||||
*/
|
||||
extern NSString *const FIRAuthStateDidChangeInternalNotificationUIDKey;
|
||||
|
||||
@interface FIRApp ()
|
||||
|
||||
/**
|
||||
* A flag indicating if this is the default app (has the default app name).
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL isDefaultApp;
|
||||
|
||||
/**
|
||||
* The container of interop SDKs for this app.
|
||||
*/
|
||||
@property(nonatomic) FIRComponentContainer *container;
|
||||
|
||||
/**
|
||||
* The heartbeat logger associated with this app.
|
||||
*
|
||||
* Firebase apps have a 1:1 relationship with heartbeat loggers.
|
||||
*/
|
||||
@property(readonly) FIRHeartbeatLogger *heartbeatLogger;
|
||||
|
||||
/**
|
||||
* Checks if the default app is configured without trying to configure it.
|
||||
*/
|
||||
+ (BOOL)isDefaultAppConfigured;
|
||||
|
||||
/**
|
||||
* Registers a given third-party library with the given version number to be reported for
|
||||
* analytics.
|
||||
*
|
||||
* @param name Name of the library.
|
||||
* @param version Version of the library.
|
||||
*/
|
||||
+ (void)registerLibrary:(nonnull NSString *)name withVersion:(nonnull NSString *)version;
|
||||
|
||||
/**
|
||||
* Registers a given internal library to be reported for analytics.
|
||||
*
|
||||
* @param library Optional parameter for component registration.
|
||||
* @param name Name of the library.
|
||||
*/
|
||||
+ (void)registerInternalLibrary:(nonnull Class<FIRLibrary>)library
|
||||
withName:(nonnull NSString *)name;
|
||||
|
||||
/**
|
||||
* Registers a given internal library with the given version number to be reported for
|
||||
* analytics. This should only be used for non-Firebase libraries that have their own versioning
|
||||
* scheme.
|
||||
*
|
||||
* @param library Optional parameter for component registration.
|
||||
* @param name Name of the library.
|
||||
* @param version Version of the library.
|
||||
*/
|
||||
+ (void)registerInternalLibrary:(nonnull Class<FIRLibrary>)library
|
||||
withName:(nonnull NSString *)name
|
||||
withVersion:(nonnull NSString *)version;
|
||||
|
||||
/**
|
||||
* A concatenated string representing all the third-party libraries and version numbers.
|
||||
*/
|
||||
+ (NSString *)firebaseUserAgent;
|
||||
|
||||
/**
|
||||
* Can be used by the unit tests in each SDK to reset `FirebaseApp`. This method is thread unsafe.
|
||||
*/
|
||||
+ (void)resetApps;
|
||||
|
||||
/**
|
||||
* Can be used by the unit tests in each SDK to set customized options.
|
||||
*/
|
||||
- (instancetype)initInstanceWithName:(NSString *)name options:(FIROptions *)options;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
84
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRComponent.h
generated
Normal file
84
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRComponent.h
generated
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2018 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class FIRApp;
|
||||
@class FIRComponentContainer;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// Provides a system to clean up cached instances returned from the component system.
|
||||
NS_SWIFT_NAME(ComponentLifecycleMaintainer)
|
||||
@protocol FIRComponentLifecycleMaintainer
|
||||
/// The associated app will be deleted, clean up any resources as they are about to be deallocated.
|
||||
- (void)appWillBeDeleted:(FIRApp *)app;
|
||||
@end
|
||||
|
||||
typedef _Nullable id (^FIRComponentCreationBlock)(FIRComponentContainer *container,
|
||||
BOOL *isCacheable)
|
||||
NS_SWIFT_NAME(ComponentCreationBlock);
|
||||
|
||||
/// Describes the timing of instantiation. Note: new components should default to lazy unless there
|
||||
/// is a strong reason to be eager.
|
||||
typedef NS_ENUM(NSInteger, FIRInstantiationTiming) {
|
||||
FIRInstantiationTimingLazy,
|
||||
FIRInstantiationTimingAlwaysEager,
|
||||
FIRInstantiationTimingEagerInDefaultApp
|
||||
} NS_SWIFT_NAME(InstantiationTiming);
|
||||
|
||||
/// A component that can be used from other Firebase SDKs.
|
||||
NS_SWIFT_NAME(Component)
|
||||
@interface FIRComponent : NSObject
|
||||
|
||||
/// The protocol describing functionality provided from the `Component`.
|
||||
@property(nonatomic, strong, readonly) Protocol *protocol;
|
||||
|
||||
/// The timing of instantiation.
|
||||
@property(nonatomic, readonly) FIRInstantiationTiming instantiationTiming;
|
||||
|
||||
/// A block to instantiate an instance of the component with the appropriate dependencies.
|
||||
@property(nonatomic, copy, readonly) FIRComponentCreationBlock creationBlock;
|
||||
|
||||
// There's an issue with long NS_SWIFT_NAMES that causes compilation to fail, disable clang-format
|
||||
// for the next two methods.
|
||||
// clang-format off
|
||||
|
||||
/// Creates a component with no dependencies that will be lazily initialized.
|
||||
+ (instancetype)componentWithProtocol:(Protocol *)protocol
|
||||
creationBlock:(FIRComponentCreationBlock)creationBlock
|
||||
NS_SWIFT_NAME(init(_:creationBlock:));
|
||||
|
||||
/// Creates a component to be registered with the component container.
|
||||
///
|
||||
/// @param protocol - The protocol describing functionality provided by the component.
|
||||
/// @param instantiationTiming - When the component should be initialized. Use .lazy unless there's
|
||||
/// a good reason to be instantiated earlier.
|
||||
/// @param creationBlock - A block to instantiate the component with a container, and if
|
||||
/// @return A component that can be registered with the component container.
|
||||
+ (instancetype)componentWithProtocol:(Protocol *)protocol
|
||||
instantiationTiming:(FIRInstantiationTiming)instantiationTiming
|
||||
creationBlock:(FIRComponentCreationBlock)creationBlock
|
||||
NS_SWIFT_NAME(init(_:instantiationTiming:creationBlock:));
|
||||
|
||||
// clang-format on
|
||||
|
||||
/// Unavailable.
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
45
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRComponentContainer.h
generated
Normal file
45
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRComponentContainer.h
generated
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2018 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// A type-safe macro to retrieve a component from a container. This should be used to retrieve
|
||||
/// components instead of using the container directly.
|
||||
#define FIR_COMPONENT(type, container) \
|
||||
[FIRComponentType<id<type>> instanceForProtocol:@protocol(type) inContainer:container]
|
||||
|
||||
@class FIRApp;
|
||||
|
||||
/// A container that holds different components that are registered via the
|
||||
/// `registerAsComponentRegistrant` call. These classes should conform to `ComponentRegistrant`
|
||||
/// in order to properly register components for Core.
|
||||
NS_SWIFT_NAME(FirebaseComponentContainer)
|
||||
@interface FIRComponentContainer : NSObject
|
||||
|
||||
/// A weak reference to the app that an instance of the container belongs to.
|
||||
@property(nonatomic, weak, readonly) FIRApp *app;
|
||||
|
||||
// TODO: See if we can get improved type safety here.
|
||||
/// A Swift only API for fetching an instance since the top macro isn't available.
|
||||
- (nullable id)__instanceForProtocol:(Protocol *)protocol NS_SWIFT_NAME(instance(for:));
|
||||
|
||||
/// Unavailable. Use the `container` property on `FirebaseApp`.
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
35
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRComponentType.h
generated
Normal file
35
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRComponentType.h
generated
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2018 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class FIRComponentContainer;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// Do not use directly. A placeholder type in order to provide a macro that will warn users of
|
||||
/// mis-matched protocols.
|
||||
NS_SWIFT_NAME(ComponentType)
|
||||
@interface FIRComponentType<__covariant T> : NSObject
|
||||
|
||||
/// Do not use directly. A factory method to retrieve an instance that provides a specific
|
||||
/// functionality.
|
||||
+ (nullable T)instanceForProtocol:(Protocol *)protocol
|
||||
inContainer:(FIRComponentContainer *)container;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
90
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRHeartbeatLogger.h
generated
Normal file
90
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRHeartbeatLogger.h
generated
Normal file
@ -0,0 +1,90 @@
|
||||
// Copyright 2021 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
#ifndef FIREBASE_BUILD_CMAKE
|
||||
@class FIRHeartbeatsPayload;
|
||||
#endif // FIREBASE_BUILD_CMAKE
|
||||
|
||||
/// Enum representing different daily heartbeat codes.
|
||||
/// This enum is only used by clients using platform logging V1. This is because
|
||||
/// the V1 payload only supports a single daily heartbeat.
|
||||
typedef NS_ENUM(NSInteger, FIRDailyHeartbeatCode) {
|
||||
/// Represents the absence of a daily heartbeat.
|
||||
FIRDailyHeartbeatCodeNone = 0,
|
||||
/// Represents the presence of a daily heartbeat.
|
||||
FIRDailyHeartbeatCodeSome = 2,
|
||||
};
|
||||
|
||||
@protocol FIRHeartbeatLoggerProtocol <NSObject>
|
||||
|
||||
/// Asynchronously logs a heartbeat.
|
||||
- (void)log;
|
||||
|
||||
#ifndef FIREBASE_BUILD_CMAKE
|
||||
/// Return the headerValue for the HeartbeatLogger.
|
||||
- (NSString *_Nullable)headerValue;
|
||||
#endif // FIREBASE_BUILD_CMAKE
|
||||
|
||||
/// Gets the heartbeat code for today.
|
||||
- (FIRDailyHeartbeatCode)heartbeatCodeForToday;
|
||||
|
||||
@end
|
||||
|
||||
#ifndef FIREBASE_BUILD_CMAKE
|
||||
/// Returns a nullable string header value from a given heartbeats payload.
|
||||
///
|
||||
/// This API returns `nil` when the given heartbeats payload is considered empty.
|
||||
///
|
||||
/// @param heartbeatsPayload The heartbeats payload.
|
||||
NSString *_Nullable FIRHeaderValueFromHeartbeatsPayload(FIRHeartbeatsPayload *heartbeatsPayload);
|
||||
#endif // FIREBASE_BUILD_CMAKE
|
||||
|
||||
/// A thread safe, synchronized object that logs and flushes platform logging info.
|
||||
@interface FIRHeartbeatLogger : NSObject <FIRHeartbeatLoggerProtocol>
|
||||
|
||||
/// Designated initializer.
|
||||
///
|
||||
/// @param appID The app ID that this heartbeat logger corresponds to.
|
||||
- (instancetype)initWithAppID:(NSString *)appID;
|
||||
|
||||
/// Asynchronously logs a new heartbeat corresponding to the Firebase User Agent, if needed.
|
||||
///
|
||||
/// @note This API is thread-safe.
|
||||
- (void)log;
|
||||
|
||||
#ifndef FIREBASE_BUILD_CMAKE
|
||||
/// Flushes heartbeats from storage into a structured payload of heartbeats.
|
||||
///
|
||||
/// This API is for clients using platform logging V2.
|
||||
///
|
||||
/// @note This API is thread-safe.
|
||||
/// @return A payload of heartbeats.
|
||||
- (FIRHeartbeatsPayload *)flushHeartbeatsIntoPayload;
|
||||
#endif // FIREBASE_BUILD_CMAKE
|
||||
|
||||
/// Gets today's corresponding heartbeat code.
|
||||
///
|
||||
/// This API is for clients using platform logging V1.
|
||||
///
|
||||
/// @note This API is thread-safe.
|
||||
/// @return Heartbeat code indicating whether or not there is an unsent global heartbeat.
|
||||
- (FIRDailyHeartbeatCode)heartbeatCodeForToday;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
39
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRLibrary.h
generated
Normal file
39
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRLibrary.h
generated
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2018 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FIRLibrary_h
|
||||
#define FIRLibrary_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class FIRApp;
|
||||
@class FIRComponent;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// Provide an interface to register a library for userAgent logging and availability to others.
|
||||
NS_SWIFT_NAME(Library)
|
||||
@protocol FIRLibrary
|
||||
|
||||
/// Returns one or more Components that will be registered in
|
||||
/// FirebaseApp and participate in dependency resolution and injection.
|
||||
+ (NSArray<FIRComponent *> *)componentsToRegister;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif /* FIRLibrary_h */
|
||||
148
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRLogger.h
generated
Normal file
148
Pods/FirebaseABTesting/FirebaseCore/Extension/FIRLogger.h
generated
Normal file
@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Copyright 2017 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <FirebaseCore/FIRLoggerLevel.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* The Firebase services used in Firebase logger.
|
||||
*/
|
||||
typedef NSString *const FIRLoggerService;
|
||||
|
||||
extern NSString *const kFIRLoggerAnalytics;
|
||||
extern NSString *const kFIRLoggerCrash;
|
||||
extern NSString *const kFIRLoggerCore;
|
||||
extern NSString *const kFIRLoggerRemoteConfig;
|
||||
|
||||
/**
|
||||
* The key used to store the logger's error count.
|
||||
*/
|
||||
extern NSString *const kFIRLoggerErrorCountKey;
|
||||
|
||||
/**
|
||||
* The key used to store the logger's warning count.
|
||||
*/
|
||||
extern NSString *const kFIRLoggerWarningCountKey;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/**
|
||||
* Enables or disables Analytics debug mode.
|
||||
* If set to true, the logging level for Analytics will be set to FirebaseLoggerLevelDebug.
|
||||
* Enabling the debug mode has no effect if the app is running from App Store.
|
||||
* (required) analytics debug mode flag.
|
||||
*/
|
||||
void FIRSetAnalyticsDebugMode(BOOL analyticsDebugMode);
|
||||
|
||||
/**
|
||||
* Gets the current FIRLoggerLevel.
|
||||
*/
|
||||
FIRLoggerLevel FIRGetLoggerLevel(void);
|
||||
|
||||
/**
|
||||
* Changes the default logging level of FirebaseLoggerLevelNotice to a user-specified level.
|
||||
* The default level cannot be set above FirebaseLoggerLevelNotice if the app is running from App
|
||||
* Store. (required) log level (one of the FirebaseLoggerLevel enum values).
|
||||
*/
|
||||
void FIRSetLoggerLevel(FIRLoggerLevel loggerLevel);
|
||||
|
||||
/**
|
||||
* Checks if the specified logger level is loggable given the current settings.
|
||||
* (required) log level (one of the FirebaseLoggerLevel enum values).
|
||||
* (required) whether or not this function is called from the Analytics component.
|
||||
*/
|
||||
BOOL FIRIsLoggableLevel(FIRLoggerLevel loggerLevel, BOOL analyticsComponent);
|
||||
|
||||
/**
|
||||
* Logs a message to the Xcode console and the device log. If running from AppStore, will
|
||||
* not log any messages with a level higher than FirebaseLoggerLevelNotice to avoid log spamming.
|
||||
* (required) log level (one of the FirebaseLoggerLevel enum values).
|
||||
* (required) service name of type FirebaseLoggerService.
|
||||
* (required) message code starting with "I-" which means iOS, followed by a capitalized
|
||||
* three-character service identifier and a six digit integer message ID that is unique
|
||||
* within the service.
|
||||
* An example of the message code is @"I-COR000001".
|
||||
* (required) message string which can be a format string.
|
||||
* (optional) variable arguments list obtained from calling va_start, used when message is a format
|
||||
* string.
|
||||
*/
|
||||
extern void FIRLogBasic(FIRLoggerLevel level,
|
||||
NSString *category,
|
||||
NSString *messageCode,
|
||||
NSString *message,
|
||||
// On 64-bit simulators, va_list is not a pointer, so cannot be marked nullable
|
||||
// See: http://stackoverflow.com/q/29095469
|
||||
#if __LP64__ && TARGET_OS_SIMULATOR || TARGET_OS_OSX
|
||||
va_list args_ptr
|
||||
#else
|
||||
va_list _Nullable args_ptr
|
||||
#endif
|
||||
);
|
||||
|
||||
/**
|
||||
* The following functions accept the following parameters in order:
|
||||
* (required) service name of type FirebaseLoggerService.
|
||||
* (required) message code starting from "I-" which means iOS, followed by a capitalized
|
||||
* three-character service identifier and a six digit integer message ID that is unique
|
||||
* within the service.
|
||||
* An example of the message code is @"I-COR000001".
|
||||
* See go/firebase-log-proposal for details.
|
||||
* (required) message string which can be a format string.
|
||||
* (optional) the list of arguments to substitute into the format string.
|
||||
* Example usage:
|
||||
* FirebaseLogError(kFirebaseLoggerCore, @"I-COR000001", @"Configuration of %@ failed.", app.name);
|
||||
*/
|
||||
extern void FIRLogError(NSString *category, NSString *messageCode, NSString *message, ...)
|
||||
NS_FORMAT_FUNCTION(3, 4);
|
||||
extern void FIRLogWarning(NSString *category, NSString *messageCode, NSString *message, ...)
|
||||
NS_FORMAT_FUNCTION(3, 4);
|
||||
extern void FIRLogNotice(NSString *category, NSString *messageCode, NSString *message, ...)
|
||||
NS_FORMAT_FUNCTION(3, 4);
|
||||
extern void FIRLogInfo(NSString *category, NSString *messageCode, NSString *message, ...)
|
||||
NS_FORMAT_FUNCTION(3, 4);
|
||||
extern void FIRLogDebug(NSString *category, NSString *messageCode, NSString *message, ...)
|
||||
NS_FORMAT_FUNCTION(3, 4);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
||||
NS_SWIFT_NAME(FirebaseLogger)
|
||||
@interface FIRLoggerWrapper : NSObject
|
||||
|
||||
/// Logs a given message at a given log level.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - level: The log level to use (defined by `FirebaseLoggerLevel` enum values).
|
||||
/// - service: The service name of type `FirebaseLoggerService`.
|
||||
/// - code: The message code. Starting with "I-" which means iOS, followed by a capitalized
|
||||
/// three-character service identifier and a six digit integer message ID that is unique within
|
||||
/// the service. An example of the message code is @"I-COR000001".
|
||||
/// - message: Formatted string to be used as the log's message.
|
||||
+ (void)logWithLevel:(FIRLoggerLevel)level
|
||||
service:(NSString *)category
|
||||
code:(NSString *)code
|
||||
message:(NSString *)message
|
||||
__attribute__((__swift_name__("log(level:service:code:message:)")));
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
106
Pods/FirebaseABTesting/FirebaseCore/Extension/FIROptionsInternal.h
generated
Normal file
106
Pods/FirebaseABTesting/FirebaseCore/Extension/FIROptionsInternal.h
generated
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright 2017 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <FirebaseCore/FIROptions.h>
|
||||
|
||||
/**
|
||||
* Keys for the strings in the plist file.
|
||||
*/
|
||||
extern NSString *const kFIRAPIKey;
|
||||
extern NSString *const kFIRTrackingID;
|
||||
extern NSString *const kFIRGoogleAppID;
|
||||
extern NSString *const kFIRClientID;
|
||||
extern NSString *const kFIRGCMSenderID;
|
||||
extern NSString *const kFIRAndroidClientID;
|
||||
extern NSString *const kFIRDatabaseURL;
|
||||
extern NSString *const kFIRStorageBucket;
|
||||
extern NSString *const kFIRBundleID;
|
||||
extern NSString *const kFIRProjectID;
|
||||
|
||||
/**
|
||||
* Keys for the plist file name
|
||||
*/
|
||||
extern NSString *const kServiceInfoFileName;
|
||||
|
||||
extern NSString *const kServiceInfoFileType;
|
||||
|
||||
/**
|
||||
* This header file exposes the initialization of FirebaseOptions to internal use.
|
||||
*/
|
||||
@interface FIROptions ()
|
||||
|
||||
/**
|
||||
* `resetDefaultOptions` and `initInternalWithOptionsDictionary` are exposed only for unit tests.
|
||||
*/
|
||||
+ (void)resetDefaultOptions;
|
||||
|
||||
/**
|
||||
* Initializes the options with dictionary. The above strings are the keys of the dictionary.
|
||||
* This is the designated initializer.
|
||||
*/
|
||||
- (instancetype)initInternalWithOptionsDictionary:(NSDictionary *)serviceInfoDictionary
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* `defaultOptions` and `defaultOptionsDictionary` are exposed in order to be used in FirebaseApp
|
||||
* and other first party services.
|
||||
*/
|
||||
+ (FIROptions *)defaultOptions;
|
||||
|
||||
+ (NSDictionary *)defaultOptionsDictionary;
|
||||
|
||||
/**
|
||||
* Indicates whether or not Analytics collection was explicitly enabled via a plist flag or at
|
||||
* runtime.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL isAnalyticsCollectionExplicitlySet;
|
||||
|
||||
/**
|
||||
* Whether or not Analytics Collection was enabled. Analytics Collection is enabled unless
|
||||
* explicitly disabled in GoogleService-Info.plist.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL isAnalyticsCollectionEnabled;
|
||||
|
||||
/**
|
||||
* Whether or not Analytics Collection was completely disabled. If true, then
|
||||
* isAnalyticsCollectionEnabled will be false.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL isAnalyticsCollectionDeactivated;
|
||||
|
||||
/**
|
||||
* The version ID of the client library, e.g. @"1100000".
|
||||
*/
|
||||
@property(nonatomic, readonly, copy) NSString *libraryVersionID;
|
||||
|
||||
/**
|
||||
* The flag indicating whether this object was constructed with the values in the default plist
|
||||
* file.
|
||||
*/
|
||||
@property(nonatomic) BOOL usingOptionsFromDefaultPlist;
|
||||
|
||||
/**
|
||||
* Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in
|
||||
* GoogleService-Info.plist.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL isMeasurementEnabled;
|
||||
|
||||
/**
|
||||
* Whether or not editing is locked. This should occur after `FirebaseOptions` has been set on a
|
||||
* `FirebaseApp`.
|
||||
*/
|
||||
@property(nonatomic, getter=isEditingLocked) BOOL editingLocked;
|
||||
|
||||
@end
|
||||
24
Pods/FirebaseABTesting/FirebaseCore/Extension/FirebaseCoreInternal.h
generated
Normal file
24
Pods/FirebaseABTesting/FirebaseCore/Extension/FirebaseCoreInternal.h
generated
Normal file
@ -0,0 +1,24 @@
|
||||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
@import FirebaseCore;
|
||||
|
||||
#import "FIRAppInternal.h"
|
||||
#import "FIRComponent.h"
|
||||
#import "FIRComponentContainer.h"
|
||||
#import "FIRComponentType.h"
|
||||
#import "FIRHeartbeatLogger.h"
|
||||
#import "FIRLibrary.h"
|
||||
#import "FIRLogger.h"
|
||||
#import "FIROptionsInternal.h"
|
||||
68
Pods/FirebaseABTesting/Interop/Analytics/Public/FIRAnalyticsInterop.h
generated
Normal file
68
Pods/FirebaseABTesting/Interop/Analytics/Public/FIRAnalyticsInterop.h
generated
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright 2018 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol FIRAnalyticsInteropListener;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// Block typedef callback parameter to `getUserProperties(with:)`.
|
||||
typedef void (^FIRAInteropUserPropertiesCallback)(NSDictionary<NSString *, id> *userProperties)
|
||||
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
|
||||
|
||||
/// Connector for bridging communication between Firebase SDKs and FirebaseAnalytics APIs.
|
||||
@protocol FIRAnalyticsInterop
|
||||
|
||||
/// Sets user property when trigger event is logged. This API is only available in the SDK.
|
||||
- (void)setConditionalUserProperty:(NSDictionary<NSString *, id> *)conditionalUserProperty;
|
||||
|
||||
/// Clears user property if set.
|
||||
- (void)clearConditionalUserProperty:(NSString *)userPropertyName
|
||||
forOrigin:(NSString *)origin
|
||||
clearEventName:(NSString *)clearEventName
|
||||
clearEventParameters:(NSDictionary<NSString *, NSString *> *)clearEventParameters;
|
||||
|
||||
/// Returns currently set user properties.
|
||||
- (NSArray<NSDictionary<NSString *, NSString *> *> *)conditionalUserProperties:(NSString *)origin
|
||||
propertyNamePrefix:
|
||||
(NSString *)propertyNamePrefix;
|
||||
|
||||
/// Returns the maximum number of user properties.
|
||||
- (NSInteger)maxUserProperties:(NSString *)origin;
|
||||
|
||||
/// Returns the user properties to a callback function.
|
||||
- (void)getUserPropertiesWithCallback:
|
||||
(void (^)(NSDictionary<NSString *, id> *userProperties))callback;
|
||||
|
||||
/// Logs events.
|
||||
- (void)logEventWithOrigin:(NSString *)origin
|
||||
name:(NSString *)name
|
||||
parameters:(nullable NSDictionary<NSString *, id> *)parameters;
|
||||
|
||||
/// Sets user property.
|
||||
- (void)setUserPropertyWithOrigin:(NSString *)origin name:(NSString *)name value:(id)value;
|
||||
|
||||
/// Registers an Analytics listener for the given origin.
|
||||
- (void)registerAnalyticsListener:(id<FIRAnalyticsInteropListener>)listener
|
||||
withOrigin:(NSString *)origin;
|
||||
|
||||
/// Unregisters an Analytics listener for the given origin.
|
||||
- (void)unregisterAnalyticsListenerWithOrigin:(NSString *)origin;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
24
Pods/FirebaseABTesting/Interop/Analytics/Public/FIRAnalyticsInteropListener.h
generated
Normal file
24
Pods/FirebaseABTesting/Interop/Analytics/Public/FIRAnalyticsInteropListener.h
generated
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2019 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/// Handles events and messages from Analytics.
|
||||
@protocol FIRAnalyticsInteropListener <NSObject>
|
||||
|
||||
/// Triggers when an Analytics event happens for the registered origin with
|
||||
/// FirebaseAnalyticsInterop`s `registerAnalyticsListener(_:withOrigin:)`.
|
||||
- (void)messageTriggered:(NSString *)name parameters:(NSDictionary *)parameters;
|
||||
|
||||
@end
|
||||
28
Pods/FirebaseABTesting/Interop/Analytics/Public/FIRInteropEventNames.h
generated
Normal file
28
Pods/FirebaseABTesting/Interop/Analytics/Public/FIRInteropEventNames.h
generated
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2018 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/// @file FIRInteropEventNames.h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/// Notification open event name.
|
||||
static NSString *const kFIRIEventNotificationOpen = @"_no";
|
||||
|
||||
/// Notification foreground event name.
|
||||
static NSString *const kFIRIEventNotificationForeground = @"_nf";
|
||||
|
||||
/// Campaign event name.
|
||||
static NSString *const kFIRIEventFirebaseCampaign = @"_cmp";
|
||||
73
Pods/FirebaseABTesting/Interop/Analytics/Public/FIRInteropParameterNames.h
generated
Normal file
73
Pods/FirebaseABTesting/Interop/Analytics/Public/FIRInteropParameterNames.h
generated
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2018 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/// @file FIRInteropParameterNames.h
|
||||
///
|
||||
/// Predefined event parameter names used by Firebase. This file is a subset of the
|
||||
/// FirebaseAnalytics FIRParameterNames.h public header.
|
||||
///
|
||||
/// The origin of your traffic, such as an Ad network (for example, google) or partner (urban
|
||||
/// airship). Identify the advertiser, site, publication, etc. that is sending traffic to your
|
||||
/// property. Highly recommended (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// kFIRParameterSource : "InMobi",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRIParameterSource NS_SWIFT_NAME(AnalyticsParameterSource) = @"source";
|
||||
|
||||
/// The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended
|
||||
/// (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// kFIRParameterMedium : "email",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRIParameterMedium NS_SWIFT_NAME(AnalyticsParameterMedium) = @"medium";
|
||||
|
||||
/// The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro to
|
||||
/// capture campaign information, otherwise can be populated by developer. Highly Recommended
|
||||
/// (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// kFIRParameterCampaign : "winter_promotion",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRIParameterCampaign NS_SWIFT_NAME(AnalyticsParameterCampaign) =
|
||||
@"campaign";
|
||||
|
||||
/// Message identifier.
|
||||
static NSString *const kFIRIParameterMessageIdentifier = @"_nmid";
|
||||
|
||||
/// Message name.
|
||||
static NSString *const kFIRIParameterMessageName = @"_nmn";
|
||||
|
||||
/// Message send time.
|
||||
static NSString *const kFIRIParameterMessageTime = @"_nmt";
|
||||
|
||||
/// Message device time.
|
||||
static NSString *const kFIRIParameterMessageDeviceTime = @"_ndt";
|
||||
|
||||
/// Topic message.
|
||||
static NSString *const kFIRIParameterTopic = @"_nt";
|
||||
|
||||
/// Stores the message_id of the last notification opened by the app.
|
||||
static NSString *const kFIRIUserPropertyLastNotification = @"_ln";
|
||||
202
Pods/FirebaseABTesting/LICENSE
generated
Normal file
202
Pods/FirebaseABTesting/LICENSE
generated
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
302
Pods/FirebaseABTesting/README.md
generated
Normal file
302
Pods/FirebaseABTesting/README.md
generated
Normal file
@ -0,0 +1,302 @@
|
||||
<p align="center">
|
||||
<a href="https://cocoapods.org/pods/Firebase">
|
||||
<img src="https://img.shields.io/github/v/release/Firebase/firebase-ios-sdk?style=flat&label=CocoaPods"/>
|
||||
</a>
|
||||
<a href="https://swiftpackageindex.com/firebase/firebase-ios-sdk">
|
||||
<img src="https://img.shields.io/github/v/release/Firebase/firebase-ios-sdk?style=flat&label=Swift%20Package%20Index&color=red"/>
|
||||
</a>
|
||||
<a href="https://cocoapods.org/pods/Firebase">
|
||||
<img src="https://img.shields.io/github/license/Firebase/firebase-ios-sdk?style=flat"/>
|
||||
</a><br/>
|
||||
<a href="https://swiftpackageindex.com/firebase/firebase-ios-sdk">
|
||||
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffirebase%2Ffirebase-ios-sdk%2Fbadge%3Ftype%3Dplatforms"/>
|
||||
</a>
|
||||
<a href="https://swiftpackageindex.com/firebase/firebase-ios-sdk">
|
||||
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffirebase%2Ffirebase-ios-sdk%2Fbadge%3Ftype%3Dswift-versions"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# Firebase Apple Open Source Development
|
||||
|
||||
This repository contains the source code for all Apple platform Firebase SDKs except FirebaseAnalytics.
|
||||
|
||||
Firebase is an app development platform with tools to help you build, grow, and
|
||||
monetize your app. More information about Firebase can be found on the
|
||||
[official Firebase website](https://firebase.google.com).
|
||||
|
||||
## Installation
|
||||
|
||||
See the subsections below for details about the different installation methods. Where
|
||||
available, it's recommended to install any libraries with a `Swift` suffix to get the
|
||||
best experience when writing your app in Swift.
|
||||
|
||||
1. [Standard pod install](#standard-pod-install)
|
||||
2. [Swift Package Manager](#swift-package-manager)
|
||||
3. [Installing from the GitHub repo](#installing-from-github)
|
||||
4. [Experimental Carthage](#carthage-ios-only)
|
||||
|
||||
### Standard pod install
|
||||
|
||||
For instructions on the standard pod install, visit:
|
||||
[https://firebase.google.com/docs/ios/setup](https://firebase.google.com/docs/ios/setup).
|
||||
|
||||
### Swift Package Manager
|
||||
|
||||
Instructions for [Swift Package Manager](https://swift.org/package-manager/) support can be
|
||||
found in the [SwiftPackageManager.md](SwiftPackageManager.md) Markdown file.
|
||||
|
||||
### Installing from GitHub
|
||||
|
||||
These instructions can be used to access the Firebase repo at other branches,
|
||||
tags, or commits.
|
||||
|
||||
#### Background
|
||||
|
||||
See [the Podfile Syntax Reference](https://guides.cocoapods.org/syntax/podfile.html#pod)
|
||||
for instructions and options about overriding pod source locations.
|
||||
|
||||
#### Accessing Firebase Source Snapshots
|
||||
|
||||
All official releases are tagged in this repo and available via CocoaPods. To access a local
|
||||
source snapshot or unreleased branch, use Podfile directives like the following:
|
||||
|
||||
To access FirebaseFirestore via a branch:
|
||||
```ruby
|
||||
pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'main'
|
||||
pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'main'
|
||||
```
|
||||
|
||||
To access FirebaseMessaging via a checked-out version of the firebase-ios-sdk repo:
|
||||
```ruby
|
||||
pod 'FirebaseCore', :path => '/path/to/firebase-ios-sdk'
|
||||
pod 'FirebaseMessaging', :path => '/path/to/firebase-ios-sdk'
|
||||
```
|
||||
|
||||
### Carthage (iOS only)
|
||||
|
||||
Instructions for the experimental Carthage distribution can be found at
|
||||
[Carthage.md](Carthage.md).
|
||||
|
||||
### Using Firebase from a Framework or a library
|
||||
|
||||
For details on using Firebase from a Framework or a library, refer to [firebase_in_libraries.md](docs/firebase_in_libraries.md).
|
||||
|
||||
## Development
|
||||
|
||||
To develop Firebase software in this repository, ensure that you have at least
|
||||
the following software:
|
||||
|
||||
* Xcode 15.2 (or later)
|
||||
|
||||
CocoaPods is still the canonical way to develop, but much of the repo now supports
|
||||
development with Swift Package Manager.
|
||||
|
||||
### CocoaPods
|
||||
|
||||
Install the following:
|
||||
* CocoaPods 1.12.0 (or later)
|
||||
* [CocoaPods generate](https://github.com/square/cocoapods-generate)
|
||||
|
||||
For the pod that you want to develop:
|
||||
|
||||
```ruby
|
||||
pod gen Firebase{name here}.podspec --local-sources=./ --auto-open --platforms=ios
|
||||
```
|
||||
|
||||
Note: If the CocoaPods cache is out of date, you may need to run
|
||||
`pod repo update` before the `pod gen` command.
|
||||
|
||||
Note: Set the `--platforms` option to `macos` or `tvos` to develop/test for
|
||||
those platforms. Since 10.2, Xcode does not properly handle multi-platform
|
||||
CocoaPods workspaces.
|
||||
|
||||
Firestore has a self-contained Xcode project. See
|
||||
[Firestore/README](Firestore/README.md) Markdown file.
|
||||
|
||||
#### Development for Catalyst
|
||||
* `pod gen {name here}.podspec --local-sources=./ --auto-open --platforms=ios`
|
||||
* Check the Mac box in the App-iOS Build Settings
|
||||
* Sign the App in the Settings Signing & Capabilities tab
|
||||
* Click Pods in the Project Manager
|
||||
* Add Signing to the iOS host app and unit test targets
|
||||
* Select the Unit-unit scheme
|
||||
* Run it to build and test
|
||||
|
||||
Alternatively, disable signing in each target:
|
||||
* Go to Build Settings tab
|
||||
* Click `+`
|
||||
* Select `Add User-Defined Setting`
|
||||
* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO`
|
||||
|
||||
### Swift Package Manager
|
||||
* To enable test schemes: `./scripts/setup_spm_tests.sh`
|
||||
* `open Package.swift` or double click `Package.swift` in Finder.
|
||||
* Xcode will open the project
|
||||
* Choose a scheme for a library to build or test suite to run
|
||||
* Choose a target platform by selecting the run destination along with the scheme
|
||||
|
||||
### Adding a New Firebase Pod
|
||||
|
||||
Refer to [AddNewPod](AddNewPod.md) Markdown file for details.
|
||||
|
||||
### Managing Headers and Imports
|
||||
|
||||
For information about managing headers and imports, see [HeadersImports](HeadersImports.md) Markdown file.
|
||||
|
||||
### Code Formatting
|
||||
|
||||
To ensure that the code is formatted consistently, run the script
|
||||
[./scripts/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/main/scripts/check.sh)
|
||||
before creating a pull request (PR).
|
||||
|
||||
GitHub Actions will verify that any code changes are done in a style-compliant
|
||||
way. Install `clang-format` and `mint`:
|
||||
|
||||
```console
|
||||
brew install clang-format@18
|
||||
brew install mint
|
||||
```
|
||||
|
||||
### Running Unit Tests
|
||||
|
||||
Select a scheme and press Command-u to build a component and run its unit tests.
|
||||
|
||||
### Running Sample Apps
|
||||
To run the sample apps and integration tests, you'll need a valid
|
||||
`GoogleService-Info.plist
|
||||
` file. The Firebase Xcode project contains dummy plist
|
||||
files without real values, but they can be replaced with real plist files. To get your own
|
||||
`GoogleService-Info.plist` files:
|
||||
|
||||
1. Go to the [Firebase Console](https://console.firebase.google.com/)
|
||||
2. Create a new Firebase project, if you don't already have one
|
||||
3. For each sample app you want to test, create a new Firebase app with the sample app's bundle
|
||||
identifier (e.g., `com.google.Database-Example`)
|
||||
4. Download the resulting `GoogleService-Info.plist` and add it to the Xcode project.
|
||||
|
||||
### Coverage Report Generation
|
||||
|
||||
For coverage report generation instructions, see [scripts/code_coverage_report/README](scripts/code_coverage_report/README.md) Markdown file.
|
||||
|
||||
## Specific Component Instructions
|
||||
See the sections below for any special instructions for those components.
|
||||
|
||||
### Firebase Auth
|
||||
|
||||
For specific Firebase Auth development, refer to the [Auth Sample README](FirebaseAuth/Tests/Sample/README.md) for instructions about
|
||||
building and running the FirebaseAuth pod along with various samples and tests.
|
||||
|
||||
### Firebase Database
|
||||
|
||||
The Firebase Database Integration tests can be run against a locally running Database Emulator
|
||||
or against a production instance.
|
||||
|
||||
To run against a local emulator instance, invoke `./scripts/run_database_emulator.sh start` before
|
||||
running the integration test.
|
||||
|
||||
To run against a production instance, provide a valid `GoogleServices-Info.plist` and copy it to
|
||||
`FirebaseDatabase/Tests/Resources/GoogleService-Info.plist`. Your Security Rule must be set to
|
||||
[public](https://firebase.google.com/docs/database/security/quickstart) while your tests are
|
||||
running.
|
||||
|
||||
### Firebase Dynamic Links
|
||||
|
||||
Firebase Dynamic Links is **deprecated** and should not be used in new projects. The service will shut down on August 25, 2025.
|
||||
|
||||
Please see our [Dynamic Links Deprecation FAQ documentation](https://firebase.google.com/support/dynamic-links-faq) for more guidance.
|
||||
|
||||
### Firebase Performance Monitoring
|
||||
|
||||
For specific Firebase Performance Monitoring development, see
|
||||
[the Performance README](FirebasePerformance/README.md) for instructions about building the SDK
|
||||
and [the Performance TestApp README](FirebasePerformance/Tests/TestApp/README.md) for instructions about
|
||||
integrating Performance with the dev test App.
|
||||
|
||||
### Firebase Storage
|
||||
|
||||
To run the Storage Integration tests, follow the instructions in
|
||||
[StorageIntegration.swift](FirebaseStorage/Tests/Integration/StorageIntegration.swift).
|
||||
|
||||
#### Push Notifications
|
||||
|
||||
Push notifications can only be delivered to specially provisioned App IDs in the developer portal.
|
||||
In order to test receiving push notifications, you will need to:
|
||||
|
||||
1. Change the bundle identifier of the sample app to something you own in your Apple Developer
|
||||
account and enable that App ID for push notifications.
|
||||
2. You'll also need to
|
||||
[upload your APNs Provider Authentication Key or certificate to the
|
||||
Firebase Console](https://firebase.google.com/docs/cloud-messaging/ios/certs)
|
||||
at **Project Settings > Cloud Messaging > [Your Firebase App]**.
|
||||
3. Ensure your iOS device is added to your Apple Developer portal as a test device.
|
||||
|
||||
#### iOS Simulator
|
||||
|
||||
The iOS Simulator cannot register for remote notifications and will not receive push notifications.
|
||||
To receive push notifications, follow the steps above and run the app on a physical device.
|
||||
|
||||
### Vertex AI for Firebase
|
||||
|
||||
See the [Vertex AI for Firebase README](FirebaseVertexAI#development) for
|
||||
instructions about building and testing the SDK.
|
||||
|
||||
## Building with Firebase on Apple platforms
|
||||
|
||||
Firebase provides official beta support for macOS, Catalyst, and tvOS. visionOS and watchOS
|
||||
are community supported. Thanks to community contributions for many of the multi-platform PRs.
|
||||
|
||||
At this time, most of Firebase's products are available across Apple platforms. There are still
|
||||
a few gaps, especially on visionOS and watchOS. For details about the current support matrix, see
|
||||
[this chart](https://firebase.google.com/docs/ios/learn-more#firebase_library_support_by_platform)
|
||||
in Firebase's documentation.
|
||||
|
||||
### visionOS
|
||||
|
||||
Where supported, visionOS works as expected with the exception of Firestore via Swift Package
|
||||
Manager where it is required to use the source distribution.
|
||||
|
||||
To enable the Firestore source distribution, quit Xcode and open the desired
|
||||
project from the command line with the `FIREBASE_SOURCE_FIRESTORE` environment
|
||||
variable: `open --env FIREBASE_SOURCE_FIRESTORE /path/to/project.xcodeproj`.
|
||||
To go back to using the binary distribution of Firestore, quit Xcode and open
|
||||
Xcode like normal, without the environment variable.
|
||||
|
||||
### watchOS
|
||||
Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and
|
||||
work on watchOS. See the [Independent Watch App Sample](Example/watchOSSample).
|
||||
|
||||
Keep in mind that watchOS is not officially supported by Firebase. While we can catch basic unit
|
||||
test issues with GitHub Actions, there may be some changes where the SDK no longer works as expected
|
||||
on watchOS. If you encounter this, please
|
||||
[file an issue](https://github.com/firebase/firebase-ios-sdk/issues).
|
||||
|
||||
During app setup in the console, you may get to a step that mentions something like "Checking if the
|
||||
app has communicated with our servers". This relies on Analytics and will not work on watchOS.
|
||||
**It's safe to ignore the message and continue**, the rest of the SDKs will work as expected.
|
||||
|
||||
#### Additional Crashlytics Notes
|
||||
* watchOS has limited support. Due to watchOS restrictions, mach exceptions and signal crashes are
|
||||
not recorded. (Crashes in SwiftUI are generated as mach exceptions, so will not be recorded)
|
||||
|
||||
## Combine
|
||||
Thanks to contributions from the community, _FirebaseCombineSwift_ contains support for Apple's Combine
|
||||
framework. This module is currently under development and not yet supported for use in production
|
||||
environments. For more details, please refer to the [docs](FirebaseCombineSwift/README.md).
|
||||
|
||||
## Roadmap
|
||||
|
||||
See [Roadmap](ROADMAP.md) for more about the Firebase Apple SDK Open Source
|
||||
plans and directions.
|
||||
|
||||
## Contributing
|
||||
|
||||
See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase
|
||||
Apple SDK.
|
||||
|
||||
## License
|
||||
|
||||
The contents of this repository are licensed under the
|
||||
[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
Your use of Firebase is governed by the
|
||||
[Terms of Service for Firebase Services](https://firebase.google.com/terms/).
|
||||
107
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/Info.plist
generated
Normal file
107
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/Info.plist
generated
Normal file
@ -0,0 +1,107 @@
|
||||
<?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>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>FirebaseAnalytics.framework/FirebaseAnalytics</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>FirebaseAnalytics.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>FirebaseAnalytics.framework/Versions/A/FirebaseAnalytics</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_x86_64-maccatalyst</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>FirebaseAnalytics.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>maccatalyst</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>FirebaseAnalytics.framework/FirebaseAnalytics</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-arm64_x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>FirebaseAnalytics.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>FirebaseAnalytics.framework/FirebaseAnalytics</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>FirebaseAnalytics.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>FirebaseAnalytics.framework/FirebaseAnalytics</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>FirebaseAnalytics.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>FirebaseAnalytics.framework/Versions/A/FirebaseAnalytics</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>macos-arm64_x86_64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>FirebaseAnalytics.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>macos</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeDirectory
generated
Normal file
BIN
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeDirectory
generated
Normal file
Binary file not shown.
BIN
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeRequirements
generated
Normal file
BIN
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeRequirements
generated
Normal file
Binary file not shown.
BIN
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeRequirements-1
generated
Normal file
BIN
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeRequirements-1
generated
Normal file
Binary file not shown.
2068
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeResources
generated
Normal file
2068
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeResources
generated
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeSignature
generated
Normal file
BIN
Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/_CodeSignature/CodeSignature
generated
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,80 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "FIRAnalytics.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// Provides App Delegate handlers to be used in your App Delegate.
|
||||
///
|
||||
/// To save time integrating Firebase Analytics in an application, Firebase Analytics does not
|
||||
/// require delegation implementation from the AppDelegate if neither SwiftUI nor UIScene lifecycle
|
||||
/// is adopted. Instead this is automatically done by Firebase Analytics. Should you choose instead
|
||||
/// to delegate manually, you can turn off the App Delegate Proxy by adding
|
||||
/// FirebaseAppDelegateProxyEnabled into your app's Info.plist and setting it to boolean `NO`, and
|
||||
/// adding the methods in this category to corresponding delegation handlers.
|
||||
///
|
||||
/// To handle Universal Links, you must return `true` in
|
||||
/// `UIApplicationDelegate.application(_:didFinishLaunchingWithOptions:)`.
|
||||
@interface FIRAnalytics (AppDelegate)
|
||||
|
||||
/// Handles events related to a URL session that are waiting to be processed.
|
||||
///
|
||||
/// 1. If SwiftUI lifecycle is adopted, call this method from
|
||||
/// `UIApplicationDelegate.application(_:handleEventsForBackgroundURLSession:completionHandler:)`
|
||||
/// in your app delegate.
|
||||
///
|
||||
/// 2. If SwiftUI lifecycle is not adopted, Firebase Analytics does not require delegation
|
||||
/// implementation from the AppDelegate. If you choose instead to delegate manually, you can set
|
||||
/// FirebaseAppDelegateProxyEnabled to boolean `NO` in your app's Info.plist and call this method
|
||||
/// from
|
||||
/// `UIApplicationDelegate.application(_:handleEventsForBackgroundURLSession:completionHandler:)`
|
||||
/// in your app delegate.
|
||||
///
|
||||
/// @param identifier The identifier of the URL session requiring attention.
|
||||
/// @param completionHandler The completion handler to call when you finish processing the events.
|
||||
/// Calling this completion handler lets the system know that your app's user interface is
|
||||
/// updated and a new snapshot can be taken.
|
||||
+ (void)handleEventsForBackgroundURLSession:(NSString *)identifier
|
||||
completionHandler:(nullable void (^)(void))completionHandler;
|
||||
|
||||
/// Handles the event when the app is launched by a URL (custom URL scheme or universal link).
|
||||
///
|
||||
/// 1. If SwiftUI lifecycle is adopted, use `onOpenURL(perform:)` to register a handler and call
|
||||
/// this method in the handler.
|
||||
///
|
||||
/// 2. If UIScene lifecycle is adopted, call this method from
|
||||
/// `UISceneDelegate.scene(_:willConnectTo:options:)` and
|
||||
/// `UISceneDelegate.scene(_:openURLContexts:)` when the URL contexts are available.
|
||||
///
|
||||
/// 3. If neither SwiftUI nor UIScene lifecycle is adopted, Firebase Analytics does not require
|
||||
/// delegation implementation from the AppDelegate. If you choose instead to delegate manually, you
|
||||
/// can set FirebaseAppDelegateProxyEnabled to boolean `NO` in your app's Info.plist and call this
|
||||
/// method from `UIApplicationDelegate.application(_:open:options:)` in your app delegate.
|
||||
///
|
||||
/// @param url The URL resource to open. This resource can be a network resource or a file.
|
||||
+ (void)handleOpenURL:(NSURL *)url;
|
||||
|
||||
/// Handles the event when the app receives data associated with user activity that includes a
|
||||
/// Universal Link.
|
||||
///
|
||||
/// 1. If SwiftUI lifecycle is adopted, use `onOpenURL(perform:)` to register a handler and call
|
||||
/// `Analytics.handleOpen(_:)` instead in the handler.
|
||||
///
|
||||
/// 2. If UIScene lifecycle is adopted, call this method from
|
||||
/// `UISceneDelegate.scene(_:willConnectTo:options:)` and `UISceneDelegate.scene(_:continue:)` when
|
||||
/// NSUserActivity is available. See the [Apple
|
||||
/// doc](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app) for
|
||||
/// more details.
|
||||
///
|
||||
/// 3. If neither SwiftUI nor UIScene lifecycle is adopted, Firebase Analytics does not require
|
||||
/// delegation implementation from the AppDelegate. If you choose instead to delegate manually, you
|
||||
/// can set FirebaseAppDelegateProxyEnabled to boolean `NO` in your app's Info.plist and call this
|
||||
/// method from `UIApplication.application(_:continue:restorationHandler:)` in your app delegate.
|
||||
///
|
||||
/// @param userActivity The activity object containing the data associated with the task the user
|
||||
/// was performing.
|
||||
+ (void)handleUserActivity:(id)userActivity;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@ -0,0 +1,51 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "FIRAnalytics.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// The type of consent to set. Supported consent types are `ConsentType.adStorage`,
|
||||
/// `ConsentType.analyticsStorage`, `ConsentType.adUserData`, and `ConsentType.adPersonalization`.
|
||||
/// Omitting a type retains its previous status.
|
||||
typedef NSString *FIRConsentType NS_TYPED_ENUM NS_SWIFT_NAME(ConsentType);
|
||||
|
||||
/// Enables storage (such as device identifiers) related to advertising.
|
||||
extern FIRConsentType const FIRConsentTypeAdStorage;
|
||||
|
||||
/// Enables storage (such as app identifiers) related to analytics, e.g. visit duration.
|
||||
extern FIRConsentType const FIRConsentTypeAnalyticsStorage;
|
||||
|
||||
/// Sets consent for sending user data to Google for advertising purposes.
|
||||
extern FIRConsentType const FIRConsentTypeAdUserData;
|
||||
|
||||
/// Sets consent for personalized advertising.
|
||||
extern FIRConsentType const FIRConsentTypeAdPersonalization;
|
||||
|
||||
/// The status value of the consent type. Supported statuses are `ConsentStatus.granted` and
|
||||
/// `ConsentStatus.denied`.
|
||||
typedef NSString *FIRConsentStatus NS_TYPED_ENUM NS_SWIFT_NAME(ConsentStatus);
|
||||
|
||||
/// Consent status indicating consent is denied. For an overview of which data is sent when consent
|
||||
/// is denied, see [SDK behavior with consent
|
||||
/// mode](https://developers.google.com/tag-platform/security/concepts/consent-mode#tag-behavior).
|
||||
extern FIRConsentStatus const FIRConsentStatusDenied;
|
||||
|
||||
/// Consent status indicating consent is granted.
|
||||
extern FIRConsentStatus const FIRConsentStatusGranted;
|
||||
|
||||
/// Sets the applicable end user consent state.
|
||||
@interface FIRAnalytics (Consent)
|
||||
|
||||
/// Sets the applicable end user consent state (e.g. for device identifiers) for this app on this
|
||||
/// device. Use the consent settings to specify individual consent type values. Settings are
|
||||
/// persisted across app sessions. By default consent types are set to `ConsentStatus.granted`.
|
||||
///
|
||||
/// @param consentSettings A Dictionary of consent types. Supported consent type keys are
|
||||
/// `ConsentType.adStorage`, `ConsentType.analyticsStorage`, `ConsentType.adUserData`, and
|
||||
/// `ConsentType.adPersonalization`. Valid values are `ConsentStatus.granted` and
|
||||
/// `ConsentStatus.denied`.
|
||||
+ (void)setConsent:(NSDictionary<FIRConsentType, FIRConsentStatus> *)consentSettings;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@ -0,0 +1,44 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "FIRAnalytics.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
API_UNAVAILABLE(macCatalyst, macos, tvos, watchos)
|
||||
@interface FIRAnalytics (OnDevice)
|
||||
|
||||
/// Initiates on-device conversion measurement given a user email address. Requires dependency
|
||||
/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a no-op.
|
||||
/// @param emailAddress User email address. Include a domain name for all email addresses
|
||||
/// (e.g. gmail.com or hotmail.co.jp).
|
||||
+ (void)initiateOnDeviceConversionMeasurementWithEmailAddress:(NSString *)emailAddress
|
||||
NS_SWIFT_NAME(initiateOnDeviceConversionMeasurement(emailAddress:));
|
||||
|
||||
/// Initiates on-device conversion measurement given a phone number in E.164 format. Requires
|
||||
/// dependency GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a no-op.
|
||||
/// @param phoneNumber User phone number. Must be in E.164 format, which means it must be
|
||||
/// limited to a maximum of 15 digits and must include a plus sign (+) prefix and country code
|
||||
/// with no dashes, parentheses, or spaces.
|
||||
+ (void)initiateOnDeviceConversionMeasurementWithPhoneNumber:(NSString *)phoneNumber
|
||||
NS_SWIFT_NAME(initiateOnDeviceConversionMeasurement(phoneNumber:));
|
||||
|
||||
/// Initiates on-device conversion measurement given a sha256-hashed user email address. Requires
|
||||
/// dependency GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a no-op.
|
||||
/// @param hashedEmailAddress User email address as a UTF8-encoded string normalized and hashed
|
||||
/// according to the instructions at
|
||||
/// https://firebase.google.com/docs/tutorials/ads-ios-on-device-measurement/step-3.
|
||||
+ (void)initiateOnDeviceConversionMeasurementWithHashedEmailAddress:(NSData *)hashedEmailAddress
|
||||
NS_SWIFT_NAME(initiateOnDeviceConversionMeasurement(hashedEmailAddress:));
|
||||
|
||||
/// Initiates on-device conversion measurement given a sha256-hashed phone number in E.164 format.
|
||||
/// Requires dependency GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a
|
||||
/// no-op.
|
||||
/// @param hashedPhoneNumber UTF8-encoded user phone number in E.164 format and then hashed
|
||||
/// according to the instructions at
|
||||
/// https://firebase.google.com/docs/tutorials/ads-ios-on-device-measurement/step-3.
|
||||
+ (void)initiateOnDeviceConversionMeasurementWithHashedPhoneNumber:(NSData *)hashedPhoneNumber
|
||||
NS_SWIFT_NAME(initiateOnDeviceConversionMeasurement(hashedPhoneNumber:));
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@ -0,0 +1,155 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "FIREventNames.h"
|
||||
#import "FIRParameterNames.h"
|
||||
#import "FIRUserPropertyNames.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// The top level Firebase Analytics singleton that provides methods for logging events and setting
|
||||
/// user properties. See <a href="http://goo.gl/gz8SLz">the developer guides</a> for general
|
||||
/// information on using Firebase Analytics in your apps.
|
||||
///
|
||||
/// @note The Analytics SDK uses SQLite to persist events and other app-specific data. Calling
|
||||
/// certain thread-unsafe global SQLite methods like `sqlite3_shutdown()` can result in
|
||||
/// unexpected crashes at runtime.
|
||||
NS_SWIFT_NAME(Analytics)
|
||||
@interface FIRAnalytics : NSObject
|
||||
|
||||
/// Logs an app event. The event can have up to 25 parameters. Events with the same name must have
|
||||
/// the same parameters. Up to 500 event names are supported. Using predefined events and/or
|
||||
/// parameters is recommended for optimal reporting.
|
||||
///
|
||||
/// The following event names are reserved and cannot be used:
|
||||
/// <ul>
|
||||
/// <li>ad_activeview</li>
|
||||
/// <li>ad_click</li>
|
||||
/// <li>ad_exposure</li>
|
||||
/// <li>ad_query</li>
|
||||
/// <li>ad_reward</li>
|
||||
/// <li>adunit_exposure</li>
|
||||
/// <li>app_clear_data</li>
|
||||
/// <li>app_exception</li>
|
||||
/// <li>app_remove</li>
|
||||
/// <li>app_store_refund</li>
|
||||
/// <li>app_store_subscription_cancel</li>
|
||||
/// <li>app_store_subscription_convert</li>
|
||||
/// <li>app_store_subscription_renew</li>
|
||||
/// <li>app_update</li>
|
||||
/// <li>app_upgrade</li>
|
||||
/// <li>dynamic_link_app_open</li>
|
||||
/// <li>dynamic_link_app_update</li>
|
||||
/// <li>dynamic_link_first_open</li>
|
||||
/// <li>error</li>
|
||||
/// <li>firebase_campaign</li>
|
||||
/// <li>first_open</li>
|
||||
/// <li>first_visit</li>
|
||||
/// <li>in_app_purchase</li>
|
||||
/// <li>notification_dismiss</li>
|
||||
/// <li>notification_foreground</li>
|
||||
/// <li>notification_open</li>
|
||||
/// <li>notification_receive</li>
|
||||
/// <li>os_update</li>
|
||||
/// <li>session_start</li>
|
||||
/// <li>session_start_with_rollout</li>
|
||||
/// <li>user_engagement</li>
|
||||
/// </ul>
|
||||
///
|
||||
/// @param name The name of the event. Should contain 1 to 40 alphanumeric characters or
|
||||
/// underscores. The name must start with an alphabetic character. Some event names are
|
||||
/// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_",
|
||||
/// "google_", and "ga_" prefixes are reserved and should not be used. Note that event names are
|
||||
/// case-sensitive and that logging two events whose names differ only in case will result in
|
||||
/// two distinct events. To manually log screen view events, use the `screen_view` event name.
|
||||
/// @param parameters The dictionary of event parameters. Passing `nil` indicates that the event has
|
||||
/// no parameters. Parameter names can be up to 40 characters long and must start with an
|
||||
/// alphabetic character and contain only alphanumeric characters and underscores. Only String,
|
||||
/// Int, and Double parameter types are supported. String parameter values can be up to 100
|
||||
/// characters long for standard Google Analytics properties, and up to 500 characters long for
|
||||
/// Google Analytics 360 properties. The "firebase_", "google_", and "ga_" prefixes are reserved
|
||||
/// and should not be used for parameter names.
|
||||
+ (void)logEventWithName:(NSString *)name
|
||||
parameters:(nullable NSDictionary<NSString *, id> *)parameters
|
||||
NS_SWIFT_NAME(logEvent(_:parameters:));
|
||||
|
||||
/// Sets a user property to a given value. Up to 25 user property names are supported. Once set,
|
||||
/// user property values persist throughout the app lifecycle and across sessions.
|
||||
///
|
||||
/// The following user property names are reserved and cannot be used:
|
||||
/// <ul>
|
||||
/// <li>first_open_time</li>
|
||||
/// <li>last_deep_link_referrer</li>
|
||||
/// <li>user_id</li>
|
||||
/// </ul>
|
||||
///
|
||||
/// @param value The value of the user property. Values can be up to 36 characters long. Setting the
|
||||
/// value to `nil` removes the user property.
|
||||
/// @param name The name of the user property to set. Should contain 1 to 24 alphanumeric characters
|
||||
/// or underscores and must start with an alphabetic character. The "firebase_", "google_", and
|
||||
/// "ga_" prefixes are reserved and should not be used for user property names.
|
||||
+ (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name
|
||||
NS_SWIFT_NAME(setUserProperty(_:forName:));
|
||||
|
||||
/// Sets the user ID property. This feature must be used in accordance with
|
||||
/// <a href="https://www.google.com/policies/privacy">Google's Privacy Policy</a>
|
||||
///
|
||||
/// @param userID The user ID to ascribe to the user of this app on this device, which must be
|
||||
/// non-empty and no more than 256 characters long. Setting userID to `nil` removes the user ID.
|
||||
+ (void)setUserID:(nullable NSString *)userID;
|
||||
|
||||
/// Sets whether analytics collection is enabled for this app on this device. This setting is
|
||||
/// persisted across app sessions. By default it is enabled.
|
||||
///
|
||||
/// @param analyticsCollectionEnabled A flag that enables or disables Analytics collection.
|
||||
+ (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled;
|
||||
|
||||
/// Sets the interval of inactivity in seconds that terminates the current session. The default
|
||||
/// value is 1800 seconds (30 minutes).
|
||||
///
|
||||
/// @param sessionTimeoutInterval The custom time of inactivity in seconds before the current
|
||||
/// session terminates.
|
||||
+ (void)setSessionTimeoutInterval:(NSTimeInterval)sessionTimeoutInterval;
|
||||
|
||||
/// Asynchronously retrieves the identifier of the current app session.
|
||||
///
|
||||
/// The session ID retrieval could fail due to Analytics collection disabled, app session expired,
|
||||
/// etc.
|
||||
///
|
||||
/// @param completion The completion handler to call when the session ID retrieval is complete. This
|
||||
/// handler is executed on a system-defined global concurrent queue.
|
||||
/// This completion handler takes the following parameters:
|
||||
/// <b>sessionID</b> The identifier of the current app session. The value is undefined if the
|
||||
/// request failed.
|
||||
/// <b>error</b> An error object that indicates why the request failed, or `nil` if the request
|
||||
/// was successful.
|
||||
+ (void)sessionIDWithCompletion:(void (^)(int64_t sessionID, NSError *_Nullable error))completion;
|
||||
|
||||
/// Returns the unique ID for this instance of the application or `nil` if
|
||||
/// `ConsentType.analyticsStorage` has been set to `ConsentStatus.denied`.
|
||||
///
|
||||
/// @see `FIRAnalytics+Consent.h`
|
||||
+ (nullable NSString *)appInstanceID;
|
||||
|
||||
/// Clears all analytics data for this instance from the device and resets the app instance ID.
|
||||
+ (void)resetAnalyticsData;
|
||||
|
||||
/// Adds parameters that will be set on every event logged from the SDK, including automatic ones.
|
||||
/// The values passed in the parameters dictionary will be added to the dictionary of default event
|
||||
/// parameters. These parameters persist across app runs. They are of lower precedence than event
|
||||
/// parameters, so if an event parameter and a parameter set using this API have the same name, the
|
||||
/// value of the event parameter will be used. The same limitations on event parameters apply to
|
||||
/// default event parameters.
|
||||
///
|
||||
/// @param parameters Parameters to be added to the dictionary of parameters added to every event.
|
||||
/// They will be added to the dictionary of default event parameters, replacing any existing
|
||||
/// parameter with the same name. Valid parameters are String, Int, and Double. Setting a key's
|
||||
/// value to `NSNull()` will clear that parameter. Passing in a `nil` dictionary will clear all
|
||||
/// parameters.
|
||||
+ (void)setDefaultEventParameters:(nullable NSDictionary<NSString *, id> *)parameters;
|
||||
|
||||
/// Unavailable.
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@ -0,0 +1,418 @@
|
||||
/// @file FIREventNames.h
|
||||
///
|
||||
/// Predefined event names.
|
||||
///
|
||||
/// An Event is an important occurrence in your app that you want to measure. You can report up to
|
||||
/// 500 different types of Events per app and you can associate up to 25 unique parameters with each
|
||||
/// Event type. Some common events are suggested below, but you may also choose to specify custom
|
||||
/// Event types that are associated with your specific app. Each event type is identified by a
|
||||
/// unique name. Event names can be up to 40 characters long, may only contain alphanumeric
|
||||
/// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_",
|
||||
/// "google_", and "ga_" prefixes are reserved and should not be used.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/// Ad Impression event. This event signifies when a user sees an ad impression. Note: If you supply
|
||||
/// the @c AnalyticsParameterValue parameter, you must also supply the @c AnalyticsParameterCurrency
|
||||
/// parameter so that revenue metrics can be computed accurately. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterAdPlatform (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterAdFormat (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterAdSource (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterAdUnitName (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventAdImpression NS_SWIFT_NAME(AnalyticsEventAdImpression) =
|
||||
@"ad_impression";
|
||||
|
||||
/// Add Payment Info event. This event signifies that a user has submitted their payment
|
||||
/// information. Note: If you supply the @c AnalyticsParameterValue parameter, you must also supply
|
||||
/// the @c AnalyticsParameterCurrency parameter so that revenue metrics can be computed accurately.
|
||||
/// Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCoupon (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterPaymentType (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventAddPaymentInfo NS_SWIFT_NAME(AnalyticsEventAddPaymentInfo) =
|
||||
@"add_payment_info";
|
||||
|
||||
/// Add Shipping Info event. This event signifies that a user has submitted their shipping
|
||||
/// information. Note: If you supply the @c AnalyticsParameterValue parameter, you must also supply
|
||||
/// the @c AnalyticsParameterCurrency parameter so that revenue metrics can be computed accurately.
|
||||
/// Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCoupon (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterShippingTier (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventAddShippingInfo NS_SWIFT_NAME(AnalyticsEventAddShippingInfo) =
|
||||
@"add_shipping_info";
|
||||
|
||||
/// E-Commerce Add To Cart event. This event signifies that an item(s) was added to a cart for
|
||||
/// purchase. Add this event to a funnel with @c AnalyticsEventPurchase to gauge the effectiveness
|
||||
/// of your checkout process. Note: If you supply the @c AnalyticsParameterValue parameter, you must
|
||||
/// also supply the @c AnalyticsParameterCurrency parameter so that revenue metrics can be computed
|
||||
/// accurately. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventAddToCart NS_SWIFT_NAME(AnalyticsEventAddToCart) = @"add_to_cart";
|
||||
|
||||
/// E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist. Use
|
||||
/// this event to identify popular gift items. Note: If you supply the @c AnalyticsParameterValue
|
||||
/// parameter, you must also supply the @c AnalyticsParameterCurrency parameter so that revenue
|
||||
/// metrics can be computed accurately. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventAddToWishlist NS_SWIFT_NAME(AnalyticsEventAddToWishlist) =
|
||||
@"add_to_wishlist";
|
||||
|
||||
/// App Open event. By logging this event when an App becomes active, developers can understand how
|
||||
/// often users leave and return during the course of a Session. Although Sessions are automatically
|
||||
/// reported, this event can provide further clarification around the continuous engagement of
|
||||
/// app-users.
|
||||
static NSString *const kFIREventAppOpen NS_SWIFT_NAME(AnalyticsEventAppOpen) = @"app_open";
|
||||
|
||||
/// E-Commerce Begin Checkout event. This event signifies that a user has begun the process of
|
||||
/// checking out. Add this event to a funnel with your @c AnalyticsEventPurchase event to gauge the
|
||||
/// effectiveness of your checkout process. Note: If you supply the @c AnalyticsParameterValue
|
||||
/// parameter, you must also supply the @c AnalyticsParameterCurrency parameter so that revenue
|
||||
/// metrics can be computed accurately. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCoupon (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventBeginCheckout NS_SWIFT_NAME(AnalyticsEventBeginCheckout) =
|
||||
@"begin_checkout";
|
||||
|
||||
/// Campaign Detail event. Log this event to supply the referral details of a re-engagement
|
||||
/// campaign. Note: you must supply at least one of the required parameters
|
||||
/// AnalyticsParameterSource, AnalyticsParameterMedium or AnalyticsParameterCampaign. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterSource (String)</li>
|
||||
/// <li>@c AnalyticsParameterMedium (String)</li>
|
||||
/// <li>@c AnalyticsParameterCampaign (String)</li>
|
||||
/// <li>@c AnalyticsParameterTerm (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterContent (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterAdNetworkClickID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCP1 (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCampaignID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCreativeFormat (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterMarketingTactic (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterSourcePlatform (String) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventCampaignDetails NS_SWIFT_NAME(AnalyticsEventCampaignDetails) =
|
||||
@"campaign_details";
|
||||
|
||||
/// Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app. Log
|
||||
/// this along with @c AnalyticsEventSpendVirtualCurrency to better understand your virtual economy.
|
||||
/// Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterVirtualCurrencyName (String)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Int or Double)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventEarnVirtualCurrency
|
||||
NS_SWIFT_NAME(AnalyticsEventEarnVirtualCurrency) = @"earn_virtual_currency";
|
||||
|
||||
/// Generate Lead event. Log this event when a lead has been generated in the app to understand the
|
||||
/// efficacy of your install and re-engagement campaigns. Note: If you supply the
|
||||
/// @c AnalyticsParameterValue parameter, you must also supply the @c AnalyticsParameterCurrency
|
||||
/// parameter so that revenue metrics can be computed accurately. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventGenerateLead NS_SWIFT_NAME(AnalyticsEventGenerateLead) =
|
||||
@"generate_lead";
|
||||
|
||||
/// Join Group event. Log this event when a user joins a group such as a guild, team or family. Use
|
||||
/// this event to analyze how popular certain groups or social features are in your app. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterGroupID (String)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventJoinGroup NS_SWIFT_NAME(AnalyticsEventJoinGroup) = @"join_group";
|
||||
|
||||
/// Level End event. Log this event when the user finishes a level. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterLevelName (String)</li>
|
||||
/// <li>@c AnalyticsParameterSuccess (String)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventLevelEnd NS_SWIFT_NAME(AnalyticsEventLevelEnd) = @"level_end";
|
||||
|
||||
/// Level Start event. Log this event when the user starts a new level. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterLevelName (String)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventLevelStart NS_SWIFT_NAME(AnalyticsEventLevelStart) = @"level_start";
|
||||
|
||||
/// Level Up event. This event signifies that a player has leveled up in your gaming app. It can
|
||||
/// help you gauge the level distribution of your userbase and help you identify certain levels that
|
||||
/// are difficult to pass. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterLevel (Int)</li>
|
||||
/// <li>@c AnalyticsParameterCharacter (String) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventLevelUp NS_SWIFT_NAME(AnalyticsEventLevelUp) = @"level_up";
|
||||
|
||||
/// Login event. Apps with a login feature can report this event to signify that a user has logged
|
||||
/// in.
|
||||
static NSString *const kFIREventLogin NS_SWIFT_NAME(AnalyticsEventLogin) = @"login";
|
||||
|
||||
/// Post Score event. Log this event when the user posts a score in your gaming app. This event can
|
||||
/// help you understand how users are actually performing in your game and it can help you correlate
|
||||
/// high scores with certain audiences or behaviors. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterScore (Int)</li>
|
||||
/// <li>@c AnalyticsParameterLevel (Int) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCharacter (String) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventPostScore NS_SWIFT_NAME(AnalyticsEventPostScore) = @"post_score";
|
||||
|
||||
/// E-Commerce Purchase event. This event signifies that an item(s) was purchased by a user. Note:
|
||||
/// This is different from the in-app purchase event, which is reported automatically for App
|
||||
/// Store-based apps. Note: If you supply the @c AnalyticsParameterValue parameter, you must also
|
||||
/// supply the @c AnalyticsParameterCurrency parameter so that revenue metrics can be computed
|
||||
/// accurately. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterAffiliation (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCoupon (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterEndDate (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItemID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterShipping (Double) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterStartDate (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterTax (Double) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterTransactionID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventPurchase NS_SWIFT_NAME(AnalyticsEventPurchase) = @"purchase";
|
||||
|
||||
/// E-Commerce Refund event. This event signifies that a refund was issued. Note: If you supply the
|
||||
/// @c AnalyticsParameterValue parameter, you must also supply the @c AnalyticsParameterCurrency
|
||||
/// parameter so that revenue metrics can be computed accurately. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterAffiliation (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCoupon (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterShipping (Double) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterTax (Double) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterTransactionID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventRefund NS_SWIFT_NAME(AnalyticsEventRefund) = @"refund";
|
||||
|
||||
/// E-Commerce Remove from Cart event. This event signifies that an item(s) was removed from a cart.
|
||||
/// Note: If you supply the @c AnalyticsParameterValue parameter, you must also supply the @c
|
||||
/// AnalyticsParameterCurrency parameter so that revenue metrics can be computed accurately. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventRemoveFromCart NS_SWIFT_NAME(AnalyticsEventRemoveFromCart) =
|
||||
@"remove_from_cart";
|
||||
|
||||
/// Screen View event. This event signifies a screen view. Use this when a screen transition occurs.
|
||||
/// This event can be logged irrespective of whether automatic screen tracking is enabled. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterScreenClass (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterScreenName (String) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventScreenView NS_SWIFT_NAME(AnalyticsEventScreenView) = @"screen_view";
|
||||
|
||||
/// Search event. Apps that support search features can use this event to contextualize search
|
||||
/// operations by supplying the appropriate, corresponding parameters. This event can help you
|
||||
/// identify the most popular content in your app. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterSearchTerm (String)</li>
|
||||
/// <li>@c AnalyticsParameterStartDate (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterEndDate (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterNumberOfNights (Int) (optional) for hotel bookings</li>
|
||||
/// <li>@c AnalyticsParameterNumberOfRooms (Int) (optional) for hotel bookings</li>
|
||||
/// <li>@c AnalyticsParameterNumberOfPassengers (Int) (optional) for travel bookings</li>
|
||||
/// <li>@c AnalyticsParameterOrigin (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterDestination (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterTravelClass (String) (optional) for travel bookings</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventSearch NS_SWIFT_NAME(AnalyticsEventSearch) = @"search";
|
||||
|
||||
/// Select Content event. This general purpose event signifies that a user has selected some content
|
||||
/// of a certain type in an app. The content can be any object in your app. This event can help you
|
||||
/// identify popular content and categories of content in your app. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterContentType (String)</li>
|
||||
/// <li>@c AnalyticsParameterItemID (String)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventSelectContent NS_SWIFT_NAME(AnalyticsEventSelectContent) =
|
||||
@"select_content";
|
||||
|
||||
/// Select Item event. This event signifies that an item was selected by a user from a list. Use the
|
||||
/// appropriate parameters to contextualize the event. Use this event to discover the most popular
|
||||
/// items selected. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItemListID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItemListName (String) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventSelectItem NS_SWIFT_NAME(AnalyticsEventSelectItem) = @"select_item";
|
||||
|
||||
/// Select promotion event. This event signifies that a user has selected a promotion offer. Use the
|
||||
/// appropriate parameters to contextualize the event, such as the item(s) for which the promotion
|
||||
/// applies. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCreativeName (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCreativeSlot (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterLocationID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterPromotionID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterPromotionName (String) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventSelectPromotion NS_SWIFT_NAME(AnalyticsEventSelectPromotion) =
|
||||
@"select_promotion";
|
||||
|
||||
/// Share event. Apps with social features can log the Share event to identify the most viral
|
||||
/// content. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterContentType (String)</li>
|
||||
/// <li>@c AnalyticsParameterItemID (String)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventShare NS_SWIFT_NAME(AnalyticsEventShare) = @"share";
|
||||
|
||||
/// Sign Up event. This event indicates that a user has signed up for an account in your app. The
|
||||
/// parameter signifies the method by which the user signed up. Use this event to understand the
|
||||
/// different behaviors between logged in and logged out users. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterMethod (String)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventSignUp NS_SWIFT_NAME(AnalyticsEventSignUp) = @"sign_up";
|
||||
|
||||
/// Spend Virtual Currency event. This event tracks the sale of virtual goods in your app and can
|
||||
/// help you identify which virtual goods are the most popular objects of purchase. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterItemName (String)</li>
|
||||
/// <li>@c AnalyticsParameterVirtualCurrencyName (String)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Int or Double)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventSpendVirtualCurrency
|
||||
NS_SWIFT_NAME(AnalyticsEventSpendVirtualCurrency) = @"spend_virtual_currency";
|
||||
|
||||
/// Tutorial Begin event. This event signifies the start of the on-boarding process in your app. Use
|
||||
/// this in a funnel with @c AnalyticsEventTutorialComplete to understand how many users complete
|
||||
/// this process and move on to the full app experience.
|
||||
static NSString *const kFIREventTutorialBegin NS_SWIFT_NAME(AnalyticsEventTutorialBegin) =
|
||||
@"tutorial_begin";
|
||||
|
||||
/// Tutorial End event. Use this event to signify the user's completion of your app's on-boarding
|
||||
/// process. Add this to a funnel with @c AnalyticsEventTutorialBegin to gauge the completion rate
|
||||
/// of your on-boarding process.
|
||||
static NSString *const kFIREventTutorialComplete NS_SWIFT_NAME(AnalyticsEventTutorialComplete) =
|
||||
@"tutorial_complete";
|
||||
|
||||
/// Unlock Achievement event. Log this event when the user has unlocked an achievement in your
|
||||
/// game. Since achievements generally represent the breadth of a gaming experience, this event can
|
||||
/// help you understand how many users are experiencing all that your game has to offer. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterAchievementID (String)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventUnlockAchievement NS_SWIFT_NAME(AnalyticsEventUnlockAchievement) =
|
||||
@"unlock_achievement";
|
||||
|
||||
/// E-commerce View Cart event. This event signifies that a user has viewed their cart. Use this to
|
||||
/// analyze your purchase funnel. Note: If you supply the @c AnalyticsParameterValue parameter, you
|
||||
/// must also supply the @c AnalyticsParameterCurrency parameter so that revenue metrics can be
|
||||
/// computed accurately. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventViewCart NS_SWIFT_NAME(AnalyticsEventViewCart) = @"view_cart";
|
||||
|
||||
/// View Item event. This event signifies that a user has viewed an item. Use the appropriate
|
||||
/// parameters to contextualize the event. Use this event to discover the most popular items viewed
|
||||
/// in your app. Note: If you supply the @c AnalyticsParameterValue parameter, you must also supply
|
||||
/// the @c AnalyticsParameterCurrency parameter so that revenue metrics can be computed accurately.
|
||||
/// Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCurrency (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterValue (Double) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventViewItem NS_SWIFT_NAME(AnalyticsEventViewItem) = @"view_item";
|
||||
|
||||
/// View Item List event. Log this event when a user sees a list of items or offerings. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItemListID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItemListName (String) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventViewItemList NS_SWIFT_NAME(AnalyticsEventViewItemList) =
|
||||
@"view_item_list";
|
||||
|
||||
/// View Promotion event. This event signifies that a promotion was shown to a user. Add this event
|
||||
/// to a funnel with the @c AnalyticsEventAddToCart and @c AnalyticsEventPurchase to gauge your
|
||||
/// conversion process. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterCreativeName (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterCreativeSlot (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterItems ([[String: Any]]) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterLocationID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterPromotionID (String) (optional)</li>
|
||||
/// <li>@c AnalyticsParameterPromotionName (String) (optional)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventViewPromotion NS_SWIFT_NAME(AnalyticsEventViewPromotion) =
|
||||
@"view_promotion";
|
||||
|
||||
/// View Search Results event. Log this event when the user has been presented with the results of a
|
||||
/// search. Params:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@c AnalyticsParameterSearchTerm (String)</li>
|
||||
/// </ul>
|
||||
static NSString *const kFIREventViewSearchResults NS_SWIFT_NAME(AnalyticsEventViewSearchResults) =
|
||||
@"view_search_results";
|
||||
@ -0,0 +1,722 @@
|
||||
/// @file FIRParameterNames.h
|
||||
///
|
||||
/// Predefined event parameter names.
|
||||
///
|
||||
/// Params supply information that contextualize Events. You can associate up to 25 unique Params
|
||||
/// with each Event type. Some Params are suggested below for certain common Events, but you are
|
||||
/// not limited to these. You may supply extra Params for suggested Events or custom Params for
|
||||
/// Custom events. Param names can be up to 40 characters long, may only contain alphanumeric
|
||||
/// characters and underscores ("_"), and must start with an alphabetic character. Param values can
|
||||
/// be up to 100 characters long for standard Google Analytics properties and up to 500 characters
|
||||
/// long for Google Analytics 360 properties. The "firebase_", "google_", and "ga_" prefixes are
|
||||
/// reserved and should not be used.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/// Game achievement ID (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterAchievementID : "10_matches_won",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterAchievementID NS_SWIFT_NAME(AnalyticsParameterAchievementID) =
|
||||
@"achievement_id";
|
||||
|
||||
/// The ad format (e.g. Banner, Interstitial, Rewarded, Native, Rewarded Interstitial, Instream).
|
||||
/// (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterAdFormat : "Banner",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterAdFormat NS_SWIFT_NAME(AnalyticsParameterAdFormat) =
|
||||
@"ad_format";
|
||||
|
||||
/// Ad Network Click ID (String). Used for network-specific click IDs which vary in format.
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterAdNetworkClickID : "1234567",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterAdNetworkClickID
|
||||
NS_SWIFT_NAME(AnalyticsParameterAdNetworkClickID) = @"aclid";
|
||||
|
||||
/// The ad platform (e.g. MoPub, IronSource) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterAdPlatform : "MoPub",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterAdPlatform NS_SWIFT_NAME(AnalyticsParameterAdPlatform) =
|
||||
@"ad_platform";
|
||||
|
||||
/// The ad source (e.g. AdColony) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterAdSource : "AdColony",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterAdSource NS_SWIFT_NAME(AnalyticsParameterAdSource) =
|
||||
@"ad_source";
|
||||
|
||||
/// The ad unit name (e.g. Banner_03) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterAdUnitName : "Banner_03",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterAdUnitName NS_SWIFT_NAME(AnalyticsParameterAdUnitName) =
|
||||
@"ad_unit_name";
|
||||
|
||||
/// A product affiliation to designate a supplying company or brick and mortar store location
|
||||
/// (String). <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterAffiliation : "Google Store",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterAffiliation NS_SWIFT_NAME(AnalyticsParameterAffiliation) =
|
||||
@"affiliation";
|
||||
|
||||
/// Campaign custom parameter (String). Used as a method of capturing custom data in a campaign.
|
||||
/// Use varies by network.
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterCP1 : "custom_data",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterCP1 NS_SWIFT_NAME(AnalyticsParameterCP1) = @"cp1";
|
||||
|
||||
/// The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro to
|
||||
/// capture campaign information, otherwise can be populated by developer. Highly Recommended
|
||||
/// (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterCampaign : "winter_promotion",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterCampaign NS_SWIFT_NAME(AnalyticsParameterCampaign) =
|
||||
@"campaign";
|
||||
|
||||
/// Campaign ID (String). Used for keyword analysis to identify a specific product promotion or
|
||||
/// strategic campaign. This is a required key for GA4 data import.
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterCampaignID : "7877652710",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterCampaignID NS_SWIFT_NAME(AnalyticsParameterCampaignID) =
|
||||
@"campaign_id";
|
||||
|
||||
/// Character used in game (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterCharacter : "beat_boss",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterCharacter NS_SWIFT_NAME(AnalyticsParameterCharacter) =
|
||||
@"character";
|
||||
|
||||
/// Campaign content (String).
|
||||
static NSString *const kFIRParameterContent NS_SWIFT_NAME(AnalyticsParameterContent) = @"content";
|
||||
|
||||
/// Type of content selected (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterContentType : "news article",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterContentType NS_SWIFT_NAME(AnalyticsParameterContentType) =
|
||||
@"content_type";
|
||||
|
||||
/// Coupon code used for a purchase (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterCoupon : "SUMMER_FUN",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterCoupon NS_SWIFT_NAME(AnalyticsParameterCoupon) = @"coupon";
|
||||
|
||||
/// Creative Format (String). Used to identify the high-level classification of the type of ad
|
||||
/// served by a specific campaign.
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterCreativeFormat : "display",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterCreativeFormat NS_SWIFT_NAME(AnalyticsParameterCreativeFormat) =
|
||||
@"creative_format";
|
||||
|
||||
/// The name of a creative used in a promotional spot (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterCreativeName : "Summer Sale",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterCreativeName NS_SWIFT_NAME(AnalyticsParameterCreativeName) =
|
||||
@"creative_name";
|
||||
|
||||
/// The name of a creative slot (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterCreativeSlot : "summer_banner2",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterCreativeSlot NS_SWIFT_NAME(AnalyticsParameterCreativeSlot) =
|
||||
@"creative_slot";
|
||||
|
||||
/// Currency of the purchase or items associated with the event, in 3-letter
|
||||
/// <a href="http://en.wikipedia.org/wiki/ISO_4217#Active_codes"> ISO_4217</a> format (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterCurrency : "USD",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterCurrency NS_SWIFT_NAME(AnalyticsParameterCurrency) =
|
||||
@"currency";
|
||||
|
||||
/// Flight or Travel destination (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterDestination : "Mountain View, CA",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterDestination NS_SWIFT_NAME(AnalyticsParameterDestination) =
|
||||
@"destination";
|
||||
|
||||
/// Monetary value of discount associated with a purchase (Double).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterDiscount : 2.0,
|
||||
/// AnalyticsParameterCurrency : "USD", // e.g. $2.00 USD
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterDiscount NS_SWIFT_NAME(AnalyticsParameterDiscount) =
|
||||
@"discount";
|
||||
|
||||
/// The arrival date, check-out date or rental end date for the item. This should be in
|
||||
/// YYYY-MM-DD format (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterEndDate : "2015-09-14",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterEndDate NS_SWIFT_NAME(AnalyticsParameterEndDate) = @"end_date";
|
||||
|
||||
/// Indicates that the associated event should either extend the current session or start a new
|
||||
/// session if no session was active when the event was logged. Specify 1 to extend the current
|
||||
/// session or to start a new session; any other value will not extend or start a session.
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterExtendSession : 1,
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterExtendSession NS_SWIFT_NAME(AnalyticsParameterExtendSession) =
|
||||
@"extend_session";
|
||||
|
||||
/// Flight number for travel events (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterFlightNumber : "ZZ800",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterFlightNumber NS_SWIFT_NAME(AnalyticsParameterFlightNumber) =
|
||||
@"flight_number";
|
||||
|
||||
/// Group/clan/guild ID (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterGroupID : "g1",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterGroupID NS_SWIFT_NAME(AnalyticsParameterGroupID) = @"group_id";
|
||||
|
||||
/// The index of the item in a list (Int).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterIndex : 5,
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterIndex NS_SWIFT_NAME(AnalyticsParameterIndex) = @"index";
|
||||
|
||||
/// Item brand (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemBrand : "Google",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemBrand NS_SWIFT_NAME(AnalyticsParameterItemBrand) =
|
||||
@"item_brand";
|
||||
|
||||
/// Item category (context-specific) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemCategory : "pants",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemCategory NS_SWIFT_NAME(AnalyticsParameterItemCategory) =
|
||||
@"item_category";
|
||||
|
||||
/// Item Category (context-specific) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemCategory2 : "pants",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemCategory2 NS_SWIFT_NAME(AnalyticsParameterItemCategory2) =
|
||||
@"item_category2";
|
||||
|
||||
/// Item Category (context-specific) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemCategory3 : "pants",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemCategory3 NS_SWIFT_NAME(AnalyticsParameterItemCategory3) =
|
||||
@"item_category3";
|
||||
|
||||
/// Item Category (context-specific) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemCategory4 : "pants",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemCategory4 NS_SWIFT_NAME(AnalyticsParameterItemCategory4) =
|
||||
@"item_category4";
|
||||
|
||||
/// Item Category (context-specific) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemCategory5 : "pants",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemCategory5 NS_SWIFT_NAME(AnalyticsParameterItemCategory5) =
|
||||
@"item_category5";
|
||||
|
||||
/// Item ID (context-specific) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemID : "SKU_12345",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemID NS_SWIFT_NAME(AnalyticsParameterItemID) = @"item_id";
|
||||
|
||||
/// The ID of the list in which the item was presented to the user (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemListID : "ABC123",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemListID NS_SWIFT_NAME(AnalyticsParameterItemListID) =
|
||||
@"item_list_id";
|
||||
|
||||
/// The name of the list in which the item was presented to the user (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemListName : "Related products",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemListName NS_SWIFT_NAME(AnalyticsParameterItemListName) =
|
||||
@"item_list_name";
|
||||
|
||||
/// Item Name (context-specific) (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemName : "jeggings",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemName NS_SWIFT_NAME(AnalyticsParameterItemName) =
|
||||
@"item_name";
|
||||
|
||||
/// Item variant (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItemVariant : "Black",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItemVariant NS_SWIFT_NAME(AnalyticsParameterItemVariant) =
|
||||
@"item_variant";
|
||||
|
||||
/// The list of items involved in the transaction expressed as `[[String: Any]]`.
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterItems : [
|
||||
/// [AnalyticsParameterItemName : "jeggings", AnalyticsParameterItemCategory : "pants"],
|
||||
/// [AnalyticsParameterItemName : "boots", AnalyticsParameterItemCategory : "shoes"],
|
||||
/// ],
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterItems NS_SWIFT_NAME(AnalyticsParameterItems) = @"items";
|
||||
|
||||
/// Level in game (Int).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterLevel : 42,
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterLevel NS_SWIFT_NAME(AnalyticsParameterLevel) = @"level";
|
||||
|
||||
/// The name of a level in a game (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterLevelName : "room_1",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterLevelName NS_SWIFT_NAME(AnalyticsParameterLevelName) =
|
||||
@"level_name";
|
||||
|
||||
/// Location (String). The Google <a href="https://developers.google.com/places/place-id">Place ID
|
||||
/// </a> that corresponds to the associated event. Alternatively, you can supply your own custom
|
||||
/// Location ID.
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterLocation : "ChIJiyj437sx3YAR9kUWC8QkLzQ",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterLocation NS_SWIFT_NAME(AnalyticsParameterLocation) =
|
||||
@"location";
|
||||
|
||||
/// The location associated with the event. Preferred to be the Google
|
||||
/// <a href="https://developers.google.com/places/place-id">Place ID</a> that corresponds to the
|
||||
/// associated item but could be overridden to a custom location ID string.(String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterLocationID : "ChIJiyj437sx3YAR9kUWC8QkLzQ",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterLocationID NS_SWIFT_NAME(AnalyticsParameterLocationID) =
|
||||
@"location_id";
|
||||
|
||||
/// Marketing Tactic (String). Used to identify the targeting criteria applied to a specific
|
||||
/// campaign.
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterMarketingTactic : "Remarketing",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterMarketingTactic
|
||||
NS_SWIFT_NAME(AnalyticsParameterMarketingTactic) = @"marketing_tactic";
|
||||
|
||||
/// The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended
|
||||
/// (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterMedium : "email",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterMedium NS_SWIFT_NAME(AnalyticsParameterMedium) = @"medium";
|
||||
|
||||
/// A particular approach used in an operation; for example, "facebook" or "email" in the context
|
||||
/// of a sign_up or login event. (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterMethod : "google",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterMethod NS_SWIFT_NAME(AnalyticsParameterMethod) = @"method";
|
||||
|
||||
/// Number of nights staying at hotel (Int).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterNumberOfNights : 3,
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterNumberOfNights
|
||||
NS_SWIFT_NAME(AnalyticsParameterNumberOfNights) = @"number_of_nights";
|
||||
|
||||
/// Number of passengers traveling (Int).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterNumberOfPassengers : 11,
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterNumberOfPassengers
|
||||
NS_SWIFT_NAME(AnalyticsParameterNumberOfPassengers) = @"number_of_passengers";
|
||||
|
||||
/// Number of rooms for travel events (Int).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterNumberOfRooms : 2,
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterNumberOfRooms NS_SWIFT_NAME(AnalyticsParameterNumberOfRooms) =
|
||||
@"number_of_rooms";
|
||||
|
||||
/// Flight or Travel origin (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterOrigin : "Mountain View, CA",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterOrigin NS_SWIFT_NAME(AnalyticsParameterOrigin) = @"origin";
|
||||
|
||||
/// The chosen method of payment (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterPaymentType : "Visa",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterPaymentType NS_SWIFT_NAME(AnalyticsParameterPaymentType) =
|
||||
@"payment_type";
|
||||
|
||||
/// Purchase price (Double).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterPrice : 1.0,
|
||||
/// AnalyticsParameterCurrency : "USD", // e.g. $1.00 USD
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterPrice NS_SWIFT_NAME(AnalyticsParameterPrice) = @"price";
|
||||
|
||||
/// The ID of a product promotion (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterPromotionID : "ABC123",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterPromotionID NS_SWIFT_NAME(AnalyticsParameterPromotionID) =
|
||||
@"promotion_id";
|
||||
|
||||
/// The name of a product promotion (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterPromotionName : "Summer Sale",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterPromotionName NS_SWIFT_NAME(AnalyticsParameterPromotionName) =
|
||||
@"promotion_name";
|
||||
|
||||
/// Purchase quantity (Int).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterQuantity : 1,
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterQuantity NS_SWIFT_NAME(AnalyticsParameterQuantity) =
|
||||
@"quantity";
|
||||
|
||||
/// Score in game (Int).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterScore : 4200,
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterScore NS_SWIFT_NAME(AnalyticsParameterScore) = @"score";
|
||||
|
||||
/// Current screen class, such as the class name of the UIViewController, logged with screen_view
|
||||
/// event and added to every event (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterScreenClass : "LoginViewController",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterScreenClass NS_SWIFT_NAME(AnalyticsParameterScreenClass) =
|
||||
@"screen_class";
|
||||
|
||||
/// Current screen name, such as the name of the UIViewController, logged with screen_view event and
|
||||
/// added to every event (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterScreenName : "LoginView",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterScreenName NS_SWIFT_NAME(AnalyticsParameterScreenName) =
|
||||
@"screen_name";
|
||||
|
||||
/// The search string/keywords used (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterSearchTerm : "periodic table",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterSearchTerm NS_SWIFT_NAME(AnalyticsParameterSearchTerm) =
|
||||
@"search_term";
|
||||
|
||||
/// Shipping cost associated with a transaction (Double).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterShipping : 5.99,
|
||||
/// AnalyticsParameterCurrency : "USD", // e.g. $5.99 USD
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterShipping NS_SWIFT_NAME(AnalyticsParameterShipping) =
|
||||
@"shipping";
|
||||
|
||||
/// The shipping tier (e.g. Ground, Air, Next-day) selected for delivery of the purchased item
|
||||
/// (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterShippingTier : "Ground",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterShippingTier NS_SWIFT_NAME(AnalyticsParameterShippingTier) =
|
||||
@"shipping_tier";
|
||||
|
||||
/// The origin of your traffic, such as an Ad network (for example, google) or partner (urban
|
||||
/// airship). Identify the advertiser, site, publication, etc. that is sending traffic to your
|
||||
/// property. Highly recommended (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterSource : "InMobi",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterSource NS_SWIFT_NAME(AnalyticsParameterSource) = @"source";
|
||||
|
||||
/// Source Platform (String). Used to identify the platform responsible for directing traffic to a
|
||||
/// given Analytics property (e.g., a buying platform where budgets, targeting criteria, etc. are
|
||||
/// set, a platform for managing organic traffic data, etc.).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterSourcePlatform : "sa360",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterSourcePlatform NS_SWIFT_NAME(AnalyticsParameterSourcePlatform) =
|
||||
@"source_platform";
|
||||
|
||||
/// The departure date, check-in date or rental start date for the item. This should be in
|
||||
/// YYYY-MM-DD format (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterStartDate : "2015-09-14",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterStartDate NS_SWIFT_NAME(AnalyticsParameterStartDate) =
|
||||
@"start_date";
|
||||
|
||||
/// The result of an operation. Specify 1 to indicate success and 0 to indicate failure (Int).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterSuccess : 1,
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterSuccess NS_SWIFT_NAME(AnalyticsParameterSuccess) = @"success";
|
||||
|
||||
/// Tax cost associated with a transaction (Double).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterTax : 2.43,
|
||||
/// AnalyticsParameterCurrency : "USD", // e.g. $2.43 USD
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterTax NS_SWIFT_NAME(AnalyticsParameterTax) = @"tax";
|
||||
|
||||
/// If you're manually tagging keyword campaigns, you should use utm_term to specify the keyword
|
||||
/// (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterTerm : "game",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterTerm NS_SWIFT_NAME(AnalyticsParameterTerm) = @"term";
|
||||
|
||||
/// The unique identifier of a transaction (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterTransactionID : "T12345",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterTransactionID NS_SWIFT_NAME(AnalyticsParameterTransactionID) =
|
||||
@"transaction_id";
|
||||
|
||||
/// Travel class (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterTravelClass : "business",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterTravelClass NS_SWIFT_NAME(AnalyticsParameterTravelClass) =
|
||||
@"travel_class";
|
||||
|
||||
/// A context-specific numeric value which is accumulated automatically for each event type. This is
|
||||
/// a general purpose parameter that is useful for accumulating a key metric that pertains to an
|
||||
/// event. Examples include revenue, distance, time and points. Value should be specified as Int or
|
||||
/// Double.
|
||||
/// Notes: Values for pre-defined currency-related events (such as @c AnalyticsEventAddToCart)
|
||||
/// should be supplied using Double and must be accompanied by a @c AnalyticsParameterCurrency
|
||||
/// parameter. The valid range of accumulated values is
|
||||
/// [-9,223,372,036,854.77, 9,223,372,036,854.77]. Supplying a non-numeric value, omitting the
|
||||
/// corresponding @c AnalyticsParameterCurrency parameter, or supplying an invalid
|
||||
/// <a href="https://goo.gl/qqX3J2">currency code</a> for conversion events will cause that
|
||||
/// conversion to be omitted from reporting.
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterValue : 3.99,
|
||||
/// AnalyticsParameterCurrency : "USD", // e.g. $3.99 USD
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterValue NS_SWIFT_NAME(AnalyticsParameterValue) = @"value";
|
||||
|
||||
/// Name of virtual currency type (String).
|
||||
/// <pre>
|
||||
/// let params = [
|
||||
/// AnalyticsParameterVirtualCurrencyName : "virtual_currency_name",
|
||||
/// // ...
|
||||
/// ]
|
||||
/// </pre>
|
||||
static NSString *const kFIRParameterVirtualCurrencyName
|
||||
NS_SWIFT_NAME(AnalyticsParameterVirtualCurrencyName) = @"virtual_currency_name";
|
||||
@ -0,0 +1,28 @@
|
||||
/// @file FIRUserPropertyNames.h
|
||||
///
|
||||
/// Predefined user property names.
|
||||
///
|
||||
/// A UserProperty is an attribute that describes the app-user. By supplying UserProperties, you can
|
||||
/// later analyze different behaviors of various segments of your userbase. You may supply up to 25
|
||||
/// unique UserProperties per app, and you can use the name and value of your choosing for each one.
|
||||
/// UserProperty names can be up to 24 characters long, may only contain alphanumeric characters and
|
||||
/// underscores ("_"), and must start with an alphabetic character. UserProperty values can be up to
|
||||
/// 36 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and should not
|
||||
/// be used.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/// Indicates whether events logged by Google Analytics can be used to personalize ads for the user.
|
||||
/// Set to "YES" to enable, or "NO" to disable. Default is enabled. See the
|
||||
/// <a href="https://firebase.google.com/support/guides/disable-analytics">documentation</a> for
|
||||
/// more details and information about related settings.
|
||||
///
|
||||
/// <pre>
|
||||
/// Analytics.setUserProperty("NO", forName: AnalyticsUserPropertyAllowAdPersonalizationSignals)
|
||||
/// </pre>
|
||||
static NSString *const kFIRUserPropertyAllowAdPersonalizationSignals
|
||||
NS_SWIFT_NAME(AnalyticsUserPropertyAllowAdPersonalizationSignals) = @"allow_personalized_ads";
|
||||
|
||||
/// The method used to sign in. For example, "google", "facebook" or "twitter".
|
||||
static NSString *const kFIRUserPropertySignUpMethod
|
||||
NS_SWIFT_NAME(AnalyticsUserPropertySignUpMethod) = @"sign_up_method";
|
||||
@ -0,0 +1,312 @@
|
||||
#if 0
|
||||
#elif defined(__arm64__) && __arm64__
|
||||
// Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
|
||||
#ifndef FIREBASEANALYTICS_SWIFT_H
|
||||
#define FIREBASEANALYTICS_SWIFT_H
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#if defined(__OBJC__)
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
#if defined(__cplusplus)
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <cstdbool>
|
||||
#include <cstring>
|
||||
#include <stdlib.h>
|
||||
#include <new>
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
#if defined(__cplusplus)
|
||||
#if defined(__arm64e__) && __has_include(<ptrauth.h>)
|
||||
# include <ptrauth.h>
|
||||
#else
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wreserved-macro-identifier"
|
||||
# ifndef __ptrauth_swift_value_witness_function_pointer
|
||||
# define __ptrauth_swift_value_witness_function_pointer(x)
|
||||
# endif
|
||||
# ifndef __ptrauth_swift_class_method_pointer
|
||||
# define __ptrauth_swift_class_method_pointer(x)
|
||||
# endif
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RUNTIME_NAME)
|
||||
# if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
# else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_COMPILE_NAME)
|
||||
# if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
# else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_METHOD_FAMILY)
|
||||
# if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
# else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_NOESCAPE)
|
||||
# if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
# else
|
||||
# define SWIFT_NOESCAPE
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RELEASES_ARGUMENT)
|
||||
# if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
# else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_WARN_UNUSED_RESULT)
|
||||
# if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
# else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_NORETURN)
|
||||
# if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
# else
|
||||
# define SWIFT_NORETURN
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_OBJC)
|
||||
# if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
# else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(__OBJC__)
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(SWIFT_EXTERN)
|
||||
# if defined(__cplusplus)
|
||||
# define SWIFT_EXTERN extern "C"
|
||||
# else
|
||||
# define SWIFT_EXTERN extern
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_CALL)
|
||||
# define SWIFT_CALL __attribute__((swiftcall))
|
||||
#endif
|
||||
#if !defined(SWIFT_INDIRECT_RESULT)
|
||||
# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result))
|
||||
#endif
|
||||
#if !defined(SWIFT_CONTEXT)
|
||||
# define SWIFT_CONTEXT __attribute__((swift_context))
|
||||
#endif
|
||||
#if !defined(SWIFT_ERROR_RESULT)
|
||||
# define SWIFT_ERROR_RESULT __attribute__((swift_error_result))
|
||||
#endif
|
||||
#if defined(__cplusplus)
|
||||
# define SWIFT_NOEXCEPT noexcept
|
||||
#else
|
||||
# define SWIFT_NOEXCEPT
|
||||
#endif
|
||||
#if !defined(SWIFT_C_INLINE_THUNK)
|
||||
# if __has_attribute(always_inline)
|
||||
# if __has_attribute(nodebug)
|
||||
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug))
|
||||
# else
|
||||
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline))
|
||||
# endif
|
||||
# else
|
||||
# define SWIFT_C_INLINE_THUNK inline
|
||||
# endif
|
||||
#endif
|
||||
#if defined(_WIN32)
|
||||
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
|
||||
# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
|
||||
# define SWIFT_IMPORT_STDLIB_SYMBOL
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__OBJC__)
|
||||
#if __has_feature(objc_modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseAnalytics",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
#if defined(__OBJC__)
|
||||
|
||||
#endif
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#if defined(__cplusplus)
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error unsupported Swift architecture
|
||||
#endif
|
||||
@ -0,0 +1,24 @@
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#ifndef FOUNDATION_EXPORT
|
||||
#if defined(__cplusplus)
|
||||
#define FOUNDATION_EXPORT extern "C"
|
||||
#else
|
||||
#define FOUNDATION_EXPORT extern
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#import "FIRAnalytics+AppDelegate.h"
|
||||
#import "FIRAnalytics+Consent.h"
|
||||
#import "FIRAnalytics+OnDevice.h"
|
||||
#import "FIRAnalytics.h"
|
||||
#import "FirebaseAnalytics.h"
|
||||
#import "FIREventNames.h"
|
||||
#import "FIRParameterNames.h"
|
||||
#import "FIRUserPropertyNames.h"
|
||||
|
||||
FOUNDATION_EXPORT double FirebaseAnalyticsVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char FirebaseAnalyticsVersionString[];
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
#import "FIRAnalytics+AppDelegate.h"
|
||||
#import "FIRAnalytics+Consent.h"
|
||||
#import "FIRAnalytics+OnDevice.h"
|
||||
#import "FIRAnalytics.h"
|
||||
#import "FIREventNames.h"
|
||||
#import "FIRParameterNames.h"
|
||||
#import "FIRUserPropertyNames.h"
|
||||
@ -0,0 +1,57 @@
|
||||
<?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>BuildMachineOSBuild</key>
|
||||
<string>23G93</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>FirebaseAnalytics</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.cocoapods.FirebaseAnalytics</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>FirebaseAnalytics</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>11.1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>iPhoneOS</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>21C52</string>
|
||||
<key>DTPlatformName</key>
|
||||
<string>iphoneos</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>17.2</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>21C52</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>iphoneos17.2</string>
|
||||
<key>DTXcode</key>
|
||||
<string>1520</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>15C500b</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>100.0</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user