Unrecognized selector sent to instance

this is not the error i get as shown on the video the checkout is presented and i’m each time connected

I openned a issue on the sumup side for this error.
this is the link.
https://github.com/sumup/sumup-ios-sdk/issues/50

the sumup developper is asking if uAppDelegate has a window property or method;

this is my code updated to test again. has responded the function should not complaining about to be logged to make a payment as each times you call the function it first log you in with a token before trying to make a payment.

      [SumupSDK loginWithToken:accessToken
                       completion: ^(BOOL success, NSError * _Nonnull error) {
                           if (error.code != 22 && error != NULL) {
                            NSLog(@"%@", error);
                            @{PayWithToken:Of(_this).Reject(string):Call(@"token not found")};                          
                           }else{

                            [SumupSDK prepareForCheckout];
      SMPCheckoutRequest *request = [SMPCheckoutRequest requestWithTotal:[NSDecimalNumber decimalNumberWithString:productAmount]
                                                                   title:productTitle
                                                            currencyCode:[[SumupSDK currentMerchant] currencyCode]
                                                          paymentOptions:SMPPaymentOptionAny];

              [request setForeignTransactionID:foreignRef];

              [SumupSDK checkoutWithRequest: request
                          fromViewController: [UIApplication sharedApplication].keyWindow.rootViewController
                                    completion: ^(SMPCheckoutResult *result, NSError *error) {
                                              if(error){
                                            @{PayWithToken:Of(_this).Reject(string):Call(@"you need to be connected to make a payment")};
                                              }else{
                                              @{PayWithToken:Of(_this).Resolve(string):Call(@"Le paiement a été effectué")};
                                            }
                                                                 
                }];

        // something went wrong checkout was not started
        if (![SumupSDK checkoutInProgress]) {
           @{PayWithToken:Of(_this).Reject(string):Call(@"Une erreur de connard s'est produite")};
        }


          }

         }];

i really need to get this module working for both side (android and iOS) as we are planning to launch our fuse app soon.

2017-09-14 13:01:41.409 test[1107:1969075] "haha i started"
2017-09-14 13:01:41.512 test[1107:1969075] {"type":"default","status":200,"ok":true,"statusText":"OK","headers":{"map":{"status":["200 OK"],"x-content-type-options":["nosniff"],"content-type":["application/json; charset=utf-8"],"server":["nginx"],"connection":["keep-alive"],"date":["Thu, 14 Sep 2017 11:01:41 GMT"],"x-download-options":["noopen"],"x-frame-options":["SAMEORIGIN"],"x-xss-protection":["1; mode=block"],"content-length":["303"],"etag":["W/\"12f-HUKuemol4Sw7orGDLH4otkd8CQE\""]}},"url":"","_bodyInit":"{\"access_token\":\"23d8062c3735f7351d931f97c4b7dfb35495fb2b7ffad831825c7db43f75c3d0\",\"token_type\":\"Bearer\",\"expires_in\":3600,\"refresh_token\":\"f8dcfcbe7805f4aa73ee3a3ebdc4a9cd2f93712f5e5088cfd1647382cd50d88f\",\"scope\":\"payments user.app-settings transactions.history user.profile_readonly user.subaccounts\"}","_bodyText":"{\"access_token\":\"23d8062c3735f7351d931f97c4b7dfb35495fb2b7ffad831825c7db43f75c3d0\",\"token_type\":\"Bearer\",\"expires_in\":3600,\"refresh_token\":\"f8dcfcbe7805f4aa73ee3a3ebdc4a9cd2f93712f5e5088cfd1647382cd50d88f\",\"scope\":\"payments user.app-settings transactions.history user.profile_readonly user.subaccounts\"}"}
2017-09-14 13:01:41.676 test[1107:1968972] Error Domain=SumupSDKError Code=20 "(null)" UserInfo={NSUnderlyingError=0x1498e8010 {Error Domain=JSONRPCServerError Code=-32006 "Version not supported" UserInfo={NSLocalizedDescription=Version not supported, JSONObject={
    code = "-32006";
    data =     {
        message = "Sorry, but we've experienced an unexpected error. Please try closing the app and logging in again, or contact our Support Team (quote: UKN-W61QY)";
    };
    message = "Version not supported";
}}}}
2017-09-14 13:01:41.682 test[1107:1969075] "token not found"

Sorry prince this does not reproduce the issue. We really want to help you fix the error so you can ship, but without being able to get to the actual issue we just can’t help. Happy to test a smaller example of the error or to keep trying with this one.

[uAppDelegate window]: unrecognized selector sent to instance
One thing I don’t understand is why you are using the uAppDelegate for you callback as it will not have the selector you need. You probably will have more luck making an object that implements the protocol the system requires and using that instead.

To be clear uAppDelegate does not have window. So the routine is failing

Thank you for your time on this. will try to build the object needed, if you guys have some ressources or fuselibs things who do the same (init object like this in uno) this will be helpful for me.
sumup is available in few countries maybe this is why you are running on this issue.

Try this in your checkoutWithRequest call

fromViewController: [[[uContext sharedContext] window] rootViewController]

and add

[Require("Source.Include", "Context.h")]

to the class

To anyone who stumbles onto this thread. We found a hack solution which was using a macro to add a window property to Fuse’s AppDelegate. I wont list the hack here for two reasons:

  • It’s nasty
  • A proper fix is currently in a PR and should make it into uno in the near future.

If you do run into this before we ship the fix please reach out to me here or on the fuse community slack channel and I’ll pass the hack along :slight_smile:

1 Like

Hi, I have the same problem. Can you explaine how fix it to me?

Baggers? Are you still here?