Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Example App #16

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Create Example App #16

wants to merge 4 commits into from

Conversation

tamerbader
Copy link
Contributor

@tamerbader tamerbader commented Nov 13, 2024

Description

This PR introduces a new example app developers can utilize to better understand how to integrate the Mobile Payments SDK into their applications.

Demo

DonutCounteriPhoneDemo.MP4

{
"identity" : "mobile-payments-sdk-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/square/mobile-payments-sdk-ios",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a remote package, you could use the local package file. That way it's always using what ever this branch is on and we don't need to remember to update it.

packageProductDependencies = (
FB1E68DB2C1CC58C004DC0A9 /* MockReaderUI */,
FB1E68DD2C1CC58C004DC0A9 /* SquareMobilePaymentsSDK */,
D05023652CE52A5B005FA05C /* MockReaderUI */,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why there are two references to each dependency


enum Location {
static var locationPermissionTitle: String = "Location"
static var locationPermissionDescription: String = "Square used location to know where transactions take place. This reduces risk and minimizes payment disputes."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be Square uses instead of used?

import MockReaderUI
#endif

class HomeViewModel: ObservableObject, PaymentManagerDelegate {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be interesting to convert this to using the Observable macro instead? Make it a little more up to date. But I think it's a fine follow up too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, we should use the Observable macro


Divider()

// Mirophone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling

CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"../Shared/Preview Content\"";
DEVELOPMENT_TEAM = J6PNP64J5X;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove your development team so that it's blank?


class AppDelegate: NSObject, UIApplicationDelegate {

var mobilePaymentSDK: SDKManager!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private(set)?

public static let squareApplicationID: String? = nil // Replace with your squareApplicationID
public static let accessToken: String? = nil // Replace with your accessToken
public static let locationID: String? = nil // Replace with your locationID
static let squareApplicationID: String = "your_square_application_id"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I kind of liked have these optional because if you ran the app for the first time you would get a compile error saying that you need to input these instead of the app trying to run with dummy values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants