-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Reorganize FIAM's Resources for FIAM #7788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Coverage ReportAffected SDKs
Test Logs
|
|
@ncooke3 One option that seems to be worth trying if other approaches fail:
|
This reverts commit 7b10d84.
|
I see 🟢 I'll run tests on this today and approve if we're looking good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice way to eliminate complexity from the problem!
FirebaseInAppMessaging/iOS/include/FirebaseInAppMessaging_iOS.h
Outdated
Show resolved
Hide resolved
|
We're looking good. FIAM still works on iOS and tvOS via CocoaPods. FIAM iOS works via Swift Package Manager, not for tvOS though (SPM). @ncooke3 this is expected, right? |
|
Tested this on SPM and CocoaPods for iOS and tvOS. Everything's working. |
| #import <Foundation/Foundation.h> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already imported in the header file.
| #import "FirebaseInAppMessaging/Sources/DefaultUI/Modal/FIRIAMModalViewController.h" | ||
| #import "FirebaseInAppMessaging/Sources/Private/Util/FIRIAMTimeFetcher.h" | ||
| #import "FirebaseInAppMessaging/Sources/Public/FirebaseInAppMessaging/FIRInAppMessaging.h" | ||
| #import "FirebaseInAppMessaging/Sources/Public/FirebaseInAppMessaging/FIRInAppMessagingRendering.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another duplicate import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
FIAM was not working on SPM because the resource bundle was not generating.
There was a lot of experimentation here so I wanted to make note of some realizations/learnings:
• In order for SPM to generate a bundle for a target, the target's resources need to be in the target's
Sourcesdirectory.• The Package manifest will attempt to compile and build all targets (an issue for targets with platform-specific resources).
• FIAM only provides default UI implementations for iOS (so I've removed the blank tvOS storyboard)
• SPM generates target bundles in a single directory. So if
target Bis listed as a dependency oftarget Aand both targets definesresourcesin their declarations, then SPM will generate aTarget_B.bundleand aTarget_A.bundleat the same directory level (this was against my intuition as I thought target B's bundle would be within target A's bundle since A depends on B).Note on SPM & platform specific resources:
• There currently isn't a clear cut way to define platform specific resources. See the conversation on the Swift forums here. The workaround here is to do something similar to what was done in SPM for Analytics by creating a new target containing FIAM's iOS resources that is conditionally depended on in the primary FIAM target.
Future work:
Translating FIAM's default UI implementations from storyboards to programmatic UIKit should make this type of problem easier to fix in the future because we can use preprocessor directives (which we can't use in storyboards). Plus, programmatic UI's should be easier to maintain and update.
Fixes #7715.