Skip to content

Commit

Permalink
Update to Firebase iOS 8.4.0 https://github.com/firebase/firebase-ios…
Browse files Browse the repository at this point in the history
…-sdk/releases/tag/8.4.0

+ added utility to re-generate lib archives
  • Loading branch information
ufna committed Jul 30, 2021
1 parent 87f54cb commit 9e85acc
Show file tree
Hide file tree
Showing 37 changed files with 262 additions and 138 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/Intermediate/
/Binaries/
.DS_Store

/Tools/venv/
/Tools/Libraries/
/Tools/*.zip
/Tools/.idea/
103 changes: 6 additions & 97 deletions Source/PrFirebase/External/iOS/Firebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#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
Expand All @@ -42,12 +46,6 @@
#if __has_include(<FirebaseDynamicLinks/FirebaseDynamicLinks.h>)
#import <FirebaseDynamicLinks/FirebaseDynamicLinks.h>
#if TARGET_OS_IOS && !__has_include(<FirebaseAnalytics/FirebaseAnalytics.h>)
#ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#warning "FirebaseAnalytics.framework is not included in your target. Please add the \
FirebaseAnalytics dependency to your project to ensure Firebase Dynamic Links works as intended."
#endif // #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#endif
#endif
#if __has_include(<FirebaseFirestore/FirebaseFirestore.h>)
Expand All @@ -60,117 +58,28 @@ FirebaseAnalytics dependency to your project to ensure Firebase Dynamic Links wo
#if __has_include(<FirebaseInAppMessaging/FirebaseInAppMessaging.h>)
#import <FirebaseInAppMessaging/FirebaseInAppMessaging.h>
#if TARGET_OS_IOS && !__has_include(<FirebaseAnalytics/FirebaseAnalytics.h>)
#ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#warning "FirebaseAnalytics.framework is not included in your target. Please add the \
FirebaseAnalytics dependency to your project to ensure Firebase In App Messaging works as intended."
#endif // #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#endif
#endif
#if __has_include(<FirebaseInstanceID/FirebaseInstanceID.h>)
#import <FirebaseInstanceID/FirebaseInstanceID.h>
#if __has_include(<FirebaseInstallations/FirebaseInstallations.h>)
#import <FirebaseInstallations/FirebaseInstallations.h>
#endif
#if __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
#import <FirebaseMessaging/FirebaseMessaging.h>
#if TARGET_OS_IOS && !__has_include(<FirebaseAnalytics/FirebaseAnalytics.h>)
#ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#warning "FirebaseAnalytics.framework is not included in your target. Please add the \
FirebaseAnalytics dependency to your project to ensure Messaging works as intended."
#endif // #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#endif
#endif
#if __has_include(<FirebaseMLCommon/FirebaseMLCommon.h>)
#import <FirebaseMLCommon/FirebaseMLCommon.h>
#endif
#if __has_include(<FirebaseMLModelInterpreter/FirebaseMLModelInterpreter.h>)
#import <FirebaseMLModelInterpreter/FirebaseMLModelInterpreter.h>
#endif
#if __has_include(<FirebaseMLNLLanguageID/FirebaseMLNLLanguageID.h>)
#import <FirebaseMLNLLanguageID/FirebaseMLNLLanguageID.h>
#endif
#if __has_include(<FirebaseMLNLSmartReply/FirebaseMLNLSmartReply.h>)
#import <FirebaseMLNLSmartReply/FirebaseMLNLSmartReply.h>
#endif
#if __has_include(<FirebaseMLNLTranslate/FirebaseMLNLTranslate.h>)
#import <FirebaseMLNLTranslate/FirebaseMLNLTranslate.h>
#endif
#if __has_include(<FirebaseMLNaturalLanguage/FirebaseMLNaturalLanguage.h>)
#import <FirebaseMLNaturalLanguage/FirebaseMLNaturalLanguage.h>
#endif
#if __has_include(<FirebaseMLVision/FirebaseMLVision.h>)
#import <FirebaseMLVision/FirebaseMLVision.h>
#endif
#if __has_include(<FirebaseMLVisionAutoML/FirebaseMLVisionAutoML.h>)
#import <FirebaseMLVisionAutoML/FirebaseMLVisionAutoML.h>
#endif
#if __has_include(<FirebaseMLVisionBarcodeModel/FirebaseMLVisionBarcodeModel.h>)
#import <FirebaseMLVisionBarcodeModel/FirebaseMLVisionBarcodeModel.h>
#endif
#if __has_include(<FirebaseMLVisionFaceModel/FirebaseMLVisionFaceModel.h>)
#import <FirebaseMLVisionFaceModel/FirebaseMLVisionFaceModel.h>
#endif
#if __has_include(<FirebaseMLVisionLabelModel/FirebaseMLVisionLabelModel.h>)
#import <FirebaseMLVisionLabelModel/FirebaseMLVisionLabelModel.h>
#endif
#if __has_include(<FirebaseMLVisionObjectDetection/FirebaseMLVisionObjectDetection.h>)
#import <FirebaseMLVisionObjectDetection/FirebaseMLVisionObjectDetection.h>
#endif
#if __has_include(<FirebaseMLVisionTextModel/FirebaseMLVisionTextModel.h>)
#import <FirebaseMLVisionTextModel/FirebaseMLVisionTextModel.h>
#endif
#if __has_include(<FirebasePerformance/FirebasePerformance.h>)
#import <FirebasePerformance/FirebasePerformance.h>
#if TARGET_OS_IOS && !__has_include(<FirebaseAnalytics/FirebaseAnalytics.h>)
#ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#warning "FirebaseAnalytics.framework is not included in your target. Please add the \
FirebaseAnalytics dependency to your project to ensure Firebase Performance works as intended."
#endif // #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#endif
#endif
#if __has_include(<FirebaseRemoteConfig/FirebaseRemoteConfig.h>)
#import <FirebaseRemoteConfig/FirebaseRemoteConfig.h>
#if TARGET_OS_IOS && !__has_include(<FirebaseAnalytics/FirebaseAnalytics.h>)
#ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#warning "FirebaseAnalytics.framework is not included in your target. Please add the \
FirebaseAnalytics dependency to your project to ensure Firebase Remote Config works as intended."
#endif // #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
#endif
#endif
#if __has_include(<FirebaseStorage/FirebaseStorage.h>)
#import <FirebaseStorage/FirebaseStorage.h>
#endif
#if __has_include(<GoogleMobileAds/GoogleMobileAds.h>)
#import <GoogleMobileAds/GoogleMobileAds.h>
#endif
#if __has_include(<Fabric/Fabric.h>)
#import <Fabric/Fabric.h>
#endif
#if __has_include(<Crashlytics/Crashlytics.h>)
#import <Crashlytics/Crashlytics.h>
#endif
#endif // defined(__has_include)
// clang-format on
13 changes: 13 additions & 0 deletions Source/PrFirebase/PrFirebase.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ public PrFirebase(ReadOnlyTargetRules Target) : base(Target)
bool bFirebaseRemoteConfigEnable = false;
bool bFirebaseAuthEnable = false;
bool bFirebasePerformanceEnable = false;
bool bFirebaseAppDistributionEnable = false;

EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseEnable", out bFirebaseEnable);
EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseCrashlyticsEnable", out bFirebaseCrashlyticsEnable);
EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseRemoteConfigEnable", out bFirebaseRemoteConfigEnable);
EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseAuthEnable", out bFirebaseAuthEnable);
EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebasePerformanceEnable", out bFirebasePerformanceEnable);
EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseAppDistributionEnable", out bFirebaseAppDistributionEnable);

PrivateIncludePaths.AddRange(
new string[] {
Expand Down Expand Up @@ -214,6 +216,16 @@ public PrFirebase(ReadOnlyTargetRules Target) : base(Target)
);
}

if(bFirebaseAppDistributionEnable)
{
PublicAdditionalFrameworks.Add(
new Framework(
"FirebaseAppDistribution",
"../../ThirdParty/iOS/FirebaseAppDistribution.embeddedframework.zip"
)
);
}

PublicSystemLibraries.Add("sqlite3");

PrivateIncludePaths.Add("PrFirebase/External/iOS");
Expand Down Expand Up @@ -244,6 +256,7 @@ public PrFirebase(ReadOnlyTargetRules Target) : base(Target)
PublicDefinitions.Add("WITH_FIREBASE_AUTH=" + (bFirebaseEnable && bFirebaseAuthEnable ? "1" : "0"));
PublicDefinitions.Add("WITH_FIREBASE_PERFORMANCE=" + (bFirebaseEnable && bFirebasePerformanceEnable ? "1" : "0"));
PublicDefinitions.Add("WITH_FIREBASE_SYMBOLS_WARNING=" + (bFirebaseEnable && bSymbolsWarning ? "1" : "0"));
PublicDefinitions.Add("WITH_FIREBASE_APPDISTRIBUTION=" + (bFirebaseEnable && bFirebaseAppDistributionEnable ? "1" : "0"));

PublicDefinitions.Add("FIREBASE_LOGGING=" + (bFirebaseLoggingInShipping ? "1" : "0"));
}
Expand Down
12 changes: 12 additions & 0 deletions Source/PrFirebase/Private/PrFirebaseProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

#include "PrFirebaseProxy.h"

#include "PrFirebaseAppDistributionModule.h"
#include "PrFirebaseAuthModule.h"
#include "PrFirebaseCrashlyticsModule.h"
#include "PrFirebaseDefines.h"
#include "PrFirebasePerformanceModule.h"
#include "PrFirebaseRemoteConfigModule.h"
#include "PrFirebaseSettings.h"

UPrFirebaseProxy::UPrFirebaseProxy(const FObjectInitializer& ObjectInitializer)
Expand Down Expand Up @@ -35,6 +40,12 @@ UPrFirebaseAuthModule* UPrFirebaseProxy::GetAuthModule() const
return CastChecked<UPrFirebaseAuthModule>(Modules.FindChecked(UPrFirebaseAuthModule::StaticClass()));
}

UPrFirebaseAppDistributionModule* UPrFirebaseProxy::GetAppDistributionModule() const
{
check(bInitialized);
return CastChecked<UPrFirebaseAppDistributionModule>(Modules.FindChecked(UPrFirebaseAppDistributionModule::StaticClass()));
}

void UPrFirebaseProxy::InitializeFirebase()
{
if (!bInitialized)
Expand Down Expand Up @@ -63,6 +74,7 @@ void UPrFirebaseProxy::InitializeModuleList()
ModuleClasses.Add(UPrFirebaseCrashlyticsModule::StaticClass(), UPrFirebaseCrashlyticsModule::StaticClass());
ModuleClasses.Add(UPrFirebasePerformanceModule::StaticClass(), UPrFirebasePerformanceModule::StaticClass());
ModuleClasses.Add(UPrFirebaseAuthModule::StaticClass(), UPrFirebaseAuthModule::StaticClass());
ModuleClasses.Add(UPrFirebaseAppDistributionModule::StaticClass(), UPrFirebaseAppDistributionModule::StaticClass());
}

void UPrFirebaseProxy::Initialize()
Expand Down
1 change: 1 addition & 0 deletions Source/PrFirebase/Private/PrFirebaseSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ UPrFirebaseSettings::UPrFirebaseSettings(const FObjectInitializer& ObjectInitial
, bFirebasePerformanceEnable(false)
, FirebasePerformance_SyncTime(2.f)
, FirebasePerformance_MemSyncTime(10.f)
, bFirebaseAppDistributionEnable(false)
{
FirebaseCrashlytics_ForcedLogCategories.Add("LogCrashlytics");
FirebaseCrashlytics_ForcedLogCategories.Add("LogPerformance");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2020-2021 Vladimir Alyamkin. All Rights Reserved.

#include "iOS/PrFirebaseAppDistributionModule_iOS.h"

#include "PrFirebaseDefines.h"

#if WITH_FIREBASE_APPDISTRIBUTION && PLATFORM_IOS
#include "IOSAppDelegate.h"

#import <Firebase.h>

void UPrFirebaseAppDistributionModule_iOS::CheckForUpdate()
{
// Sign in a tester without automatically checking for update
if(![[FIRAppDistribution appDistribution] isTesterSignedIn]) {
[[FIRAppDistribution appDistribution]
signInTesterWithCompletion:^(NSError *_Nullable error) {
if (error) {
NSLog(@"Firebase: SignIn failed");
return;
}
}];
}

// Only check for update if tester is already signed in - do not prompt
if([[FIRAppDistribution appDistribution] isTesterSignedIn]) {
[[FIRAppDistribution appDistribution]
checkForUpdateWithCompletion:^(FIRAppDistributionRelease *_Nullable release,
NSError *_Nullable error) {
if (error) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Check For Update"
message:[NSString stringWithFormat:@"Error during tester sign in! %@", error.localizedDescription]
preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {}];

[alert addAction:okAction];
[[IOSAppDelegate GetDelegate].IOSController presentViewController:alert animated:YES completion:nil];

return;
}

if (release) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"New Version Available"
message:[NSString stringWithFormat:@"Version %@ (%@) is available.", release.displayVersion,
release.buildVersion] preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *updateAction = [UIAlertAction actionWithTitle:@"Update"
style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[[UIApplication sharedApplication] openURL:release.downloadURL options:@{} completionHandler:nil];
}];

UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel"
style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {}];

[alert addAction:updateAction];
[alert addAction:cancelAction];

[[IOSAppDelegate GetDelegate].IOSController presentViewController:alert animated:YES completion:nil];
}
}];
}
}

#endif // WITH_FIREBASE_CRASHLYTICS && PLATFORM_IOS
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2020-2021 Vladimir Alyamkin. All Rights Reserved.

#pragma once

#include "PrFirebaseAppDistributionModule.h"

#include "PrFirebaseAppDistributionModule_iOS.generated.h"

UCLASS()
class UPrFirebaseAppDistributionModule_iOS : public UPrFirebaseAppDistributionModule
{
GENERATED_BODY()

#if WITH_FIREBASE_APPDISTRIBUTION && PLATFORM_IOS

public:
virtual void CheckForUpdate() override;

#endif
};
2 changes: 2 additions & 0 deletions Source/PrFirebase/Private/iOS/PrFirebase_iOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "iOS/PrFirebaseCrashlyticsModule_iOS.h"
#include "iOS/PrFirebasePerformanceModule_iOS.h"
#include "iOS/PrFirebaseRemoteConfigModule_iOS.h"
#include "iOS/PrFirebaseAppDistributionModule_iOS.h"

#import <Firebase.h>

Expand All @@ -18,6 +19,7 @@ void UPrFirebase_iOS::InitializeModuleList()
ModuleClasses.Add(UPrFirebaseCrashlyticsModule::StaticClass(), UPrFirebaseCrashlyticsModule_iOS::StaticClass());
ModuleClasses.Add(UPrFirebasePerformanceModule::StaticClass(), UPrFirebasePerformanceModule_iOS::StaticClass());
ModuleClasses.Add(UPrFirebaseAuthModule::StaticClass(), UPrFirebaseAuthModule_iOS::StaticClass());
ModuleClasses.Add(UPrFirebaseAppDistributionModule_iOS::StaticClass(), UPrFirebaseAppDistributionModule_iOS::StaticClass());
}

void UPrFirebase_iOS::Initialize()
Expand Down
19 changes: 19 additions & 0 deletions Source/PrFirebase/Public/PrFirebaseAppDistributionModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2020-2021 Vladimir Alyamkin. All Rights Reserved.

#pragma once

#include "PrFirebaseModule.h"

#include "PrFirebaseDefines.h"

#include "PrFirebaseAppDistributionModule.generated.h"

UCLASS()
class PRFIREBASE_API UPrFirebaseAppDistributionModule : public UPrFirebaseModule
{
GENERATED_BODY()

public:
UFUNCTION(BlueprintCallable, Category = "Firebase|Distribution")
virtual void CheckForUpdate() { Firebase_NotImplemented(); }
};
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

#pragma once

#include "PrFirebaseAuthModule.h"
#include "PrFirebaseCrashlyticsModule.h"
#include "PrFirebasePerformanceModule.h"
#include "PrFirebaseRemoteConfigModule.h"

#include "PrFirebaseProxy.generated.h"

class UPrFirebaseModule;
class UPrFirebaseCrashlyticsModule;
class UPrFirebaseRemoteConfigModule;
class UPrFirebasePerformanceModule;
class UPrFirebaseAuthModule;
class UPrFirebaseAppDistributionModule;

UCLASS()
class PRFIREBASE_API UPrFirebaseProxy : public UObject
Expand All @@ -29,6 +29,9 @@ class PRFIREBASE_API UPrFirebaseProxy : public UObject
UFUNCTION(BlueprintCallable, Category = "Firebase|Auth")
UPrFirebaseAuthModule* GetAuthModule() const;

UFUNCTION(BlueprintCallable, Category = "Firebase|Distribution")
UPrFirebaseAppDistributionModule* GetAppDistributionModule() const;

UFUNCTION(BlueprintCallable, Category = "Firebase")
void InitializeFirebase();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@ class UPrFirebaseSettings : public UObject
/* Time between sending memory information (sec) */
UPROPERTY(Config, EditAnywhere, Category = "Firebase|Performance")
float FirebasePerformance_MemSyncTime;

/* Enable distribution module */
UPROPERTY(Config, EditAnywhere, Category = "Firebase|Distribution")
bool bFirebaseAppDistributionEnable;
};
Loading

0 comments on commit 9e85acc

Please sign in to comment.