Skip to content
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

[Issue] [iPhone X] Notification banner is too short, doesn't extend down far enough to display title. #49

Closed
harrytutorful opened this issue Jun 5, 2018 · 20 comments

Comments

@harrytutorful
Copy link

harrytutorful commented Jun 5, 2018

Hi there!

I just started testing on iPhone X and noticed that the top banner (when no nav bar is present) doesn't extend down far enough to show the title and description properly.

This is obviously due to the weird new height measurements of iPhone X's nav bar but I was wondering if this is already a solved issue or if there's something I should be specifically doing to solve this?

Thanks!

This is the code I'm using:

[RMessage showNotificationWithTitle:@"Important account change"
                               subtitle:@"You have been logged out due to an important account change."
                                   type:RMessageTypeCustom
                         customTypeName:mProfileStyleKey
                               callback:nil];
@isadon
Copy link
Owner

isadon commented Jun 5, 2018

Does the issue happen on the simulator or the actual device? Can you also post a screenshot?

@harrytutorful
Copy link
Author

screen shot 2018-06-06 at 09 29 03 2

This is just on simulator, as I don't have an X to hand.

@isadon
Copy link
Owner

isadon commented Jun 7, 2018

Are you sure you are using the latest release? Can you please test on master and the develop branch and tell me your results.

@harrytutorful
Copy link
Author

Just tried develop branch, and I was already using master branch on 2.3.0.

Same result I'm afraid.

pod 'RMessage', :git => 'https://github.com/donileo/RMessage.git', :branch => 'develop'

@isadon
Copy link
Owner

isadon commented Jun 8, 2018

Can you post a sample project inducing the issue for you? That’s the quickest way for me to check why this issue occurs for you.

@afrizal7
Copy link

I also experienced this problem. On iPhone X, when the navigation bar is hidden, the notification banner would not be displayed properly. I tested this on the simulator, and I use version 2.3.1.

@sssandyad
Copy link

sssandyad commented Jul 16, 2018

@donileo this can easily reproduce on iPhone X simulator while the navigation bar is hidden
screen shot 2018-07-16 at 14 50 20 2

while the navigation bar is not hidden, it would display correctly
screen shot 2018-07-16 at 14 52 06 2

@isadon
Copy link
Owner

isadon commented Jul 21, 2018

@sssandyad I am not seeing this issue on my end. Can you guys send a sample project.

@sssandyad
Copy link

Hi @donileo,
After further investigation, I found out that the problem is from our own project. I solved it already :)
Thanks!

@harrytutorful
Copy link
Author

Oo @sssandyad what did you find to be the solution if you don't mind?

@sssandyad
Copy link

sssandyad commented Jul 23, 2018

@harrytutorful I created simple project (https://github.com/sssandyad/testRMessage) as an example to reproduce the bug. But as @donileo said, It can't be reproduced.

So I suspected the problem is from our side and it must be related to auto layout stuff and yet I am aware that there are some hacky codes to updating layout view in our project.

I found out that when the navigation bar is hidden, RMessage will be subview of view from view controller
screen shot 2018-07-23 at 19 24 07

while the navigation bar is not hidden, RMessage will be subview of UILayoutContainerView from navigation controller
screen shot 2018-07-23 at 19 20 47

It's rather hacky but here the solutions I can propose for you:

  1. override viewDidLayoutSubview, get RMessageView from there and set its frame origin y position, or
  2. override viewDidLayoutSubview, get RMessageView from there and remove constraints and set it again with the appropriate constraint

@isadon
Copy link
Owner

isadon commented Jul 23, 2018

@sssandyad Without any changes to your project (without the supposed fix you posted above). Who is the parent view of RMessage for you in your project in the case when the issue happens?

@harrytutorful Same question to you.

@sssandyad
Copy link

@donileo it is the same as the sample project. The parent view is view from view controller
screen shot 2018-07-24 at 10 33 49

@isadon
Copy link
Owner

isadon commented Jul 25, 2018

Can you guys tell me what the safeAreaInsets property of your view controller's view is right before calling RMessage to present on it?

You can call a line like this to show what I need:

NSLog(@"insets are: %@", NSStringFromUIEdgeInsets(yourViewControllerHere.view.safeAreaInsets));

Also when are you calling RMessage to present in your view controller? RMessage depends on the safeAreaInsets property of your view to properly present and decide how big to size itself. But according to the Apple docs the safeAreaInsets property might be 0 (which would cause the issue you are seeing) if your view hasn't been fully presented when calling RMessage. That may be the reason why this is happening.

@sssandyad
Copy link

sssandyad commented Jul 27, 2018

@donileo in my case, the view controller has feature that when user scrolling down, it will hides navigation bar and when user scrolling up, it will shows the navigation bar. The problem is while RMessage is displaying and I scroll it up or down, the RMessage layout will be broken. My question is why RMessage parent view is different in case of show/hide navigation bar? Is that expected?

@isadon
Copy link
Owner

isadon commented Aug 2, 2018

@donileo in my case, the view controller has feature that when user scrolling down, it will hides navigation bar and when user scrolling up, it will shows the navigation bar. The problem is while RMessage is displaying and I scroll it up or down, the RMessage layout will be broken. My question is why RMessage parent view is different in case of show/hide navigation bar? Is that expected?

@sssandyad I think your specific case is a bit more different. When RMessage presents it binds to the navigation bar using auto layout, given that in your scenario you are dynamically moving your Navigation bar around its most likely tripping RMessage somehow. This is most likely an RMessage bug but for me to fix it the fastest way would be to send me an Xcode project showing the issue. Doing this will just help me save time fixing the problem considering I’m very busy with other dev things right now.

If you guys cant duplicate the issue in an xcodeproj then you will really really have to give me some time to properly diagnose and fix the root cause of how this issue is occurring for you. Rest assured though I really want to fix this 🙂.

@isadon
Copy link
Owner

isadon commented Aug 4, 2018

@sssandyad there should be some coming changes that will probably fix this soon!

@isadon
Copy link
Owner

isadon commented Aug 4, 2018

@sssandyad @harrytutorful Ok. Please test develop and tell me if this issue still exists for you. I believe cf0473f should do something 😀.

@sssandyad
Copy link

Awesome! It works like a charm. Thanks 😄 @donileo

@isadon
Copy link
Owner

isadon commented Aug 19, 2018

Closing Issue. If not truly fixed feel free to reopen.

@isadon isadon closed this as completed Aug 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants