-4

I'm trying to build an iOS app with back4app acting as the db. I've added Stripe to the cloud code and I've added all the relevant API keys to it.

I've been following https://www.back4app.com/docs/cloud-code-functions/stripe-android-app as documentation.

Being an Android app, I'm not sure which cloud code functions I should use when trying to test a payment using Swift.

Hope someone can help. Thanks.

Pranav Kasetti
  • 8,770
  • 2
  • 50
  • 71
phil
  • 37
  • 4
  • 1
    Theoretically your backend can be the same regardless of whether your client is iOS or Android. Looking at the link you specified you just need to figure out how to do the `ParseCloud.callFunctionInBackground("purchaseItem")` equivalent in swift. – Paul Asjes Apr 23 '20 at 03:28
  • Yes that’s basically what I’m looking for – phil Apr 23 '20 at 08:47

1 Answers1

0

Back4App utilises the open source Parse Server and the wider Parse Platform including our open source client SDKs for iOS, Android, JavaScript, Flutter, PHP and more.

With this in mind much of our open source documentation is relevant to using Back4App. The extensive guides should help get you up to speed and answer most simple questions.

Following on from @Paul's suggestion, to call a cloud function using the iOS SDK you can do something like this...

PFCloud.callFunction(inBackground: "purchaseItem", withParameters: nil) { (result, error) in

    guard error == nil else {
        return
    }

    guard let result = result as? String else {
        return
    }

    print("Wow \(result).")

}
Tom Fox
  • 897
  • 3
  • 14
  • 34