Can’t make a 2nd app work, 1st one works great

Can not make a 2nd app function with Square pointOfSale api / app for mobile payments on iOS in Swift.
I have had 1 app working well for 4 years but with so many 2nd attempts that failed, I am wondering if the square developer system has an undocumented limit of 1 app per developer!
Has anyone made a 2nd app successfully?

:wave: You can definitely have more than one app that accepts payment on your Square account. Where is the app failing? :slightly_smiling_face:

The app performs the api, charges the card, but does no callback. I believe rhe problem is in the info.plist setup for the URLSchemes - I can’t discover why - may I send you screenshots of the info.plist definition as well as the developer dashboard definitions? This is for an iOS mobile app.
Craig

Feel free to post any relevant information but it sounds like a configuration issue. Did the callback ever work as expected? :slightly_smiling_face:

Bryan, I have been unable to get the callback to work even once. I will post the relevant info shortly and if you would be willing to look at my setup, I would be most grateful.
Craig

Hi Bryan,
This is my Point of Sale api call I would truly appreciate your help on this:

//
// ViewController.swift
// POSSDKTest2
//
// Created by Dr Craig E Curphey on 2022-06-14.
//
import UIKit
import SquarePointOfSaleSDK

class ViewController: UIViewController {

override func viewDidLoad() {
    super.viewDidLoad()
    
}//------------------------------------
@IBAction func doPaymentTapped(_ sender: Any) {

    //------ API to Square right here ******-----------------
    let callbackURL = URL(string: "POSSDKTest2Scheme://")!
    var money: SCCMoney?
    do {
        // Specify the amount of money to charge.
        let todaysFeePennies = Int(1.00) * 100
        money = try SCCMoney(amountCents: todaysFeePennies, currencyCode: "CAD")
    } catch {
        print("money conversion failed.")
    }
    let LoginID = "TestPatient"
    squareTransDone = false
    //log values used to console:
    print("Initiating payment api request")
    print("callback: \(callbackURL)")
    print("money: \(money!)")
    print("LoginID: TestPatient")
    print("Creating payment api request")
    
    SCCAPIRequest.setApplicationID("sq0idp-TbgQGqSrC84qkfcXSTntNg")
    var request: SCCAPIRequest?
    do
    {
        request =
            try SCCAPIRequest(
                callbackURL: callbackURL,
                amount: money!,
                userInfoString: LoginID,
                locationID: "",
                notes: "TestingSDK",
                customerID: "tester2",
                supportedTenderTypes: .all,
                clearsDefaultFees: false,
                returnsAutomaticallyAfterPayment: false,
                disablesKeyedInCardEntry: false,
                skipsReceipt: false
            )
        
     print("api initiating!")
     try SCCAPIConnection.perform(request!)//Kaled says this does the api

    } catch let error as NSError {
        print("Error detected: \(error.localizedDescription)")
    }//end API
    print("End of payment api function.")
}//------------------------------------

}
Here is my info.plist setup:

Here is my Square Developer Apps list - the one at issue is POSSDKTest2:

Here is my Credentials screenshot:

And lastly the Point of Sale API screenshot:

If you can see what I have set up incorrectly and let me know I would greatly apprecaiate it.

Thanks again for your help!

Kindest Regards,

Craig

Bryan - I neglected to insert the AppDelegate for POSSDKTest2 … here is the first part of it which will show a console log if the callback happens:
//
// AppDelegate.swift
// POSSDKTest2
//
// Created by Dr Craig E Curphey on 2022-06-14.
//

//======= Square variables ======
var squareTokenID = “Who cares - let it fail I just want a callback!” //for Welcome
//set this to “” after i get square working
var squarePatientID = “”
var squareGeneratedTransID = “”
var squareGeneratedClientID = “”
var squareAmountReturned :Float = 0.00
var squareCurrencyType = “”
var squareCashOrCard = “”
var squareCardBrand = “”
var squareLast4 = “”
var squareTransFailed = false
var squareTransFailureReason = “”
var squareUserCancelled = false
var squareTransDone = false
var TodaysFee: Float = 0.00

import UIKit
import SquarePointOfSaleSDK

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
var testing = true

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool
{
    print ("AppDel Got to AppDelegate - woo-hoooo - callback happened!") //proves that we got call back
    
    guard SCCAPIResponse.isSquareResponse(url) else {
       // if let error = response.error {
        print("AppDel Callback failure")
        return false
    }

   // remaining code only gets executed on successful callback from Square app
    print ("AppDel Successful-1 Square recognized!")

Bryan - btw - If you can help me get past this obstacle I have the ability to create several custom business apps for future Square customers.

Hey Bryan - as you suggested, I posted what I believe is all the relevant info that you would need to see where I am making some sort of werror in my app.

Here’s the link

Any chance you might be able to look into why this is happening?

Kind Regards,

Hi Bryan,

I still can not get the SquarePOSsdk for iOS to work. Is any help available?