Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

WIP - [Issue #408] iOS app freeze with <PaymentCardTextField /> v6 #418

Closed
wants to merge 1 commit into from

Conversation

theohdv
Copy link
Contributor

@theohdv theohdv commented Dec 14, 2018

Proposed changes

Since tipsi-stripe v6.*, <PaymentCardTextField /> freeze iOS app (#408 ).

I found that it could be related to the NSNotificationCenter used in TPSCardField.m, because by removing it, the bug seems to be fixed.

In addition, I don't know why NSNotificationCenter was used for because there was no observer for this kind of event (if I'm wrong I would like to understand what this part of code was used for).

Types of changes

What types of changes does your code introduce to tipsi-stripe?
Put an x in the boxes that apply

  • Bugfix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! Next steps are a reminder of what we are going to look at before merging your code.

  • I have added tests that prove my fix is useful or that my feature works
  • I have added necessary documentation (if appropriate)
  • I know that my PR will be merged only if it has tests and they pass

Further comments

This PR is in WIP status because I would like to be sure that removing those lines of code won't affect other part of this lib.

@theohdv theohdv changed the title WIP - v6 - iOS app freeze with <PaymentCardTextField /> WIP - [Issue #408] iOS app freeze with <PaymentCardTextField /> v6 Dec 14, 2018
@briangonzalez
Copy link

briangonzalez commented Dec 28, 2018

@theohdv Are you using this currently? If so, any issues?

@theohdv
Copy link
Contributor Author

theohdv commented Dec 29, 2018

@briangonzalez i'm not using the fix in production but when I've tried it it was working well. But removing these lines break the E2E tests, so i think it was here just for testing purpose (To be able to focus the input maybe ?).

@theohdv
Copy link
Contributor Author

theohdv commented Dec 31, 2018

@cybergrind what do you think ?

@cybergrind
Copy link
Member

@theohdv Probably it was here only for testing purposes but I believe that we need working tests to change these lines anyway.
All this seems related to RN upgrade so either we wait for someone's PR with working tests and support for recent RN versions or when we will upgrade our apps and do this work ourselves.

@theohdv
Copy link
Contributor Author

theohdv commented Jan 2, 2019

@cybergrind why do you think it is related to RN upgrade ? Because with the same version of RN (0.57.9), it works with 5.6 but not with 6.*.

@cybergrind
Copy link
Member

@theohdv https://itunes.apple.com/us/app/calvert-woodley/id1325616215?mt=8 here is one our app that is using tipsi-stripe 6.1.2 but ours RN is 0.52
We had no freezes in it. So I'm assuming that something has changed in RN since 0.52

@PvanHengel
Copy link

What is the status of this PR, I am having the same "freezing" issue which this PR fixes. We get an error along the lines of "can't find keyplane that supports..." in our xcode logs. Note this only happens when using a physical device, or a simulator with the embedded keyboard (if you attach the hardware keyboard the error doesn't happen).

@theohdv
Copy link
Contributor Author

theohdv commented Jan 7, 2019

@PvanHengel it's pending, i've found what's causing the app freeze but removing the lines affects the E2E tests. So now we have to find how to fix that without breaking the tests (or rewrite new tests).

According to @cybergrind it's due to RN upgrade. But it is not so obvious for me.

@PvanHengel
Copy link

Thanks, just for fun I tried downloading the app that @cybergrind sent a link to and it also freezes for me on my iPhone. so not sure it’s related to the rn version but the iOS version or device?

When you debug in the simulator you get a keyboard type error (not at my computer now so I dont have the exact error). I think that’s the biggest clue, I don’t see the relationship between the commented code and that. Also interesting finding is if you have other input fields on the same screen as the card input they also freeze up the app, but if you comment out the card input those fields work fine. That leads me to believe perhaps there is a change made on the R.N. or iOS side to how input field events are attached and perhaps that’s the missing link. Should prob take a look at some recent release notes and see if any changes were made there.

P

@cybergrind
Copy link
Member

@PvanHengel could you please tell us what is your device and current ios version?

@PvanHengel
Copy link

PvanHengel commented Jan 7, 2019 via email

@cybergrind
Copy link
Member

@PvanHengel thank you! seems it will be fixed sooner than expected =)

@theohdv
Copy link
Contributor Author

theohdv commented Jan 7, 2019

@PvanHengel is it the error you've seen ?

Can't find keyplane that supports type 11 for keyboard iPhone-Portrait-NumberPad; using 20587_Portrait_iPhone-Simple-Pad_Default

And for your previous comment, indeed if you have other input in the same screen and once that

[[NSNotificationCenter defaultCenter]
  addObserver:self
    selector:@selector(keyboardWillShow:)
    name:UIKeyboardWillShowNotification
    object:self.window];

is instantiated, the keyboardWillShow event will make the app freezing.

@PvanHengel
Copy link

PvanHengel commented Jan 7, 2019 via email

@LRNZ09
Copy link

LRNZ09 commented Jan 15, 2019

I'm also having this issue with version 7.1.0

@cybergrind
Copy link
Member

@LRNZ09 right now removing focus from CC field before navigating anywhere should help.
We haven't found a correct way to fix this

@bamdadd
Copy link

bamdadd commented Jan 16, 2019

We have the same problem with React native 0.57.7 with tipsi-stripe 6.1.2+ . iOS app freezes I think it might be related to numeric keyboard ( at least on the simulator )

@freakyfelt
Copy link

@LRNZ09 right now removing focus from CC field before navigating anywhere should help.
We haven't found a correct way to fix this

What's the easiest way to remove focus from the input field? We are implementing a custom component to scan a card and then inject those details into this component, however the focus freeze is definitely a blocker.

@theohdv theohdv closed this Mar 18, 2019
@theohdv theohdv deleted the bug/v6-ios-lock branch March 18, 2019 14:03
@ashfurrow
Copy link

@theohdv may I ask why this PR was closed? We're seeing the bug described in #408 and this PR does fix the bug; is there any reason we wouldn't want to ship with this PR's change? Thanks so much!

@theohdv
Copy link
Contributor Author

theohdv commented May 24, 2019

@ashfurrow the reason is that my PR was breaking appium e2e test. I think test expects input to be focused at render time. i have some time today so i'm going to check if i can change that.

Any help is appreciated :)

@ashfurrow
Copy link

Okay, thanks! I've taken a look through the code and the biggest question for me is: why is the code resigning first responder when the keyboard shows? I've looked through the git history but it seems this is just the way that tipsi-stripe was always implemented. I'll keep poking at it – thanks again 🙇

@rvera
Copy link

rvera commented Jun 6, 2019

Just want to +1 this issue, happens to me a lot in my project.

@DarkKnight1992
Copy link

@theohdv did you ever find a fix for it ?

@theohdv
Copy link
Contributor Author

theohdv commented Jun 11, 2019

Yes this PR was fixing the bug

@DarkKnight1992
Copy link

Yes this PR was fixing the bug

what about the keyboard then it doesn't close at all on the card input at all ??? Any solution for that ??

@bramski
Copy link
Contributor

bramski commented Aug 8, 2019

Okay how can we move this along? I have to update to RN 0.59 to get the 64 bit support and now tipsi-stripe is broken due to the issue this fixes.

@bramski bramski mentioned this pull request Aug 8, 2019
7 tasks
@ParryGao
Copy link

ParryGao commented Sep 18, 2019

I have other input in the same screen, currently switch to then will have a error:
Can't find keyplane that supports type 11 for keyboard iPhone-Portrait-NumberPad; using 20587_Portrait_iPhone-Simple-Pad_Default
the keyboard can not dismiss

use 8.0.0-beta.6

@UmeshBaldaniya46
Copy link

Issue :- Can't find keyplane that supports type 11 for keyboard iPhone-PortraitChoco-NumberPad; using 25686_PortraitChoco_iPhone-Simple-Pad_Default

app goes to freeze

"react": "16.8.6",
"react-native": "0.60.5",
"tipsi-stripe": "^7.5.1" -> latest version 

Only happens in iOS, in android work well

Code :-
<PaymentCardTextField
ref={ref => this.paymentView = ref}
accessible={false}
style={styles.field}
onParamsChange={this.handleFieldParamsChange}
numberPlaceholder="XXXX XXXX XXXX XXXX"
expirationPlaceholder="MM/YY"
cvcPlaceholder="CVS"
{...testID('cardTextField')}
/>

If issues is still there why ticket is closed ?

Any one can help me to resolved this one

@bohachevskyy
Copy link

Thank you @theohdv for a great fix! But it seems this PR is still not available in master. So the production version 7.5.1 still has this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.