I am able to open Register app from my app on iPad by passing amount.
Now, when I cancel this by clicking on X at top left, Register app doesn not open back my app.
Versions :
iOS : 10.1.1
Register App : 4.54.1
Xcode : 8.2
Any suggestions ? What I am missing ?
Code :
if (totalAmount)
{
NSError *error = nil;
SCCMoney *amount = [SCCMoney moneyWithAmountCents:9000 currencyCode:@"USD" error:&error];
if (error)
return;
NSURL *const callbackURL = [NSURL URLWithString:@"myapp-callback://abc"];
SCCAPIRequest *request = [SCCAPIRequest requestWithCallbackURL:callbackURL
amount:amount
userInfoString:@"Info"
merchantID:nil
notes:@"Coffee"
customerID:nil
supportedTenderTypes:SCCAPIRequestTenderTypeAll
clearsDefaultFees:NO
returnAutomaticallyAfterPayment:YES
error:&error];
if (![SCCAPIConnection performRequest:request error:&error])
{
DLog(@"Error with Register Payment");
}
}
Callback URL setup :
Xcode
Square Developer portal
You probably haven't registered
myapp-callback://abc
for your application.If you look at the first step on this page: https://docs.connect.squareup.com/articles/register-api-ios/
You'll need to add a URL scheme for your app to your
info.plist
like the Hello Charge sample has below, I'm guessing you don't havemyapp-callback://abc
in there and Square Register is unable to switch back to your app.