firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.51k stars 1.44k forks source link

Firebase In-App Message Portrait Rotation Possible Despite App Only Supporting Landscape View #13265

Closed GSRicky closed 1 week ago

GSRicky commented 1 month ago

Description

Our app is locked to landscape orientations only but In-app Messages auto-rotate to portrait when the device is stood upright.

We are unsure if this is a bug or if we can modify this behavior manually. We would appreciate any method to disable the portrait layout for IAMs.

Reproducing the issue

  1. Install Firebase Messaging via
  2. In Xcode (Target > General > Deployment Info), only Landscape Left and Landscape Right are enabled.*
  3. Display any in-app message
  4. Rotate screen
  5. [Issue] The in-app message rotates into a portrait orientation. It is expected that the in-app message maintains the landscape layout, the same as all other app content.

*This Xcode project is produced in Unity so the landscape setting is applied by Unity’s setting in PlayerSettings > iOS > Resolution and Presentation > Landscape Left & Landscape Right.

Firebase SDK Version

10.24.0

Xcode Version

15.2

Installation Method

CocoaPods

Firebase Product(s)

In-App Messaging

Targeted Platforms

iOS

Relevant Log Output

N/A

If using Swift Package Manager, the project's Package.resolved

N/A

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
```yml PODS: - AppsFlyerFramework (6.14.0): - AppsFlyerFramework/Main (= 6.14.0) - AppsFlyerFramework/Main (6.14.0) - FBAEMKit (17.0.2): - FBSDKCoreKit_Basics (= 17.0.2) - FBSDKCoreKit (17.0.2): - FBAEMKit (= 17.0.2) - FBSDKCoreKit_Basics (= 17.0.2) - FBSDKCoreKit_Basics (17.0.2) - FBSDKGamingServicesKit (17.0.2): - FBSDKCoreKit (= 17.0.2) - FBSDKCoreKit_Basics (= 17.0.2) - FBSDKShareKit (= 17.0.2) - FBSDKLoginKit (17.0.2): - FBSDKCoreKit (= 17.0.2) - FBSDKShareKit (17.0.2): - FBSDKCoreKit (= 17.0.2) - Firebase/Analytics (10.24.0): - Firebase/Core - Firebase/Core (10.24.0): - Firebase/CoreOnly - FirebaseAnalytics (~> 10.24.0) - Firebase/CoreOnly (10.24.0): - FirebaseCore (= 10.24.0) - Firebase/Crashlytics (10.24.0): - Firebase/CoreOnly - FirebaseCrashlytics (~> 10.24.0) - Firebase/InAppMessaging (10.24.0): - Firebase/CoreOnly - FirebaseInAppMessaging (~> 10.24.0-beta) - Firebase/Messaging (10.24.0): - Firebase/CoreOnly - FirebaseMessaging (~> 10.24.0) - FirebaseABTesting (10.28.0): - FirebaseCore (~> 10.0) - FirebaseAnalytics (10.24.0): - FirebaseAnalytics/AdIdSupport (= 10.24.0) - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - GoogleUtilities/MethodSwizzler (~> 7.11) - GoogleUtilities/Network (~> 7.11) - "GoogleUtilities/NSData+zlib (~> 7.11)" - nanopb (< 2.30911.0, >= 2.30908.0) - FirebaseAnalytics/AdIdSupport (10.24.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleAppMeasurement (= 10.24.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - GoogleUtilities/MethodSwizzler (~> 7.11) - GoogleUtilities/Network (~> 7.11) - "GoogleUtilities/NSData+zlib (~> 7.11)" - nanopb (< 2.30911.0, >= 2.30908.0) - FirebaseCore (10.24.0): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) - FirebaseCoreExtension (10.28.0): - FirebaseCore (~> 10.0) - FirebaseCoreInternal (10.28.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - FirebaseCrashlytics (10.24.0): - FirebaseCore (~> 10.5) - FirebaseInstallations (~> 10.0) - FirebaseRemoteConfigInterop (~> 10.23) - FirebaseSessions (~> 10.5) - GoogleDataTransport (~> 9.2) - GoogleUtilities/Environment (~> 7.8) - nanopb (< 2.30911.0, >= 2.30908.0) - PromisesObjC (~> 2.1) - FirebaseInAppMessaging (10.24.0-beta): - FirebaseABTesting (~> 10.0) - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - nanopb (< 2.30911.0, >= 2.30908.0) - FirebaseInstallations (10.28.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - PromisesObjC (~> 2.1) - FirebaseMessaging (10.24.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleDataTransport (~> 9.3) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Reachability (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - nanopb (< 2.30911.0, >= 2.30908.0) - FirebaseRemoteConfigInterop (10.28.0) - FirebaseSessions (10.28.0): - FirebaseCore (~> 10.5) - FirebaseCoreExtension (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleDataTransport (~> 9.2) - GoogleUtilities/Environment (~> 7.13) - GoogleUtilities/UserDefaults (~> 7.13) - nanopb (< 2.30911.0, >= 2.30908.0) - PromisesSwift (~> 2.1) - Google-Mobile-Ads-SDK (9.14.0): - GoogleAppMeasurement (< 11.0, >= 7.0) - GoogleUserMessagingPlatform (>= 1.1) - GoogleAppMeasurement (10.24.0): - GoogleAppMeasurement/AdIdSupport (= 10.24.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - GoogleUtilities/MethodSwizzler (~> 7.11) - GoogleUtilities/Network (~> 7.11) - "GoogleUtilities/NSData+zlib (~> 7.11)" - nanopb (< 2.30911.0, >= 2.30908.0) - GoogleAppMeasurement/AdIdSupport (10.24.0): - GoogleAppMeasurement/WithoutAdIdSupport (= 10.24.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - GoogleUtilities/MethodSwizzler (~> 7.11) - GoogleUtilities/Network (~> 7.11) - "GoogleUtilities/NSData+zlib (~> 7.11)" - nanopb (< 2.30911.0, >= 2.30908.0) - GoogleAppMeasurement/WithoutAdIdSupport (10.24.0): - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - GoogleUtilities/MethodSwizzler (~> 7.11) - GoogleUtilities/Network (~> 7.11) - "GoogleUtilities/NSData+zlib (~> 7.11)" - nanopb (< 2.30911.0, >= 2.30908.0) - GoogleDataTransport (9.4.1): - GoogleUtilities/Environment (~> 7.7) - nanopb (< 2.30911.0, >= 2.30908.0) - PromisesObjC (< 3.0, >= 1.2) - GoogleUserMessagingPlatform (2.4.0) - GoogleUtilities/AppDelegateSwizzler (7.13.3): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - GoogleUtilities/Privacy - GoogleUtilities/Environment (7.13.3): - GoogleUtilities/Privacy - PromisesObjC (< 3.0, >= 1.2) - GoogleUtilities/Logger (7.13.3): - GoogleUtilities/Environment - GoogleUtilities/Privacy - GoogleUtilities/MethodSwizzler (7.13.3): - GoogleUtilities/Logger - GoogleUtilities/Privacy - GoogleUtilities/Network (7.13.3): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Privacy - GoogleUtilities/Reachability - "GoogleUtilities/NSData+zlib (7.13.3)": - GoogleUtilities/Privacy - GoogleUtilities/Privacy (7.13.3) - GoogleUtilities/Reachability (7.13.3): - GoogleUtilities/Logger - GoogleUtilities/Privacy - GoogleUtilities/UserDefaults (7.13.3): - GoogleUtilities/Logger - GoogleUtilities/Privacy - nanopb (2.30910.0): - nanopb/decode (= 2.30910.0) - nanopb/encode (= 2.30910.0) - nanopb/decode (2.30910.0) - nanopb/encode (2.30910.0) - OneSignalXCFramework (5.1.6): - OneSignalXCFramework/OneSignalComplete (= 5.1.6) - OneSignalXCFramework/OneSignal (5.1.6): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalExtension - OneSignalXCFramework/OneSignalNotifications - OneSignalXCFramework/OneSignalOSCore - OneSignalXCFramework/OneSignalOutcomes - OneSignalXCFramework/OneSignalUser - OneSignalXCFramework/OneSignalComplete (5.1.6): - OneSignalXCFramework/OneSignal - OneSignalXCFramework/OneSignalInAppMessages - OneSignalXCFramework/OneSignalLocation - OneSignalXCFramework/OneSignalCore (5.1.6) - OneSignalXCFramework/OneSignalExtension (5.1.6): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalOutcomes - OneSignalXCFramework/OneSignalInAppMessages (5.1.6): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalNotifications - OneSignalXCFramework/OneSignalOSCore - OneSignalXCFramework/OneSignalOutcomes - OneSignalXCFramework/OneSignalUser - OneSignalXCFramework/OneSignalLocation (5.1.6): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalNotifications - OneSignalXCFramework/OneSignalOSCore - OneSignalXCFramework/OneSignalUser - OneSignalXCFramework/OneSignalNotifications (5.1.6): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalExtension - OneSignalXCFramework/OneSignalOutcomes - OneSignalXCFramework/OneSignalOSCore (5.1.6): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalOutcomes (5.1.6): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalUser (5.1.6): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalNotifications - OneSignalXCFramework/OneSignalOSCore - OneSignalXCFramework/OneSignalOutcomes - PromisesObjC (2.4.0) - PromisesSwift (2.4.0): - PromisesObjC (= 2.4.0) DEPENDENCIES: - AppsFlyerFramework (= 6.14.0) - FBSDKCoreKit (~> 17.0.1) - FBSDKCoreKit_Basics (~> 17.0.1) - FBSDKGamingServicesKit (~> 17.0.1) - FBSDKLoginKit (~> 17.0.1) - FBSDKShareKit (~> 17.0.1) - Firebase/Analytics (= 10.24.0) - Firebase/Core (= 10.24.0) - Firebase/Crashlytics (= 10.24.0) - Firebase/InAppMessaging (= 10.24.0) - Firebase/Messaging (= 10.24.0) - Google-Mobile-Ads-SDK (~> 9.0) - OneSignalXCFramework (= 5.1.6) SPEC REPOS: trunk: - AppsFlyerFramework - FBAEMKit - FBSDKCoreKit - FBSDKCoreKit_Basics - FBSDKGamingServicesKit - FBSDKLoginKit - FBSDKShareKit - Firebase - FirebaseABTesting - FirebaseAnalytics - FirebaseCore - FirebaseCoreExtension - FirebaseCoreInternal - FirebaseCrashlytics - FirebaseInAppMessaging - FirebaseInstallations - FirebaseMessaging - FirebaseRemoteConfigInterop - FirebaseSessions - Google-Mobile-Ads-SDK - GoogleAppMeasurement - GoogleDataTransport - GoogleUserMessagingPlatform - GoogleUtilities - nanopb - OneSignalXCFramework - PromisesObjC - PromisesSwift SPEC CHECKSUMS: AppsFlyerFramework: 84e73360fc5b277da2a9322281c21cc467eaf023 FBAEMKit: 619f96ea65427e8afca240d5b0f4703738dfdf5c FBSDKCoreKit: a5f384db2e9ee84e98494fed8f983d2bd79accff FBSDKCoreKit_Basics: d35c775aaf243a2d731dfae7be3a74b1987285ab FBSDKGamingServicesKit: bf02b6f115e545910b8a77bf8defaf74a7eccda1 FBSDKLoginKit: f8ca5f7ab7c4e5b93e729d94975b0db7fcc511ed FBSDKShareKit: e7ec3bed8e82dabc04e56f3cf44ef99a1864309e Firebase: 91fefd38712feb9186ea8996af6cbdef41473442 FirebaseABTesting: 589bc28c0ab3e5554336895a34aa262e24276665 FirebaseAnalytics: b5efc493eb0f40ec560b04a472e3e1a15d39ca13 FirebaseCore: 11dc8a16dfb7c5e3c3f45ba0e191a33ac4f50894 FirebaseCoreExtension: f63147b723e2a700fe0f34ec6fb7f358d6fe83e0 FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698 FirebaseCrashlytics: af38ea4adfa606f6e63fcc22091b61e7938fcf66 FirebaseInAppMessaging: a1374493c04fabef91f3ff54b818c5087b98fb67 FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e FirebaseMessaging: 4d52717dd820707cc4eadec5eb981b4832ec8d5d FirebaseRemoteConfigInterop: 70d200c6956ef3b5c3592a95e824c1210682d785 FirebaseSessions: 20da8500ad66bb12622743e170459bf62a0768e8 Google-Mobile-Ads-SDK: 4fe6304b771f8467d29978cb790ec1e56e646946 GoogleAppMeasurement: f3abf08495ef2cba7829f15318c373b8d9226491 GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleUserMessagingPlatform: f131fa7978d2ba88d7426702b057c2cc318e6595 GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 nanopb: 438bc412db1928dac798aa6fd75726007be04262 OneSignalXCFramework: f6533cc1f7a5ddded80ee5fe183901a99ad46f4f PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851 PODFILE CHECKSUM: 17b9e82890aa2b98aa4bf2da55e8d5e38177b34a COCOAPODS: 1.15.2 ```
google-oss-bot commented 1 month ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

rizafran commented 1 month ago

Hi @GSRicky, I tried to reproduce this on native iOS, but I'm not able to get the same behavior. The in-app message maintains the landscape layout when I tried to change to portrait orientation. You mentioned that your project is produced in Unity. Per checking, FIAM is not yet supported in Unity, and it's possible that it might not work.

morganchen12 commented 1 month ago

@GSRicky can you check the orientations setting in the generated Xcode project?

GSRicky commented 1 month ago

@morganchen12 @rizafran

Yes, the project is first exported by Unity but the orientation settings in Xcode seem to be correct (only landscape).

Deployment Info

We are not sure why the Unity produced Xcode project would behave any differently from a regular Xcode project. We are looking into it now and will get back with more information. Thank you for confirming that a regular project should not behave like this.

GSRicky commented 1 month ago

We have reconfirmed that our xcode project is set up to only allow landscape orientations and that there are no other related settings that allow us to modify the current behavior.

We looked briefly into the AppDelgate (“UnityAppController”) and it seems that Unity is doing a lot under-the-hood to modify the orientation behavior (among other things, the comment below suggests that portrait support is being forced).

We understand that officially Unity support is unavailable but are there any modifications we can make to FIAM to exclude portrait rotations from occurring in FIAM? Any advice would be greatly appreciated.

image

google-oss-bot commented 3 weeks ago

Hey @GSRicky. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

rizafran commented 3 weeks ago

Hi @GSRicky, I've raised this to FIAM team and I'll let you know once I got an update. Thanks.

rizafran commented 1 week ago

Thanks for waiting, @GSRicky. Per checking, given that FIAM is not yet officially supported in Unity, unfortunately, we can't do much on our end. We're also unable to reproduce this on native iOS, and setting the "Supported interface orientations" to Landscape only in Xcode is enough.

I'll now be closing this ticket, but feel free to comment if you have other questions.