Skip to content

Commit

Permalink
fix: ios fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Dec 9, 2024
1 parent fd943a3 commit 2c9d036
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ enum ConfigurationError: Error {
case invalidFormat(String)
}

let firebaseInAppMessagingDirectory = String(URL(string: #file)!.deletingLastPathComponent().absoluteString
let firebaseInAppMessagingDirectory = String(URL(string: #file)!.deletingLastPathComponent()
.absoluteString
.dropLast())

func loadFirebaseSDKVersion() throws -> String {
Expand All @@ -34,7 +35,12 @@ func loadFirebaseSDKVersion() throws -> String {
}

func loadPubspecVersions() throws -> (packageVersion: String, firebaseCoreVersion: String) {
let pubspecPath = NSString.path(withComponents: [firebaseInAppMessagingDirectory, "..", "..", "pubspec.yaml"])
let pubspecPath = NSString.path(withComponents: [
firebaseInAppMessagingDirectory,
"..",
"..",
"pubspec.yaml",
])
do {
let yamlString = try String(contentsOfFile: pubspecPath, encoding: .utf8)
let lines = yamlString.split(separator: "\n")
Expand Down Expand Up @@ -98,7 +104,7 @@ let package = Package(
.target(
name: "firebase_in_app_messaging",
dependencies: [
.product(name: "FirebaseInAppMessaging", package: "firebase-ios-sdk"),
.product(name: "FirebaseInAppMessaging-Beta", package: "firebase-ios-sdk"),
// Wrapper dependency
.product(name: "firebase-core-shared", package: "flutterfire"),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@

#import "FirebaseInAppMessagingPlugin.h"

#import <Firebase/Firebase.h>
@import FirebaseInAppMessaging;

#if __has_include(<firebase_core/FLTFirebasePluginRegistry.h>)
#import <firebase_core/FLTFirebasePluginRegistry.h>
#else
#import <FLTFirebasePluginRegistry.h>
#endif

NSString *const kFLTFirebaseInAppMessagingChannelName =
@"plugins.flutter.io/firebase_in_app_messaging";
Expand Down Expand Up @@ -53,11 +58,11 @@ - (NSDictionary *_Nonnull)pluginConstantsForFIRApp:(FIRApp *)firebase_app {
}

- (NSString *_Nonnull)firebaseLibraryName {
return LIBRARY_NAME;
return @LIBRARY_NAME;
}

- (NSString *_Nonnull)firebaseLibraryVersion {
return LIBRARY_VERSION;
return @LIBRARY_VERSION;
}

- (NSString *_Nonnull)flutterChannelName {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
#import <TargetConditionals.h>

#import <Foundation/Foundation.h>

#if __has_include(<firebase_core/FLTFirebasePlugin.h>)
#import <firebase_core/FLTFirebasePlugin.h>
#else
#import <FLTFirebasePlugin.h>
#endif

@interface FirebaseInAppMessagingPlugin : FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin>
@end

0 comments on commit 2c9d036

Please sign in to comment.