Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Back text overlaps Cancel text #46

Closed
amritk opened this issue Oct 3, 2013 · 14 comments
Closed

Back text overlaps Cancel text #46

amritk opened this issue Oct 3, 2013 · 14 comments

Comments

@amritk
Copy link

amritk commented Oct 3, 2013

I'm not sure if anyone has found this already, but I just installed the latest plugin and while running on an iOS 7 simulator I get this strange overlap. Once I hit cancel and open it again its fine. Just a minor detail.

Cheers
screen shot 2013-10-03 at 6 34 33 am
screen shot 2013-10-03 at 6 38 41 am

@parkej60
Copy link

parkej60 commented Oct 3, 2013

I'm also seeing this.

@burnto
Copy link
Contributor

burnto commented Oct 3, 2013

Thanks @parkej60 and @amritk!

We'll have this fixed in an upcoming point release.

@burnto burnto closed this as completed in 3592099 Oct 8, 2013
@alex-swiftify
Copy link

I know this is pretty old, but the same still happens to me on iPhone 4 / IOS 7 in Xamarin Forms project, using PayPal bindings from https://github.com/tom-mayer/PayPalTouch, and libPayPalMobile.a library from Xamarin IOS SDK v2.9.0.

Question: what exact change in 3592099 fixed this issue?
Is it any way related to status bar appearance?

@dgoldman-pdx
Copy link
Contributor

Question: what exact change in 3592099 fixed this issue?

We slightly increased the delay (from 0.5 seconds to 0.8 seconds) between showing the previous screen and the above screen. That "previous screen" is one that you often may not notice at all; it shows a modal activity spinner while the library pre-connects to the PayPal server.

I don't know anything about Xamarin. Can you check whether our preconnectWithEnvironment: method is getting called at some point prior to our library being visibly launched? If it is, then that "previous screen" shouldn't appear at all, which might solve your problem.

@alex-swiftify
Copy link

Thanks Dave for prompt reply!

It makes sense to me a lot that this was a timing issue.
It happens to me occasionally only on iPhone 4 / IOS 7.1 - I can't reproduce it on iPhone 5s / IOS 8 or IOS Simulator (iPhone 4s / IOS 7.1) with slow animations toggle turned on.

  1. I've just disabled animations when presenting PayPalPaymentViewController - will see if I can reproduce this issue again after this change.
  2. I can see the "previous screen" that you mentioned on slow iPhone 4 very well.
  3. I can see no easy way to check if preconnectWithEnvironment: method is getting called:
    a) from the C# binding code, I see no easy way to break into that;
    b) as I see in PayPal SDK code, [ZZFlipsideViewController environmentControlDidUpdate] calls [self.delegate setPayPalEnvironment](that one calls [PayPalMobile preconnectWithEnvironment:environment] in turn) and then [self logEnvironment].
    I can't see results of logEnvironment in debug output when running my application - not sure if libPayPalMobile.a is compiled with debugging enabled.
  4. Will it be easy to increase the delay a bit more (i.e. to 1 second) and rebuild libPayPalMobile.a?
    I'd be very thankful for that!

@alex-swiftify
Copy link

P.S. Screenshot of the issue below:

photo_1

@dgoldman-pdx
Copy link
Contributor

@Crulex my first inclination is to not worry about a problem that occurs only occasionally and only on an iPhone 4. But according to this page 8% of iPhone users are still using an iPhone 4.

I think that the correct fix would be to call preconnectWithEnvironment: in the C# binding code, so that the initial screen can be bypassed. Any chance you can take a look into that? (I'm not sure when I'll have the time to.)

@alex-swiftify
Copy link

Hi Dave,

my first inclination is to not worry about a problem that occurs only occasionally and only on an iPhone 4

I got to agree with you.
I'm testing only on iPhone 4 and 5S so far, so pretty high chance this may affect at least 4S as well - but again, should be not that big deal.

Your suggestion looks good.
I'm already calling PayPalMobile.InitializeWithClientIdsForEnvironments method and passing environment to initialize (rather sandbox or production).
Should I call PayPalMobile.PreconnectWithEnvironment method before / after above one, or
InitializeWithClientIdsForEnvironments should automatically call PreconnectWithEnvironment method?

Thanks again!

@dgoldman-pdx
Copy link
Contributor

pretty high chance this may affect at least 4S as well

We were using a 4S when we made the above timing fix, so I think we're okay on that model.

@dgoldman-pdx dgoldman-pdx reopened this Mar 23, 2015
@dgoldman-pdx
Copy link
Contributor

Should I call PayPalMobile.PreconnectWithEnvironment method before / after above one, or
InitializeWithClientIdsForEnvironments should automatically call PreconnectWithEnvironment method?

See step 4 in our integration instructions:

Establish environment, and preconnect to PayPal's servers.

We recommend doing this when you first display the view controller from which your users might initiate payment. (Do not preconnect significantly earlier than that, as the connection has a limited lifetime.)

// SomeViewController.m

- (void)viewWillAppear:(BOOL)animated {
 [super viewWillAppear:animated];

 // Start out working with the test environment! When you are ready, switch to PayPalEnvironmentProduction.
 [PayPalMobile preconnectWithEnvironment:PayPalEnvironmentNoNetwork];
}

@alex-swiftify
Copy link

Thanks Dave for your help!

I've managed to call [PayPalMobile preconnectWithEnvironment] method.

  1. I had to get below environment constants from XCode debugger, since I cannot access them directly. Do below values seem correct?
    public static class PayPalEnvironment
    {
        /// <summary>
        /// PayPalEnvironmentNoNetwork constant.
        /// </summary>
        public const string NoNetwork = "mock";

        /// <summary>
        /// PayPalEnvironmentSandbox constant.
        /// </summary>
        public const string Sandbox = "sandbox";

        /// <summary>
        /// PayPalEnvironmentProduction constant.
        /// </summary>
        public const string Production = "live";
    }
  1. So far, the call to PreConnectWithEnvironment succeeds when I pass "mock" constant, otherwise with "sandbox" or "live" (and corresponding client ID passed), PreConnectWithEnvironment() method call results in a crash like below:
2015-03-24 14:49:36.329 FormsTemplateiOS[5452:60b] critical: Stacktrace:

2015-03-24 14:49:36.332 FormsTemplateiOS[5452:60b] critical:   at <unknown> <0xffffffff>
2015-03-24 14:49:36.335 FormsTemplateiOS[5452:60b] critical: 
Native stacktrace:

2015-03-24 14:49:37.914 FormsTemplateiOS[5452:60b] critical:    0   FormsTemplateiOS                    0x0127a161 mono_handle_native_sigsegv + 240
2015-03-24 14:49:37.918 FormsTemplateiOS[5452:60b] critical:    1   FormsTemplateiOS                    0x01284721 mono_sigsegv_signal_handler + 208
2015-03-24 14:49:37.921 FormsTemplateiOS[5452:60b] critical:    2   libsystem_platform.dylib            0x3b17cf93 _sigtramp + 42
2015-03-24 14:49:37.923 FormsTemplateiOS[5452:60b] critical:    3   FormsTemplateiOS                    0x01273073 mono_arch_find_jit_info + 82
2015-03-24 14:49:37.931 FormsTemplateiOS[5452:60b] critical:    4   FormsTemplateiOS                    0x01278117 mono_find_jit_info_ext + 158
2015-03-24 14:49:37.934 FormsTemplateiOS[5452:60b] critical:    5   FormsTemplateiOS                    0x01279331 mono_handle_exception_internal + 1164
2015-03-24 14:49:37.936 FormsTemplateiOS[5452:60b] critical:    6   FormsTemplateiOS                    0x01278e9f mono_handle_exception + 10
2015-03-24 14:49:37.939 FormsTemplateiOS[5452:60b] critical:    7   FormsTemplateiOS                    0x01272b23 mono_arm_throw_exception + 110
2015-03-24 14:49:37.943 FormsTemplateiOS[5452:60b] critical:    8   FormsTemplateiOS                    0x004e4910 throw_exception + 64
2015-03-24 14:49:37.947 FormsTemplateiOS[5452:60b] critical:    9   FormsTemplateiOS                    0x00268030 MonoTouch_ObjCRuntime_Runtime_throw_ns_exception_intptr + 28
2015-03-24 14:49:37.949 FormsTemplateiOS[5452:60b] critical:    10  FormsTemplateiOS                    0x002e4850 wrapper_native_to_managed_MonoTouch_ObjCRuntime_Runtime_throw_ns_exception_intptr + 68
2015-03-24 14:49:37.953 FormsTemplateiOS[5452:60b] critical:    11  FormsTemplateiOS                    0x0131d474 xamarin_throw_ns_exception + 52
2015-03-24 14:49:37.956 FormsTemplateiOS[5452:60b] critical:    12  FormsTemplateiOS                    0x0131f2c4 exception_handler + 224
2015-03-24 14:49:37.971 FormsTemplateiOS[5452:60b] critical:    13  CoreFoundation                      0x303a5287 <redacted> + 578
2015-03-24 14:49:37.974 FormsTemplateiOS[5452:60b] critical:    14  libobjc.A.dylib                     0x3ab55f53 <redacted> + 174
2015-03-24 14:49:37.979 FormsTemplateiOS[5452:60b] critical:    15  libc++abi.dylib                     0x3a40e1c7 <redacted> + 78
2015-03-24 14:49:37.982 FormsTemplateiOS[5452:60b] critical:    16  libc++abi.dylib                     0x3a40dd2d __cxa_increment_exception_refcount + 0
2015-03-24 14:49:37.985 FormsTemplateiOS[5452:60b] critical:    17  libobjc.A.dylib                     0x3ab55e17 objc_exception_rethrow + 42
2015-03-24 14:49:37.988 FormsTemplateiOS[5452:60b] critical:    18  CoreFoundation                      0x302d8f35 CFRunLoopRunSpecific + 640
2015-03-24 14:49:37.991 FormsTemplateiOS[5452:60b] critical:    19  CoreFoundation                      0x302d8ca3 CFRunLoopRunInMode + 106
2015-03-24 14:49:37.995 FormsTemplateiOS[5452:60b] critical:    20  GraphicsServices                    0x351de663 GSEventRunModal + 138
2015-03-24 14:49:37.999 FormsTemplateiOS[5452:60b] critical:    21  UIKit                               0x32c2514d UIApplicationMain + 1136
2015-03-24 14:49:38.002 FormsTemplateiOS[5452:60b] critical:    22  FormsTemplateiOS                    0x002e40b4 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 272
2015-03-24 14:49:38.005 FormsTemplateiOS[5452:60b] critical:    23  FormsTemplateiOS                    0x002881d0 MonoTouch_UIKit_UIApplication_Main_string___intptr_intptr + 52
2015-03-24 14:49:38.015 FormsTemplateiOS[5452:60b] critical:    24  FormsTemplateiOS                    0x00288190 MonoTouch_UIKit_UIApplication_Main_string___string_string + 204
2015-03-24 14:49:38.018 FormsTemplateiOS[5452:60b] critical:    25  FormsTemplateiOS                    0x00247ae0 Coffee_MobileApp_iOS_Application_Main_string__ + 172
2015-03-24 14:49:38.020 FormsTemplateiOS[5452:60b] critical:    26  FormsTemplateiOS                    0x004aadc8 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
2015-03-24 14:49:38.024 FormsTemplateiOS[5452:60b] critical:    27  FormsTemplateiOS                    0x01286923 mono_jit_runtime_invoke + 1162
2015-03-24 14:49:38.028 FormsTemplateiOS[5452:60b] critical:    28  FormsTemplateiOS                    0x012ce679 mono_runtime_invoke + 88
2015-03-24 14:49:38.031 FormsTemplateiOS[5452:60b] critical:    29  FormsTemplateiOS                    0x012d1bbf mono_runtime_exec_main + 282
2015-03-24 14:49:38.035 FormsTemplateiOS[5452:60b] critical:    30  FormsTemplateiOS                    0x012d1a07 mono_runtime_run_main + 438
2015-03-24 14:49:38.038 FormsTemplateiOS[5452:60b] critical:    31  FormsTemplateiOS                    0x012708a9 mono_jit_exec + 48
2015-03-24 14:49:38.041 FormsTemplateiOS[5452:60b] critical:    32  FormsTemplateiOS                    0x0131bf74 xamarin_main + 2172
2015-03-24 14:49:38.056 FormsTemplateiOS[5452:60b] critical:    33  FormsTemplateiOS                    0x012533c9 main + 108
2015-03-24 14:49:38.060 FormsTemplateiOS[5452:60b] critical:    34  libdyld.dylib                       0x3b062ab7 <redacted> + 2
2015-03-24 14:49:38.063 FormsTemplateiOS[5452:60b] critical: 
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Any ideas why?

If you have any quick hints please let me know.
Otherwise, I'll probably stick with not calling PreConnectWithEnvironment() method and presenting PayPal Payment View Controller without animation (at least I didn't reproduce the same problem with animation disabled yet).

@dgoldman-pdx
Copy link
Contributor

@Crulex hmm. No, I don't think I can offer any suggestions re that crash. I can't even tell what call in your code triggered the stack trace.

(If you were going to call preconnectWithEnvironment:, though, the idea would be to call it at least a few seconds prior to presenting the PayPalPaymentViewController, so that it has time to actually handshake with the PayPal server.)

@alex-swiftify
Copy link

If you were going to call preconnectWithEnvironment:, though, the idea would be to call it at least a
few seconds prior to presenting the PayPalPaymentViewController, so that it has time to actually
handshake with the PayPal server.
I got you Dave. Will have to change the design to handle that, since currently all initialization and payment is done within the same method.

I thought that might be something to do with PayPalEnvironment constants above that I'm passing (since it was crashing with PayPalEnvironmentSandbox, but worked with PayPalEnvironmentNoNetwork).

If constants look fine, I'll stick with not using preconnectWithEnvironment() method so far.
(The Xamarin Sample I was basing my code on at https://github.com/tom-mayer/PayPalTouch
never calls that method either).

Let's close this for now - seems like switching off animation works as a workaround!

@dgoldman-pdx
Copy link
Contributor

@Crulex the constants look right to me.

So okay -- closing this issue for now. Thanks for your efforts!

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

No branches or pull requests

5 participants