Hi guys , i’m working on the integration of the sumup android and iOS sdk in fusetools.
the repository of the module can be found bellow.
i managed to get the android part fully working.
in the iOS part the payment process works pretty well in the Xcode simulator (see the code below), but when i test it with real device (iPod touch) , the checkout process freeze , and it gives me this error '-[uAppDelegate window]: unrecognized selector sent to instance 0x149e02d20'
[Require("Xcode.Framework", "@('SumupSDK.embeddedframework/SumupSDK.framework':Path)")]
[Require("Xcode.Framework", "Accelerate")]
[Require("Xcode.Framework", "AVFoundation")]
[Require("Xcode.Framework", "MapKit")]
[Require("Source.Import", "SumupSDK/SumupSDK.h")]
extern(iOS)
class PayWithToken: Promise<string>
{
[Foreign(Language.ObjC)]
public PayWithToken(string accessToken, string productAmount, string productTitle, string foreignRef)
@{
[SumupSDK loginWithToken:accessToken
completion: ^(BOOL success, NSError *error) {
if (error) {
@{PayWithToken:Of(_this).Reject(string):Call(@"token non obtenu")};
}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(@"Vous devez etre connecter")};
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")};
}
}
}];
@}
void Resolve(string message)
{
base.Resolve(message);
}
void Reject(string reason)
{
Reject(new Exception(reason));
}
}
I think it has something to do with [UIApplication sharedApplication].keyWindow.rootViewController
, but didn’t find any solution to sort this out.
anyone can help me ?