Skip to content

Commit 9240c64

Browse files
Merge pull request #228 from square/mansi/upgrade_ios_sdk_1.7.2
upgrade ios version to 1.7.2
2 parents 8ed8f80 + dd6d09e commit 9240c64

34 files changed

+11594
-4560
lines changed

.github/workflows/main.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
- uses: actions/checkout@v3
88
- uses: actions/setup-node@v3
99
with:
10-
node-version: 16.x
10+
node-version: 20.x
1111
- run: |
1212
yarn && yarn lint && yarn test &&
1313
cd reader-sdk-react-native-quickstart && yarn
@@ -23,7 +23,17 @@ jobs:
2323
- name: Use Node.js
2424
uses: actions/setup-node@v1
2525
with:
26-
node-version: 16.x
26+
node-version: 20.x
27+
28+
- name: Set up JDK 17
29+
uses: actions/setup-java@v3
30+
with:
31+
java-version: '17'
32+
distribution: 'temurin'
33+
34+
- name: Verify Java version
35+
run: java -version
36+
2737
- name: Cache Gradle Dependencies
2838
uses: actions/cache@v3
2939
with:
@@ -52,7 +62,7 @@ jobs:
5262
- name: Use Node.js
5363
uses: actions/setup-node@v1
5464
with:
55-
node-version: 16.x
65+
node-version: 20.x
5666
- uses: actions/checkout@v3
5767
- name: Install Dependencies
5868
working-directory: ./reader-sdk-react-native-quickstart

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ android/gradlew
5353
android/gradlew.bat
5454
android/gradle/wrapper/gradle-wrapper.jar
5555
android/gradle/wrapper/gradle-wrapper.properties
56+
.yarn

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Changelog
22

3+
### v1.4.5 Apr 25, 2024
4+
5+
* Upgrade Reader SDK version support to 1.7.2 for iOS
6+
37
### v1.4.4 Aug 16, 2023
48

59
* Upgrade Reader SDK version support to 1.7.5 for Android

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
This repo contains a React Native plugin for Square [Reader SDK]. Reader SDK for
77
React Native supports the following native Reader SDK versions:
88

9-
* iOS: 1.6.1 and above
9+
* iOS: 1.7.2 and above
1010
* Android: 1.7.5 and above
1111

1212
>This plugin loads latest version of native Reader SDK by default according to [update policy for Reader SDK].

RNReaderSDK.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Pod::Spec.new do |s|
33
s.name = "RNReaderSDK"
4-
s.version = "1.1.4"
4+
s.version = "1.7.2"
55
s.summary = "A React Native plugin for Square Reader SDK"
66
s.description = <<-DESC
77
A React Native plugin for Square Reader SDK

android/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ buildscript {
2828
apply plugin: 'com.android.library'
2929

3030
def DEFAULT_PLAY_SERVICES_BASE_VERSION = '16.0.1'
31-
def READER_SDK_VERSION = '[1.7.5, 2.0)'
31+
def READER_SDK_VERSION = '1.7.4'
3232

3333
android {
3434
compileSdkVersion 33
@@ -73,6 +73,6 @@ dependencies {
7373
def playServicesBaseVersion = rootProject.hasProperty('googlePlayServiceVersion') ? rootProject.googlePlayServiceVersion : DEFAULT_PLAY_SERVICES_BASE_VERSION
7474
implementation 'com.facebook.react:react-native:+'
7575
implementation "com.google.android.gms:play-services-base:$playServicesBaseVersion"
76-
api "com.squareup.sdk.reader:reader-sdk-$SQUARE_READER_SDK_APPLICATION_ID:$readerSdkVersion"
76+
implementation "com.squareup.sdk.reader:reader-sdk-$SQUARE_READER_SDK_APPLICATION_ID:$readerSdkVersion"
7777
runtimeOnly "com.squareup.sdk.reader:reader-sdk-internals:$readerSdkVersion"
7878
}

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-square-reader-sdk",
3-
"version": "1.4.3",
3+
"version": "1.7.2",
44
"description": "A React Native plugin for Square Reader SDK",
55
"homepage": "https://github.com/square/react-native-square-reader-sdk",
66
"repository": {
@@ -45,10 +45,5 @@
4545
"modulePathIgnorePatterns": [
4646
"reader-sdk-react-native-quickstart"
4747
]
48-
},
49-
"resolutions": {
50-
"**/**/handlebars": "4.5.3",
51-
"**/**/logkitty": "^0.7.1",
52-
"**/**/minimist": "^0.2.1"
5348
}
5449
}

reader-sdk-react-native-quickstart/.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ buck-out/
5555

5656
# Bundle artifact
5757
*.jsbundle
58-
58+
.yarn
59+
/.yarn
5960
# CocoaPods
6061
/ios/Pods/
62+
63+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>AvailableLibraries</key>
6+
<array>
7+
<dict>
8+
<key>LibraryIdentifier</key>
9+
<string>ios-arm64</string>
10+
<key>LibraryPath</key>
11+
<string>SquareReaderSDK.framework</string>
12+
<key>SupportedArchitectures</key>
13+
<array>
14+
<string>arm64</string>
15+
</array>
16+
<key>SupportedPlatform</key>
17+
<string>ios</string>
18+
</dict>
19+
<dict>
20+
<key>LibraryIdentifier</key>
21+
<string>ios-arm64_x86_64-simulator</string>
22+
<key>LibraryPath</key>
23+
<string>SquareReaderSDK.framework</string>
24+
<key>SupportedArchitectures</key>
25+
<array>
26+
<string>arm64</string>
27+
<string>x86_64</string>
28+
</array>
29+
<key>SupportedPlatform</key>
30+
<string>ios</string>
31+
<key>SupportedPlatformVariant</key>
32+
<string>simulator</string>
33+
</dict>
34+
</array>
35+
<key>CFBundlePackageType</key>
36+
<string>XFWK</string>
37+
<key>XCFrameworkFormatVersion</key>
38+
<string>1.0</string>
39+
</dict>
40+
</plist>

reader-sdk-react-native-quickstart/android/app/build.gradle

+9-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616
apply plugin: "com.android.application"
17+
apply plugin: "com.facebook.react"
1718

1819
import com.android.build.OutputFile
1920

@@ -96,7 +97,7 @@ project.ext.react = [
9697
enableHermes: false, // clean and rebuild if changing
9798
]
9899

99-
apply from: "../../node_modules/react-native/react.gradle"
100+
// apply from: "../../node_modules/react-native/react.gradle"
100101

101102
/**
102103
* Set this to true to create two separate APKs instead of one:
@@ -142,9 +143,8 @@ def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitect
142143

143144
android {
144145
ndkVersion rootProject.ext.ndkVersion
146+
namespace 'com.rnreadersdksample'
145147

146-
compileSdkVersion rootProject.ext.compileSdkVersion
147-
148148

149149
defaultConfig {
150150
applicationId "com.rnreadersdksample"
@@ -206,18 +206,23 @@ android {
206206
lint {
207207
baseline = file("lint-baseline.xml")
208208
}
209+
209210
}
210211

211212
dependencies {
212213
implementation fileTree(dir: "libs", include: ["*.jar"])
213214
//noinspection GradleDynamicVersion
214-
implementation "com.facebook.react:react-native:+" // From node_modules
215215
// Old version
216216
implementation ("androidx.appcompat:appcompat:1.3.1") {
217217
version {
218218
strictly '1.3.1'
219219
}
220220
}
221+
// The version of react-native is set by the React Native Gradle Plugin
222+
implementation("com.facebook.react:react-android")
223+
// implementation 'com.reactnative:react-native-square-reader-sdk:1.7.2'
224+
225+
221226
implementation "androidx.multidex:multidex:2.0.1"
222227
implementation "androidx.compose.foundation:foundation:1.2.1"
223228
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"

reader-sdk-react-native-quickstart/android/app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ limitations under the License.
1212
-->
1313
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
1414
xmlns:tools="http://schemas.android.com/tools"
15-
package="com.rnreadersdksample">
15+
>
1616

1717
<uses-permission android:name="android.permission.INTERNET" />
1818
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

reader-sdk-react-native-quickstart/android/app/src/main/java/com/rnreadersdksample/MainApplication.kt

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import java.lang.IllegalAccessException
2828
import java.lang.reflect.InvocationTargetException
2929

3030
class MainApplication : Application(), ReactApplication {
31-
private val mReactNativeHost: ReactNativeHost = object : ReactNativeHost(this) {
31+
override val reactNativeHost: ReactNativeHost = object : ReactNativeHost(this) {
3232
override fun getUseDeveloperSupport(): Boolean {
3333
return BuildConfig.DEBUG
3434
}
@@ -44,10 +44,6 @@ class MainApplication : Application(), ReactApplication {
4444
}
4545
}
4646

47-
override fun getReactNativeHost(): ReactNativeHost {
48-
return mReactNativeHost
49-
}
50-
5147
override fun onCreate() {
5248
super.onCreate()
5349
SoLoader.init(this, /* native exopackage */false)

reader-sdk-react-native-quickstart/android/build.gradle

+12-24
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ buildscript {
1717
afterEvaluate {project ->
1818
if (project.hasProperty("android")) {
1919
android {
20-
compileSdkVersion 33
21-
buildToolsVersion "33.0.0"
20+
compileSdkVersion 34
21+
buildToolsVersion "34.0.0"
22+
2223
}
2324
}
2425
}
2526
}
2627
ext {
2728
buildToolsVersion = "33.0.0"
2829
minSdkVersion = 24
29-
compileSdkVersion = 33
30+
compileSdkVersion = 34
3031
targetSdkVersion = 33
31-
readerSdkVersion = "[1.7.5, 2.0)"
32+
readerSdkVersion = "1.7.4"
3233
ndkVersion = "21.4.7075529"
3334
kotlin_version ='1.8.21'
3435
}
@@ -40,25 +41,19 @@ buildscript {
4041
}
4142
}
4243
dependencies {
43-
classpath("com.android.tools.build:gradle:7.2.2")
44+
45+
classpath('com.android.tools.build:gradle:8.5.1')
4446
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
47+
classpath("com.facebook.react:react-native-gradle-plugin")
48+
4549
// NOTE: Do not place your application dependencies here; they belong
4650
// in the individual module build.gradle files
4751
}
4852
}
4953

5054
allprojects {
5155
repositories {
52-
exclusiveContent {
53-
filter {
54-
includeGroup "com.facebook.react"
55-
}
56-
forRepository {
57-
maven {
58-
url "$rootDir/../node_modules/react-native/android"
59-
}
60-
}
61-
}
56+
6257
maven {
6358
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
6459
url("$rootDir/../node_modules/react-native/android")
@@ -70,15 +65,8 @@ allprojects {
7065
maven {
7166
url "https://sdk.squareup.com/android"
7267
credentials {
73-
username SQUARE_READER_SDK_APPLICATION_ID
74-
password SQUARE_READER_SDK_REPOSITORY_PASSWORD
75-
}
76-
}
77-
mavenCentral {
78-
// We don't want to fetch react-native from Maven Central as there are
79-
// older versions over there.
80-
content {
81-
excludeGroup "com.facebook.react"
68+
username SQUARE_READER_SDK_APPLICATION_ID
69+
password SQUARE_READER_SDK_REPOSITORY_PASSWORD
8270
}
8371
}
8472
google()

reader-sdk-react-native-quickstart/android/gradle.properties

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ android.enableJetifier=false
4242
FLIPPER_VERSION=0.99.0
4343

4444
## The Application ID displayed on the Credentials tab in the Square Application Control Panel.
45-
# SQUARE_READER_SDK_APPLICATION_ID=
45+
SQUARE_READER_SDK_APPLICATION_ID=SQUARE_READER_SDK_APPLICATION_ID
4646

4747
## The Application Secret from the OAuth tab in the Square Application Control Panel.
48-
# SQUARE_READER_SDK_REPOSITORY_PASSWORD=
48+
SQUARE_READER_SDK_REPOSITORY_PASSWORD=SQUARE_READER_SDK_REPOSITORY_PASSWORD
49+
50+
hermesEnabled=false
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Thu Aug 01 16:15:50 IST 2024
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

reader-sdk-react-native-quickstart/android/settings.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/*
2+
include ':react-native-square-reader-sdk'
3+
project(':react-native-square-reader-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-square-reader-sdk/android')
24
include ':react-native-reanimated'
35
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android')
46
include ':react-native-gesture-handler'
@@ -23,3 +25,5 @@ limitations under the License.
2325
rootProject.name = 'RNReaderSDKSample'
2426
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
2527
include ':app'
28+
includeBuild('../node_modules/@react-native/gradle-plugin')
29+

reader-sdk-react-native-quickstart/app/components/SquareLogo.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ limitations under the License.
1717
import React, {FC} from 'react';
1818
import {Animated} from 'react-native';
1919

20-
const iconImage = require('./img/ic_jewel.png');
21-
2220
const SquareLogo: FC<Props> = props => {
2321
return (
2422
<Animated.Image
2523
style={[{width: props.width, height: props.height}, props.style]}
26-
source={iconImage}
24+
source={require('../assets/images/ic_jewel.png')}
2725
/>
2826
);
2927
};

reader-sdk-react-native-quickstart/app/screens/CheckoutScreen.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import {
3838
import CustomButton from '../components/CustomButton';
3939
import SquareLogo from '../components/SquareLogo';
4040
import {defaultStyles} from '../styles/common';
41-
const iconImage = require('../components/img/setting.png');
4241

4342
export default function CheckoutScreen({navigation}) {
4443
const [locationName, setLocationName] = useState('');
@@ -153,7 +152,7 @@ export default function CheckoutScreen({navigation}) {
153152
return (
154153
<View style={defaultStyles.pageContainer}>
155154
<TouchableOpacity onPress={() => onSettings()}>
156-
<Image style={defaultStyles.settingIconStyle} source={iconImage} />
155+
<Image style={defaultStyles.settingIconStyle} source={require('../assets/images/setting.png')} />
157156
</TouchableOpacity>
158157
<View style={defaultStyles.logoContainer}>
159158
<SquareLogo style={defaultStyles.logoStyle} />
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
presets: ['module:@react-native/babel-preset'],
33
};

0 commit comments

Comments
 (0)