Skip to content

Commit

Permalink
fixed run issue 1.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nilay-squareup committed Aug 5, 2024
1 parent 86e495e commit 37c8636
Show file tree
Hide file tree
Showing 15 changed files with 327 additions and 76 deletions.
2 changes: 1 addition & 1 deletion 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
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
36 changes: 13 additions & 23 deletions reader-sdk-react-native-quickstart/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ buildscript {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 33
buildToolsVersion "33.0.0"
compileSdkVersion 34
buildToolsVersion "34.0.0"
// if (namespace == null) {
// namespace project.group
// }
}
}
}
}
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 24
compileSdkVersion = 33
compileSdkVersion = 34
targetSdkVersion = 33
readerSdkVersion = "[1.7.5, 2.0)"
ndkVersion = "21.4.7075529"
Expand All @@ -40,25 +43,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 +67,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 "sq0idp-ZEe0gjVrSrPSE1YMM4T75A"
password "35mywk6inosfvr4zgudkmssu5tvtuiwnicjvc2vn7xwf7ujtd22q"
}
}
google()
Expand Down
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
2 changes: 2 additions & 0 deletions reader-sdk-react-native-quickstart/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,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')

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'],
};
2 changes: 1 addition & 1 deletion reader-sdk-react-native-quickstart/ios/File.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let jsCodeLocation: URL

jsCodeLocation = RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index", fallbackResource:nil)
jsCodeLocation = RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index", fallbackExtension:nil)!
let rootView = RCTRootView(bundleURL: jsCodeLocation, moduleName: "RNReaderSDKSample", initialProperties: nil, launchOptions: launchOptions)
let rootViewController = UIViewController()
rootViewController.view = rootView
Expand Down
2 changes: 1 addition & 1 deletion reader-sdk-react-native-quickstart/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ target 'RNReaderSDKSample' do
# ...but if you bump iOS deployment target, Flipper barfs again "Time.h:52:17: error: typedef redefinition with different types"
# We need to make one crude patch to RCT-Folly - set `__IPHONE_10_0` to our iOS target + 1
# https://github.com/facebook/flipper/issues/834 - 84 comments and still going...
__apply_Xcode_12_5_M1_post_install_workaround(installer)
# __apply_Xcode_12_5_M1_post_install_workaround(installer)
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
end
end
Loading

0 comments on commit 37c8636

Please sign in to comment.