Skip to content

Commit

Permalink
Merge pull request #228 from square/mansi/upgrade_ios_sdk_1.7.2
Browse files Browse the repository at this point in the history
upgrade ios version to 1.7.2
  • Loading branch information
Nilay-squareup authored Sep 2, 2024
2 parents 8ed8f80 + dd6d09e commit 9240c64
Show file tree
Hide file tree
Showing 34 changed files with 11,594 additions and 4,560 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 20.x
- run: |
yarn && yarn lint && yarn test &&
cd reader-sdk-react-native-quickstart && yarn
Expand All @@ -23,7 +23,17 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 20.x

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Verify Java version
run: java -version

- name: Cache Gradle Dependencies
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -52,7 +62,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 20.x
- uses: actions/checkout@v3
- name: Install Dependencies
working-directory: ./reader-sdk-react-native-quickstart
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ android/gradlew
android/gradlew.bat
android/gradle/wrapper/gradle-wrapper.jar
android/gradle/wrapper/gradle-wrapper.properties
.yarn
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### v1.4.5 Apr 25, 2024

* Upgrade Reader SDK version support to 1.7.2 for iOS

### v1.4.4 Aug 16, 2023

* Upgrade Reader SDK version support to 1.7.5 for Android
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This repo contains a React Native plugin for Square [Reader SDK]. Reader SDK for
React Native supports the following native Reader SDK versions:

* iOS: 1.6.1 and above
* iOS: 1.7.2 and above
* Android: 1.7.5 and above

>This plugin loads latest version of native Reader SDK by default according to [update policy for Reader SDK].
Expand Down
2 changes: 1 addition & 1 deletion RNReaderSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = "RNReaderSDK"
s.version = "1.1.4"
s.version = "1.7.2"
s.summary = "A React Native plugin for Square Reader SDK"
s.description = <<-DESC
A React Native plugin for Square Reader SDK
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ buildscript {
apply plugin: 'com.android.library'

def DEFAULT_PLAY_SERVICES_BASE_VERSION = '16.0.1'
def READER_SDK_VERSION = '[1.7.5, 2.0)'
def READER_SDK_VERSION = '1.7.4'

android {
compileSdkVersion 33
Expand Down Expand Up @@ -73,6 +73,6 @@ dependencies {
def playServicesBaseVersion = rootProject.hasProperty('googlePlayServiceVersion') ? rootProject.googlePlayServiceVersion : DEFAULT_PLAY_SERVICES_BASE_VERSION
implementation 'com.facebook.react:react-native:+'
implementation "com.google.android.gms:play-services-base:$playServicesBaseVersion"
api "com.squareup.sdk.reader:reader-sdk-$SQUARE_READER_SDK_APPLICATION_ID:$readerSdkVersion"
implementation "com.squareup.sdk.reader:reader-sdk-$SQUARE_READER_SDK_APPLICATION_ID:$readerSdkVersion"
runtimeOnly "com.squareup.sdk.reader:reader-sdk-internals:$readerSdkVersion"
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-square-reader-sdk",
"version": "1.4.3",
"version": "1.7.2",
"description": "A React Native plugin for Square Reader SDK",
"homepage": "https://github.com/square/react-native-square-reader-sdk",
"repository": {
Expand Down Expand Up @@ -45,10 +45,5 @@
"modulePathIgnorePatterns": [
"reader-sdk-react-native-quickstart"
]
},
"resolutions": {
"**/**/handlebars": "4.5.3",
"**/**/logkitty": "^0.7.1",
"**/**/minimist": "^0.2.1"
}
}
5 changes: 4 additions & 1 deletion reader-sdk-react-native-quickstart/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ buck-out/

# Bundle artifact
*.jsbundle

.yarn
/.yarn
# CocoaPods
/ios/Pods/


Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SquareReaderSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>SquareReaderSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
13 changes: 9 additions & 4 deletions reader-sdk-react-native-quickstart/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"

import com.android.build.OutputFile

Expand Down Expand Up @@ -96,7 +97,7 @@ project.ext.react = [
enableHermes: false, // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
// apply from: "../../node_modules/react-native/react.gradle"

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

android {
ndkVersion rootProject.ext.ndkVersion
namespace 'com.rnreadersdksample'

compileSdkVersion rootProject.ext.compileSdkVersion


defaultConfig {
applicationId "com.rnreadersdksample"
Expand Down Expand Up @@ -206,18 +206,23 @@ android {
lint {
baseline = file("lint-baseline.xml")
}

}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
// Old version
implementation ("androidx.appcompat:appcompat:1.3.1") {
version {
strictly '1.3.1'
}
}
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
// implementation 'com.reactnative:react-native-square-reader-sdk:1.7.2'


implementation "androidx.multidex:multidex:2.0.1"
implementation "androidx.compose.foundation:foundation:1.2.1"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.rnreadersdksample">
>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import java.lang.IllegalAccessException
import java.lang.reflect.InvocationTargetException

class MainApplication : Application(), ReactApplication {
private val mReactNativeHost: ReactNativeHost = object : ReactNativeHost(this) {
override val reactNativeHost: ReactNativeHost = object : ReactNativeHost(this) {
override fun getUseDeveloperSupport(): Boolean {
return BuildConfig.DEBUG
}
Expand All @@ -44,10 +44,6 @@ class MainApplication : Application(), ReactApplication {
}
}

override fun getReactNativeHost(): ReactNativeHost {
return mReactNativeHost
}

override fun onCreate() {
super.onCreate()
SoLoader.init(this, /* native exopackage */false)
Expand Down
36 changes: 12 additions & 24 deletions reader-sdk-react-native-quickstart/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ buildscript {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 33
buildToolsVersion "33.0.0"
compileSdkVersion 34
buildToolsVersion "34.0.0"

}
}
}
}
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 24
compileSdkVersion = 33
compileSdkVersion = 34
targetSdkVersion = 33
readerSdkVersion = "[1.7.5, 2.0)"
readerSdkVersion = "1.7.4"
ndkVersion = "21.4.7075529"
kotlin_version ='1.8.21'
}
Expand All @@ -40,25 +41,19 @@ buildscript {
}
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.2")

classpath('com.android.tools.build:gradle:8.5.1')
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
classpath("com.facebook.react:react-native-gradle-plugin")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
exclusiveContent {
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}

maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
Expand All @@ -70,15 +65,8 @@ allprojects {
maven {
url "https://sdk.squareup.com/android"
credentials {
username SQUARE_READER_SDK_APPLICATION_ID
password SQUARE_READER_SDK_REPOSITORY_PASSWORD
}
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
username SQUARE_READER_SDK_APPLICATION_ID
password SQUARE_READER_SDK_REPOSITORY_PASSWORD
}
}
google()
Expand Down
6 changes: 4 additions & 2 deletions reader-sdk-react-native-quickstart/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ android.enableJetifier=false
FLIPPER_VERSION=0.99.0

## The Application ID displayed on the Credentials tab in the Square Application Control Panel.
# SQUARE_READER_SDK_APPLICATION_ID=
SQUARE_READER_SDK_APPLICATION_ID=SQUARE_READER_SDK_APPLICATION_ID

## The Application Secret from the OAuth tab in the Square Application Control Panel.
# SQUARE_READER_SDK_REPOSITORY_PASSWORD=
SQUARE_READER_SDK_REPOSITORY_PASSWORD=SQUARE_READER_SDK_REPOSITORY_PASSWORD

hermesEnabled=false
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Thu Aug 01 16:15:50 IST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions reader-sdk-react-native-quickstart/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
include ':react-native-square-reader-sdk'
project(':react-native-square-reader-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-square-reader-sdk/android')
include ':react-native-reanimated'
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android')
include ':react-native-gesture-handler'
Expand All @@ -23,3 +25,5 @@ limitations under the License.
rootProject.name = 'RNReaderSDKSample'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')

Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ limitations under the License.
import React, {FC} from 'react';
import {Animated} from 'react-native';

const iconImage = require('./img/ic_jewel.png');

const SquareLogo: FC<Props> = props => {
return (
<Animated.Image
style={[{width: props.width, height: props.height}, props.style]}
source={iconImage}
source={require('../assets/images/ic_jewel.png')}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {
import CustomButton from '../components/CustomButton';
import SquareLogo from '../components/SquareLogo';
import {defaultStyles} from '../styles/common';
const iconImage = require('../components/img/setting.png');

export default function CheckoutScreen({navigation}) {
const [locationName, setLocationName] = useState('');
Expand Down Expand Up @@ -153,7 +152,7 @@ export default function CheckoutScreen({navigation}) {
return (
<View style={defaultStyles.pageContainer}>
<TouchableOpacity onPress={() => onSettings()}>
<Image style={defaultStyles.settingIconStyle} source={iconImage} />
<Image style={defaultStyles.settingIconStyle} source={require('../assets/images/setting.png')} />
</TouchableOpacity>
<View style={defaultStyles.logoContainer}>
<SquareLogo style={defaultStyles.logoStyle} />
Expand Down
2 changes: 1 addition & 1 deletion reader-sdk-react-native-quickstart/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:@react-native/babel-preset'],
};
Loading

0 comments on commit 9240c64

Please sign in to comment.