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 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions Example/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Square Mobile Payments SDK Example Apps
# Square Mobile Payments SDK Example App


### Assumptions and prerequisites

These example apps make the following assumptions:
The example app make the following assumptions:

* You have read the [Mobile Payments SDK "Build on iOS"](https://developer.squareup.com/docs/mobile-payments-sdk/ios) documentation. These example apps focus on demonstrating how the Square Mobile Payments SDK works by using all of the provided user interfaces of the SDK.
* You have read the [Mobile Payments SDK "Build on iOS"](https://developer.squareup.com/docs/mobile-payments-sdk/ios) documentation. The example app focuses on demonstrating how the Square Mobile Payments SDK works by using all of the provided user interfaces of the SDK.
* You have a Square account enabled for payment processing. If you have not
enabled payment processing on your account (or you are not sure), visit
[squareup.com/activate](https://squareup.com/activate).
Expand All @@ -15,7 +15,3 @@ These example apps make the following assumptions:
* Confirm your environment meets the Square Mobile Payments SDK build requirements listed in the [root README] for this repo.
* Clone this repo (if you have not already):
`git clone https://github.com/square/mobile-payments-sdk-ios`


### Open an example app
There are both SwiftUI and UIKit example app. Choose the one that best fits the technology in your app.
9 changes: 6 additions & 3 deletions Example/Shared/Config.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
public enum Config {
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"
tamerbader marked this conversation as resolved.
Show resolved Hide resolved

// In a production application you should use your server to obtain an access token and locationID.
// For this sample app, we can just authorize Reader SDK using hardcoded values.
static let accessToken: String = "your_access_token"
static let locationID: String = "your_location_id"
}

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"images" : [
{
"filename" : "iconCookie.png",
"filename" : "donut.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "iconCookie@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "iconCookie@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
17 changes: 5 additions & 12 deletions Example/Shared/Resources/Launch Screen.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -15,25 +16,18 @@
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launch-background-gradient" translatesAutoresizingMaskIntoConstraints="NO" id="l4z-yJ-kTN">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="square-logo" translatesAutoresizingMaskIntoConstraints="NO" id="jm1-Cu-PKf">
<rect key="frame" x="156.66666666666666" y="321.66666666666669" width="80" height="234.00000000000006"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="donut" translatesAutoresizingMaskIntoConstraints="NO" id="jm1-Cu-PKf">
<rect key="frame" x="96.666666666666686" y="314.66666666666669" width="200" height="248.00000000000006"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="2LC-bF-tvo"/>
<constraint firstAttribute="width" constant="200" id="2LC-bF-tvo"/>
</constraints>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="l4z-yJ-kTN" secondAttribute="trailing" id="OB7-fE-xzA"/>
<constraint firstItem="jm1-Cu-PKf" firstAttribute="centerY" secondItem="Bcu-3y-fUS" secondAttribute="centerY" id="Pkc-ec-dua"/>
<constraint firstItem="jm1-Cu-PKf" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="ibB-mm-Vyv"/>
<constraint firstAttribute="bottom" secondItem="l4z-yJ-kTN" secondAttribute="bottom" id="nhL-CY-1EA"/>
<constraint firstItem="l4z-yJ-kTN" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="qdQ-bY-D1m"/>
<constraint firstItem="l4z-yJ-kTN" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="yga-mt-gPQ"/>
</constraints>
</view>
</viewController>
Expand All @@ -43,7 +37,6 @@
</scene>
</scenes>
<resources>
<image name="launch-background-gradient" width="1024" height="768"/>
<image name="square-logo" width="234" height="234"/>
<image name="donut" width="248" height="248"/>
</resources>
</document>
Loading
Loading