Giter VIP home page Giter VIP logo

react-native-square-reader-sdk's Introduction

React Native plugin for Reader SDK

Build Status npm version

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
  • Android: 1.7.5 and above

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

In this repo

In addition to the standard React Native directories, this repo includes:

Build requirements

Android

  • minSdkVersion is API 24 or higher.
  • Android SDK platform: API 30.
  • Android SDK build tools: 28.0.3
  • Android Gradle Plugin: 3.0.0 or greater.
  • Support library: 28.0.0
  • Google Play Services: 16.0.1
  • Google APIs Intel x86 Atom_64 System Image

iOS

  • Xcode version: 10.2 or greater.
  • iOS Base SDK: 11.1 or greater.
  • Deployment target: iOS 11.0 or greater.

Reader SDK requirements and limitations

  • Reader SDK is only available for accounts based in the United States. Authorization requests for accounts based outside the United States return an error.
  • Reader SDK may not be used for unattended terminals. Using Reader SDK to implement payment solutions in unattended terminals or kiosks (for example, vending machines) is strictly prohibited.
  • Reader SDK requires an authorization token from the Mobile Authorization API to connect Square Readers and accept payments.
  • Reader SDK only supports on-screen tipping. Digital receipts and tips can be configured in Reader SDK. Tipping on printed receipts is not supported at this time.
  • Reader SDK cannot issue refunds. Refunds can be issued programmatically using the Refunds API or manually in the Square Dashboard.
  • Reader SDK is not supported in the Square sandbox. See Testing Mobile Apps for testing recommendations.
  • Your version of Reader SDK must adhere to the Square SDK update policy. To limit risk to developers and their users, Square enforces an update policy for Reader SDK that requires developers to keep their version of Reader SDK current.

License

Copyright 2019 Square Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

react-native-square-reader-sdk's People

Contributors

armaxis avatar brandonjenniges avatar caleb-harrelson avatar charmisg avatar daphnechiu avatar fka3 avatar fobos531 avatar goblinhorde avatar hukid avatar jawspeak avatar jessdelacruzsantos avatar jhankin avatar mohsin-sq avatar okenshields avatar plinio-square avatar sudoplz avatar tamerbader avatar tylerc avatar vishwajitshep0815 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-square-reader-sdk's Issues

Expo compatibility

Describe your question

Square Readers is the core functionality React Native application I'm going to build. Does anybody know if I can start my app with Expo?

Square reader sdk invoked the app crash after upgraded to expo44

Describe the issue

After I upgraded my app to Expo 44 with bare workflow and the android api level is upgraded to 30, the square reader did not work properly on the android devices. It has several problems:
Problem 1: App crashed sometimes only in the production mode, below are the steps :

  1. build a release bundle(apk)
  2. install the apk on an android device(device info will be listed below)
  3. authorize with the sqaure development code
  4. enter reader settings and start connect a reader
  5. give the app permissions
  6. after give all the 3 permissions, the app crashed and reload

Logcat listed somer error when app crashed:

2022-01-05 15:12:36.420 11915-11915/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.guoxiaoyang.moegoreleasetest, PID: 11915
    java.lang.IllegalStateException: Scope com.squareup.container.WorkflowScope was destroyed
        at shadow.mortar.MortarScope.assertNotDead(MortarScope.java:264)
        at shadow.mortar.MortarScope.findService(MortarScope.java:131)
        at shadow.mortar.MortarScope.getService(MortarScope.java:116)
        at com.squareup.container.inversion.FlowRunnerKt.getFlow(FlowRunner.kt:76)
        at com.squareup.ui.main.GatekeepersRootWorkflow$render$1$1.invokeSuspend(GatekeepersRootWorkflow.kt:99)
        at com.squareup.ui.main.GatekeepersRootWorkflow$render$1$1.invoke(Unknown Source:8)
        at com.squareup.ui.main.GatekeepersRootWorkflow$render$1$1.invoke(Unknown Source:4)
        at com.squareup.workflow1.InterceptedRenderContext$runningSideEffect$withScopeReceiver$1.invokeSuspend(WorkflowInterceptor.kt:306)
        at com.squareup.workflow1.InterceptedRenderContext$runningSideEffect$withScopeReceiver$1.invoke(Unknown Source:8)
        at com.squareup.workflow1.InterceptedRenderContext$runningSideEffect$withScopeReceiver$1.invoke(Unknown Source:2)
        at com.squareup.workflow1.InterceptedRenderContext$runningSideEffect$1$1.invokeSuspend(WorkflowInterceptor.kt:311)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:69)
        at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:244)
        at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:161)
        at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:398)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:432)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:421)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:329)
        at kotlinx.coroutines.flow.SharedFlowImpl.tryEmit(SharedFlow.kt:368)
        at com.squareup.gatekeeper.Gatekeeping.updateGatekeepers(Gatekeeping.kt:31)
        at com.squareup.ui.main.Historian.nextHistoryToShowWhileResetting(Historian.kt:343)
        at com.squareup.ui.main.Historian.resetHistory(Historian.kt:239)
        at com.squareup.ui.main.WorkflowPosContainer.resetHistory(WorkflowPosContainer.kt:184)
        at com.squareup.ui.systempermissions.EnableDeviceSettingsPresenter.updatePermissionsState(EnableDeviceSettingsPresenter.java:137)
        at com.squareup.ui.systempermissions.EnableDeviceSettingsPresenter.onResume(EnableDeviceSettingsPresenter.java:82)
        at com.squareup.pauses.PauseAndResumePresenter.activityResumed(PauseAndResumePresenter.java:72)
        at com.squareup.ui.main.MainActivity.onResume(MainActivity.java:218)
        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1454)
        at android.app.Activity.performResume(Activity.java:8111)
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4647)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4690)
        at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8167)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
2022-01-05 15:12:36.571 1429-1953/? E/InputDispatcher: channel '825c9b com.guoxiaoyang.moegoreleasetest/com.squareup.ui.main.ApiMainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2022-01-05 15:12:36.614 1429-1953/? E/InputDispatcher: channel 'fbd0249 com.guoxiaoyang.moegoreleasetest/com.guoxiaoyang.moegoreleasetest.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2022-01-05 15:12:36.617 2284-2339/? E/RequestManager_FLP: [LocationManager] Location remove 60461c4 from com.guoxiaoyang.moegoreleasetest
2022-01-05 15:12:36.620 1429-1575/? E/WindowManager: RemoteException occurs on reporting focusChanged, w=Window{825c9b u0 com.guoxiaoyang.moegoreleasetest/com.squareup.ui.main.ApiMainActivity EXITING}
    android.os.DeadObjectException
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(BinderProxy.java:575)
        at android.view.IWindow$Stub$Proxy.windowFocusChanged(IWindow.java:829)
        at com.android.server.wm.WindowState.reportFocusChangedSerialized(WindowState.java:3800)
        at com.android.server.wm.WindowManagerService$H.handleMessage(WindowManagerService.java:5438)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.os.HandlerThread.run(HandlerThread.java:67)
        at com.android.server.ServiceThread.run(ServiceThread.java:44)
2022-01-05 15:12:36.626 1429-1483/? E/WindowManager: win=Window{825c9b u0 com.guoxiaoyang.moegoreleasetest/com.squareup.ui.main.ApiMainActivity EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:1249 com.android.server.wm.AppWindowToken.destroySurfaces:1230 com.android.server.wm.WindowState.onExitAnimationDone:5189 com.android.server.wm.-$$Lambda$01bPtngJg5AqEoOWfW3rWfV7MH4.accept:2 java.util.ArrayList.forEach:1262 com.android.server.wm.AppWindowToken.onAnimationFinished:3941 com.android.server.wm.AppWindowToken.commitVisibility:914 
2022-01-05 15:12:36.642 2284-2339/? E/RequestManager_FLP: [LocationManager] Location remove 7902a9 from com.guoxiaoyang.moegoreleasetest
2022-01-05 15:12:37.629 1429-1577/? E/WindowManager: win=Window{47aa39f u0 Splash Screen com.guoxiaoyang.moegoreleasetest EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:1249 com.android.server.wm.AppWindowToken.destroySurfaces:1230 com.android.server.wm.WindowState.onExitAnimationDone:5189 com.android.server.wm.WindowStateAnimator.onAnimationFinished:320 com.android.server.wm.WindowState.onAnimationFinished:5630 com.android.server.wm.-$$Lambda$yVRF8YoeNdTa8GR1wDStVsHu8xM.run:2 com.android.server.wm.SurfaceAnimator.lambda$getFinishedCallback$0$SurfaceAnimator:100 
2022-01-05 15:12:37.633 1076-1076/? E/audit: type=1327 audit(1641366757.619:412134): proctitle="com.guoxiaoyang.moegoreleasetest"

Problem 2: the button did not response while trying to connect a reader, steps below:

  1. after the app crashed and reload, click the reader settings in the demo app
  2. enter the Square reader connecting page, click the Connect a reader button
  3. it can not have any response, thus I can't connect to a reader
  4. sometimes I can connect to a reader, but the connected reader name does not response to modify the setting

Problem 2 can be reproduced both in the production mode and the debug mode(react-native android).
Logcat did not show any related error of problem 2.

Environment:

  - platform: Android
  - OS and version: Sumsung Note 9
  - Android version: Android 10
  - Kernel version: 4.9.186-22986754
  - dev environment: MacOS
  - Reader SDK version: 1.5.1

System:
    OS: macOS 12.0.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 772.26 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.5 - ~/.nvm/versions/node/v14.17.5/bin/node
    Yarn: 1.22.15 - ~/.yarn/bin/yarn
    npm: 6.14.14 - ~/.nvm/versions/node/v14.17.5/bin/npm
    Watchman: HEAD-49f3831 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    Android SDK:
      API Levels: 28, 29, 30, 31
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7678000
    Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_301 - /Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.3 => 0.64.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

reproduce

This demo with the square reader quickstart code can reproduce both the two problems above: https://github.com/GuoXiaoyang/moego-release-test

Screen Recording

Screen_Recording_20220105-154301_moego-release-test.mp4

Additional context

Support for other countries?

Hey,

Just wondering why the Reader SDK is only available for US accounts, any plans to add support for other countries?

Αndroid Q (10) crash

Describe the issue

When I try to launch the app on Android Q (10) the app instantly crashes.

Error log details:

2019-09-07 04:46:52.364 1931-1931/? E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.myapp.app.android, PID: 1931
  io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.lang.IllegalArgumentException: Invalid primitive conversion from long to int
      at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
      at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
      at io.reactivex.internal.observers.ConsumerSingleObserver.onError(ConsumerSingleObserver.java:46)
      at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onError(SingleFlatMap.java:90)
      at io.reactivex.internal.observers.ResumeSingleObserver.onError(ResumeSingleObserver.java:51)
      at io.reactivex.internal.disposables.EmptyDisposable.error(EmptyDisposable.java:78)
      at io.reactivex.internal.operators.single.SingleError.subscribeActual(SingleError.java:42)
      at io.reactivex.Single.subscribe(Single.java:3438)
      at io.reactivex.internal.operators.single.SingleResumeNext$ResumeMainSingleObserver.onError(SingleResumeNext.java:80)
      at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onError(SingleMap.java:69)
      at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79)
      at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:119)
      at android.os.Handler.handleCallback(Handler.java:883)
      at android.os.Handler.dispatchMessage(Handler.java:100)
      at android.os.Looper.loop(Looper.java:214)
      at android.app.ActivityThread.main(ActivityThread.java:7356)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
   Caused by: io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.lang.IllegalArgumentException: Invalid primitive conversion from long to int
      at com.squareup.receiving.ReceivedResponse$Companion$receiveFromRetrofit$2$2.apply(ReceivedResponse.kt:167)
      at com.squareup.receiving.ReceivedResponse$Companion$receiveFromRetrofit$2$2.apply(ReceivedResponse.kt:105)
      at io.reactivex.internal.operators.single.SingleResumeNext$ResumeMainSingleObserver.onError(SingleResumeNext.java:73)
      at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onError(SingleMap.java:69) 
      at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79) 
      at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:119) 
      at android.os.Handler.handleCallback(Handler.java:883) 
      at android.os.Handler.dispatchMessage(Handler.java:100) 
      at android.os.Looper.loop(Looper.java:214) 
      at android.app.ActivityThread.main(ActivityThread.java:7356) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
   Caused by: java.lang.IllegalArgumentException: Invalid primitive conversion from long to int
      at java.lang.reflect.Field.getInt(Native Method)
      at com.squareup.util.Telephony.<init>(Telephony.java:30)
      at com.squareup.util.Telephony_Factory.get(Telephony_Factory.java:21)
      at com.squareup.util.Telephony_Factory.get(Telephony_Factory.java:8)
      at com.squareup.util.AndroidModule_ProvideNetworkTypeFactory.get(AndroidModule_ProvideNetworkTypeFactory.java:21)
      at com.squareup.util.AndroidModule_ProvideNetworkTypeFactory.get(AndroidModule_ProvideNetworkTypeFactory.java:8)
      at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
      at com.squareup.server.RegisterHttpInterceptor.intercept(RegisterHttpInterceptor.java:42)
      at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
      at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
      at com.squareup.server.UrlRedirectInterceptor.intercept(UrlRedirectInterceptor.java:40)
      at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
2019-09-07 04:46:52.364 1931-1931/? E/AndroidRuntime:     at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
      at com.squareup.server.ProfilingInterceptor.intercept(ProfilingInterceptor.java:24)
      at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
      at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
      at com.squareup.http.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:32)
      at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
      at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
      at shadow.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
      at shadow.okhttp3.RealCall.execute(RealCall.java:92)
      at shadow.retrofit2.OkHttpCall.execute(OkHttpCall.java:186)
      at shadow.retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:45)
      at io.reactivex.Observable.subscribe(Observable.java:12090)
      at shadow.retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34)
      at io.reactivex.Observable.subscribe(Observable.java:12090)
      at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
      at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
      at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
      at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
      at java.lang.Thread.run(Thread.java:919)
2019-09-07 04:46:52.435 1282-1871/? E/InputDispatcher: channel '91ada36 com.myapp.app.android/com.myapp.app.android.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2019-09-07 04:47:00.584 2087-2087/? E/roid.apps.turb: Not starting debugger since process cannot load the jdwp agent.

To Reproduce

  • Run any app that contains the SDK on Android Q (10) (API 29)

Expected behavior

Environment (please complete the following information):

  • platform: Android 10 device
  • Reader SDK version: 98e75a0
React Native Environment Info:
    System:
      OS: macOS 10.14.4
      CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
      Memory: 20.69 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
      Yarn: 1.12.1 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5692245
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3
      react-native: 0.59.9 => 0.59.9
    npmGlobalPackages:
      react-native-cli: 2.0.1

Add CocoaPods link support

The plugin isn't configured to be able to be linked with cocoaPods, need up the podsepc to support that.

Problems with setup script

Describe your question

I am attempting to build an iOS app that uses this library and am unable to build the app due to problems with the setup shell script.

My first problem is that the script does not exist in the required location during build time. The script should be located here: ${FRAMEWORKS}/SquareReaderSDK.framework/setup
However, I have checked that directory and found no setup script.

My other problem is with the contents of the setup script. In the code-signing section near the end, there are two variables that are not defined in the script:
CODESIGNING_FOLDER_PATH
EXPANDED_CODE_SIGN_IDENTITY

Has anyone experienced similar problems? Thanks!

Support for the Square Payments API

Describe the functionality you would like to see

Currently the Square Reader SDK only supports the deprecated Square Transactions API. If it supported the new Payments API, it would be much more up to date with Squares new feature sets.

How would this feature make the plugin more useful?

This would be particularly valuable to my company because we require the ability to collect fees on in-person payments as well as payments made on our website. If we could collect fees on in person transactions we would switch from Stripe to Square in a heartbeat.

squarereadersdk Not found

While installing the application in the IOS Simulator in have faced an issue i.e (Module 'SquareReaderSDK' not found ). Can u help me to resolve the following issue ASAP

RN 0.57.8 throws error

Using a clean build of a test project, I follow the install instructions and get the following error:

Android dependency 'com.android.support:support-v4' has different version for the compile (26.0.2) and runtime (26.1.0) classpath. You should manually set the same version via DependencyResolution

** UPDATE **
As per the full android setup guide, here are the settings that needed to be set:

android/build.gradle:
ext {
buildToolsVersion = "26.0.2"
minSdkVersion = 21
compileSdkVersion = 26
targetSdkVersion = 26
supportLibVersion = "26.0.2"
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}

Then in android/app/build.gradle under dependencies:
compile ("com.android.support:support-v4:26.0.2") {
force = true
}

We need an update for RN 0.59 since that will be the version to support 64bit on android which becomes mandatory in August 2019.

Adding Ability to Close Checkout Screen on Timeout

I want to be able to programmatically close the checkout screen if it is left open. Adding timeout functionality and callback for closing would make this possible.

This would allow users to reset their screen incase something occurs and they cannot close out during the transaction. Example: they have to walk away to address an issue, retrieve a delivery ect. We do not want to leave the ability to pay for something up all the time and should have a timeout functionality.

Unable to provide signature

Describe the issue

Signature screen does not allow use to create smooth lines.
We've stripped our App to only the square SDK.
We call startCheckoutAsync at within App.jsx opens the Square SDK, after successfully collecting payment the signature screen opens. When trying to sign, the finger does not create smooth lines, but what appears to be dragged dots. Signature screen, is also dragged and closed with moving the finger downward while signing.

To Reproduce

  1. Initialize the SDK, ensure signature settings are on
  2. Process a successful payment
  3. Get to the signature screen
  4. try signing

File

Tip Screen Won't Display

Describe the issue

Transactions with the sdk won't display tipping options or a separate tipping screen no matter how the checkout parameters are defined.

To Reproduce

  • go through all basic installation
  • authenticate reader
  • startCheckoutAsync with the following parameters
amountMoney: {
	amount: 12,
	currencyCode: 'USD'
},
note: 'test checkout',
additionalPaymentTypes: ['cash', 'card'],
tipSettings: {
	showCustomTipField: true,
	tipPercentages: [10, 15, 25],
	showSeparateTipScreen: true
} 
  • pay with cash/card
  • the app goes straight to the receipt screen. No tipping options are ever presented

Expected behavior

tipping options to be displayed

according to the documentation setting tipSettings.showSeparateTipScreen = true should be presenting me with a second screen during the checkout process with which to enter a tip, before being taken to the receipt screen.

Environment (please complete the following information):

  • MacOS: 10.15.2
  • react: 16.9.0
  • react-native: 0.61.5
  • affecting devices: iPad devices simulator and physical (only type tested, may affect more)
  • react-native-square-reader-sdk: 1.3.0
System:
    OS: macOS 10.15.2
    CPU: (4) x64 Intel(R) Core(TM) i3-8100B CPU @ 3.60GHz
    Memory: 23.19 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.8.0 - ~/.nvm/versions/node/v12.8.0/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.13.2 - ~/.nvm/versions/node/v12.8.0/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.1, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    Android SDK:
      API Levels: 28
      Build Tools: 28.0.3
      System Images: android-25 | Google APIs Intel x86 Atom
  IDEs:
    Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5 
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-rename: 2.4.1

Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.1)

Hey there,

since that morning I can no longer build the android project.

Here's the full error:

org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':react-native-square-reader-sdk:classpath'.
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:944)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1600(DefaultConfiguration.java:120)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationArtifactCollection.ensureResolved(DefaultConfiguration.java:1285)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationArtifactCollection.getArtifacts(DefaultConfiguration.java:1257)
	at org.gradle.composite.internal.CompositeBuildClassPathInitializer.execute(CompositeBuildClassPathInitializer.java:42)
	at org.gradle.composite.internal.CompositeBuildClassPathInitializer.execute(CompositeBuildClassPathInitializer.java:29)
	at org.gradle.api.internal.initialization.DefaultScriptClassPathResolver.resolveClassPath(DefaultScriptClassPathResolver.java:37)
	at org.gradle.api.internal.initialization.DefaultScriptHandler.getScriptClassPath(DefaultScriptHandler.java:72)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.defineScriptHandlerClassScope(DefaultPluginRequestApplicator.java:204)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:82)
	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:184)
	at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:61)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:58)
	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:41)
	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
	at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:64)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:34)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:110)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:667)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:136)
	at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
	at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
	at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
	at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:261)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:173)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:132)
	at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:110)
	at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.java:87)
	at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.java:84)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
	at org.gradle.internal.invocation.GradleBuildController.configure(GradleBuildController.java:84)
	at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:64)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:49)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
	at org.gradle.util.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.1).
Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar
	at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(DefaultBuildableArtifactResolveResult.java:27)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifactFromCache(CachingModuleComponentRepository.java:342)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifact(CachingModuleComponentRepository.java:293)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.resolveArtifact(ErrorHandlingModuleComponentRepository.java:181)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainArtifactResolver.resolveArtifact(RepositoryChainArtifactResolver.java:78)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DefaultArtifactSet$LazyArtifactSource.create(DefaultArtifactSet.java:170)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DefaultArtifactSet$LazyArtifactSource.create(DefaultArtifactSet.java:157)
	at org.gradle.api.internal.artifacts.DefaultResolvedArtifact.getFile(DefaultResolvedArtifact.java:135)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ArtifactBackedResolvedVariant$DownloadArtifactFile.run(ArtifactBackedResolvedVariant.java:148)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.access$900(DefaultBuildOperationExecutor.java:63)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$ParentPreservingQueueWorker.execute(DefaultBuildOperationExecutor.java:378)
	at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.runOperation(DefaultBuildOperationQueue.java:230)
	at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.access$600(DefaultBuildOperationQueue.java:172)
	at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable$1.call(DefaultBuildOperationQueue.java:209)
	at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable$1.call(DefaultBuildOperationQueue.java:203)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
	at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.runBatch(DefaultBuildOperationQueue.java:202)
	at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.run(DefaultBuildOperationQueue.java:177)
	... 6 more


Can you please try building after a project clean, I think this may be because of dropped support for that gradle version or something.
I'm saying that because of https://stackoverflow.com/questions/52946371/android-studio-could-not-find-intellij-core-jar

Here's my project build.gradle by the way:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

ext {
    googlePlayServiceVersion = "15.0.1" //15.0.1 needed by firebase, 12.0.1 needed for readerSDK
    googlePlayServicesVersion = googlePlayServiceVersion
    // The only way to use 15.0.1 without crashes is to add
    //    implementation 'com.google.android.gms:play-services-safetynet:15.0.1'
    // in app/build.gradle
    readerSdkVersion = '1.0.4'

    // Other settings
    minSdkVersion = 19 // minSdkVersion 19 needed by square sdk
    compileSdkVersion = 27
    buildToolsVersion = "27.0.3"
    targetSdkVersion = 26 // targetSdkVersion 26 needed by square sdk 1.0.1 (25 might work too)
    supportLibVersion = "27.1.1"
}

buildscript {
    repositories {
        google()
        // google() only used if gradle ver > 4.4 otherwise use the maven google lines below
//        maven {
//            url 'https://maven.google.com/'
//            name 'Google'
//        }

        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.bugsnag:bugsnag-android-gradle-plugin:3.+'

        // added this for firebase (react-native-firebase module).
        classpath 'com.google.gms:google-services:4.0.1'

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

        // Applicable ONLY when building from source
//        classpath 'de.undercouch:gradle-download-task:3.1.2'

    }
}

allprojects {
    repositories {
        mavenLocal()
        google() // <-- Add this line above jcenter
        jcenter()
        // Comment the following 3 lines ONLY when building from source
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }

    }
}

subprojects{ subProject ->
    subProject.afterEvaluate {
        if(it.hasProperty('android')){
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }
    subProject.configurations.all{ Configuration configuration ->
        final dependencies = configuration.getDependencies()
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex')
                    && !details.requested.name.contains('multidex-instrumentation')) {
                details.useVersion rootProject.ext.supportLibVersion
            }
        }
    }
}

task findJarsContaining {
    doLast {
        def jarTree = configurations.runtime.asFileTree.matching {
            include '*.jar'
        }
        jarTree.files.each { jarFile ->
            def matches = zipTree(jarFile).matching {
                include 'com/google/android/gms/auth/api/signin/internal/zzf.class'
            }.files
            if (matches) {
                println "Found $matches.size() matches in $jarFile.name"
            }
        }
    }
}


I'm using Android Studio 3.2.1 on macOS High Sierra.

Thank you.

Unable to load script

While running the application with the command 'react-native run-android'.

I have faced a issue ' Unable to load script from assets 'index.android.bundle'

framework is 175Mb

Currently SquareReaderSDK.framework is 175Mb taking up the bulk of our binary's size. Is there any way to make this smaller?

Is Microphone Permission Still Required?

NSMicrophoneUsageDescription : "This app integrates with Square for card processing. To swipe magnetic cards via the headphone jack, Square requires access to the microphone."

Our devices do not use the headphone jack. Is there a way we can bypass this required permission?

'tipSettings' is not an object error for no good reason.

If I call startCheckoutAsync with the following check param:

{
    additionalPaymentTypes =     (
        "manual_card_entry"
    );
    allowSplitTender = 0;
    alwaysRequireSignature = 0;
    amountMoney =     {
        amount = 1;
        currencyCode = USD;
    };
    note = "bla bla";
    skipReceipt = 1;
    tipSettings = "<null>"; // <-- this is set to null in javascript
}

I will always get an error 'tipSettings' is not an object coming from this line of code

if (jsCheckoutParameters[@"tipSettings"] && ![jsCheckoutParameters[@"tipSettings"] isKindOfClass:[NSDictionary class]]) {

Therefore the jsCheckoutParameters[@"tipSettings"] line won't do the trick. It looks like I'll have to set the js value to undefined in js. Is that intended behaviour?
In the tipSettings doc it says that the default value is null, but looks like the default value should be undefined or the checks in native code should be different.

'CardBrand' is not a type

In Technical Reference, there is CardBrand object. Actually it's not a type or enum, we should correct it just a list of const strings

Reader SDK Availability outsite US

Hi

We're looking at Square / Reader SDK for a project we're starting in a couple of months. Do you have a time-frame for making this available within other regions specifically the UK?..

Configurations for Android Product Flavors

Hi!
It would be great if there was an example of how to use SDK with different credentials for different product flavors.

For example: I need to use different SQUARE_READER_SDK_APPLICATION_ID & SQUARE_READER_SDK_REPOSITORY_PASSWORD credentials for app1 & app 2.

productFlavors {
        app1 {}
        app2 {}
    }

maven {
            url "https://sdk.squareup.com/android"
            credentials {
                username SQUARE_READER_SDK_APPLICATION_ID
                password SQUARE_READER_SDK_REPOSITORY_PASSWORD
            }
        }

Unexpected callback error, Invalid primitive conversion from long to int

Hey there,

we've been receiving this error in production for a while now, here's the full stacktrace:

java.lang.RuntimeException Unexpected callback error 
    SquareCallback.java:85 com.squareup.server.SquareCallback.unexpectedError
    SquareCallback.java:61 com.squareup.server.SquareCallback.failure
    CallbackRunnable.java:53 shadow.retrofit.CallbackRunnable$2.run
    StoppableHandlerExecutor.java:155 com.squareup.util.StoppableHandlerExecutor$RemovingRunnableWrapper.run
    Handler.java:878 android.os.Handler.handleCallback
    Handler.java:99 android.os.Handler.dispatchMessage
    Looper.java:209 android.os.Looper.loop
    ActivityThread.java:7046 android.app.ActivityThread.main
    Method.java:-2 java.lang.reflect.Method.invoke
    RuntimeInit.java:486 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
    ZygoteInit.java:862 com.android.internal.os.ZygoteInit.main


Caused by: java.lang.IllegalArgumentException Unexpected Retrofit error:  
    ReceivedResponse.kt:152 com.squareup.receiving.ReceivedResponse$Companion.fromRetrofitError
    Unknown:2 com.squareup.receiving.ReceivedResponse.fromRetrofitError
    SquareEndpoints.java:16 com.squareup.servercall.SquareEndpoints.errorToCallState
    SquareCallback.java:27 com.squareup.server.SquareCallback.failure
    CallbackRunnable.java:53 shadow.retrofit.CallbackRunnable$2.run
    StoppableHandlerExecutor.java:155 com.squareup.util.StoppableHandlerExecutor$RemovingRunnableWrapper.run
    Handler.java:878 android.os.Handler.handleCallback
    Handler.java:99 android.os.Handler.dispatchMessage
    Looper.java:209 android.os.Looper.loop
    ActivityThread.java:7046 android.app.ActivityThread.main
    Method.java:-2 java.lang.reflect.Method.invoke
    RuntimeInit.java:486 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
    ZygoteInit.java:862 com.android.internal.os.ZygoteInit.main


Caused by: shadow.retrofit.RetrofitError Invalid primitive conversion from long to int 
    RestAdapter.java:400 shadow.retrofit.RestAdapter$RestHandler.invokeRequest
    RestAdapter.java:220 shadow.retrofit.RestAdapter$RestHandler.access$100
    RestAdapter.java:278 shadow.retrofit.RestAdapter$RestHandler$2.obtainResponse
    CallbackRunnable.java:42 shadow.retrofit.CallbackRunnable.run
    ThreadPoolExecutor.java:1167 java.util.concurrent.ThreadPoolExecutor.runWorker
    ThreadPoolExecutor.java:641 java.util.concurrent.ThreadPoolExecutor$Worker.run
    Threads.java:34 com.squareup.util.Threads$1.lambda$newThread$0
    Unknown:2 com.squareup.util.Threads$1$$Lambda$1.run
    Thread.java:919 java.lang.Thread.run


Caused by: java.lang.IllegalArgumentException Invalid primitive conversion from long to int 
    Field.java:-2 java.lang.reflect.Field.getInt
    Telephony.java:30 com.squareup.util.Telephony.<init>
    Telephony_Factory.java:21 com.squareup.util.Telephony_Factory.get
    Telephony_Factory.java:8 com.squareup.util.Telephony_Factory.get
    AndroidModule_ProvideNetworkTypeFactory.java:22 com.squareup.util.AndroidModule_ProvideNetworkTypeFactory.get
    AndroidModule_ProvideNetworkTypeFactory.java:8 com.squareup.util.AndroidModule_ProvideNetworkTypeFactory.get
    DoubleCheck.java:47 dagger.internal.DoubleCheck.get
    RegisterHttpInterceptor.java:42 com.squareup.server.RegisterHttpInterceptor.intercept
    RealInterceptorChain.java:92 shadow.okhttp3.internal.http.RealInterceptorChain.proceed
    RealInterceptorChain.java:67 shadow.okhttp3.internal.http.RealInterceptorChain.proceed
    GzipRequestInterceptor.java:32 com.squareup.http.GzipRequestInterceptor.intercept
    RealInterceptorChain.java:92 shadow.okhttp3.internal.http.RealInterceptorChain.proceed
    RealInterceptorChain.java:67 shadow.okhttp3.internal.http.RealInterceptorChain.proceed
    ProfilingInterceptor.java:24 com.squareup.server.ProfilingInterceptor.intercept
    RealInterceptorChain.java:92 shadow.okhttp3.internal.http.RealInterceptorChain.proceed
    RealInterceptorChain.java:67 shadow.okhttp3.internal.http.RealInterceptorChain.proceed
    RealCall.java:185 shadow.okhttp3.RealCall.getResponseWithInterceptorChain
    RealCall.java:69 shadow.okhttp3.RealCall.execute
    Ok3Client.java:40 shadow.com.jakewharton.retrofit.Ok3Client.execute
    RestAdapter.java:326 shadow.retrofit.RestAdapter$RestHandler.invokeRequest
    RestAdapter.java:220 shadow.retrofit.RestAdapter$RestHandler.access$100
    RestAdapter.java:278 shadow.retrofit.RestAdapter$RestHandler$2.obtainResponse
    CallbackRunnable.java:42 shadow.retrofit.CallbackRunnable.run
    ThreadPoolExecutor.java:1167 java.util.concurrent.ThreadPoolExecutor.runWorker
    ThreadPoolExecutor.java:641 java.util.concurrent.ThreadPoolExecutor$Worker.run
    Threads.java:34 com.squareup.util.Threads$1.lambda$newThread$0
    Unknown:2 com.squareup.util.Threads$1$$Lambda$1.run
    Thread.java:919 java.lang.Thread.run

We have no idea about how we can reproduce that, because we're receiving it in bugsnag and there are no clear indications as to when that happens, but ALL of the errors took place on Android Q.

We're using version 1.0 of your react-native sdk, I'm wondering if that's a known issue that's fixed.

Thank you

SOLVED: authorizeAsync(authCode) crashes iPad, but not simulator.

When I run the authorizeAsync method on an iPad, the app crashes and cannot restart. The code runs, as I am able to log the value after the await, however the app crashes (stops and force exits) right after. To run again, it needs to be reinstalled (deleted and rebuilt in xcode). The app only crashes with a valid authcode. Invalid codes return proper error messages and the app continues running fine.

It works as expected in the simulator however.

Device permissions are working fine and handled in previous screens.

To Reproduce

For example -

  1. Connect iPad device to Xcode and build app to that device
  2. Call authorizeAsync(authCode)

Here the piece of code that reproduce the issue.

 import { authorizeAsync } from 'react-native-square-reader-sdk';

  authorizeReader = async (authCode) => {
      try {
          // using a generated mobile auth code for quick start
          const authorizedLocation = await authorizeAsync(authCode);
          console.log(authorizedLocation);
      } catch(error) {
          console.log(error)
      }
  }

Expected behavior

Authorization method resolves and the app continues running.

Environment (please complete the following information):

  • platform: iOS
  • OS and version: target iOS 11.1+
  • dev environment: MacOS 10.15
  • Reader SDK version: 1.3.0

React Native Environment Info:
System:
OS: macOS 10.15
CPU: (4) x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
Memory: 440.02 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.16.1 - ~/.nvm/versions/node/v8.16.1/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8

Device:
iPad Pro (9.7-inch)
iOS 13.2.2

UPDATE:

I added an exception breakpoint, and then called bt after the (lldb) in the console and this is what I got:

* thread #15, queue = 'com.apple.root.default-qos', stop reason = signal SIGABRT
  * frame #0: 0x000000018285a930 libsystem_kernel.dylib`__abort_with_payload + 8
    frame #1: 0x000000018285ef24 libsystem_kernel.dylib`abort_with_payload_wrapper_internal + 100
    frame #2: 0x000000018285ef54 libsystem_kernel.dylib`abort_with_payload + 12
    frame #3: 0x0000000188c43cc8 TCC`__CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 192
    frame #4: 0x0000000188c43c08 TCC`__TCCAccessRequest_block_invoke.124 + 540
    frame #5: 0x0000000188c47b28 TCC`__tccd_send_message_block_invoke + 256
    frame #6: 0x000000018263cc84 libxpc.dylib`_xpc_connection_reply_callout + 60
    frame #7: 0x0000000182630f18 libxpc.dylib`_xpc_connection_call_reply_async + 76
    frame #8: 0x0000000108cfec58 libdispatch.dylib`_dispatch_client_callout3 + 16
    frame #9: 0x0000000108d1a29c libdispatch.dylib`_dispatch_mach_msg_async_reply_invoke + 388
    frame #10: 0x0000000108d1103c libdispatch.dylib`_dispatch_kevent_worker_thread + 1376
    frame #11: 0x0000000182780fc0 libsystem_pthread.dylib`_pthread_wqthread + 332

Frame 3 says __CRASHING_DUE_TO_PRIVACY_VIOLATION__, however I followed the instructions for updating info.plist. Here's a snippet of what I added for square in case I missed something:

	<key>NSBluetoothPeripheralUsageDescription</key>
	<string>This app integrates with Square for card processing. Square uses Bluetooth to connect your device to compatible hardware.</string>
	<key>NSCalendarsUsageDescription</key>
	<string>Allow Buddy Kiosk2 to access your calendar</string>
	<key>NSCameraUsageDescription</key>
	<string>This app integrates with Square for card processing. Upload your account logo, feature photo and product images with the photos stored on your mobile device.</string>
	<key>NSContactsUsageDescription</key>
	<string>Allow Buddy Kiosk2 to access your contacts</string>
	<key>NSLocationWhenInUseUsageDescription</key>
	<string>This app integrates with Square for card processing. To protect buyers and sellers, Square requires your location to process payments.</string>
	<key>NSMicrophoneUsageDescription</key>
	<string>This app integrates with Square for card processing. To swipe magnetic cards via the headphone jack, Square requires access to the microphone.</string>
	<key>NSMotionUsageDescription</key>
	<string>Allow Buddy Kiosk2 to access your device's accelerometer</string>
	<key>NSPhotoLibraryAddUsageDescription</key>
	<string>Give Buddy Kiosk2 permission to save photos</string>
	<key>NSPhotoLibraryUsageDescription</key>
	<string>This app integrates with Square for card processing. Upload your account logo, feature photo and product images with the photos stored on your mobile device.</string>
	<key>NSRemindersUsageDescription</key>
	<string>Allow Buddy Kiosk2 to access your reminders</string>

framework not found SquareReaderSDK

1 I follow the document step by step
https://github.com/square/react-native-square-reader-sdk/tree/master/reader-sdk-react-native-quickstart
and step 2 "pod install" not working. ( new project )
2. I used example code in the link above, still same error occured

https://prnt.sc/rbd5lt
https://prnt.sc/rbd5sg

i see header search path not include lib

i tried to insert manually but still not working too
https://prnt.sc/rbd64o
Please help me!

Environment (please complete the following information):

System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz
Memory: 43.11 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.3 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 27.0.3, 28.0.3, 29.0.0
System Images: android-24 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-rename: 2.4.1

Transaction_Id from cash payments

Describe the functionality you would like to see

In the checkout results, could we have the transaction_id or Payment_id for cash payments so we can then issue a refund programmatically using the refunds API?

How would this feature make the plugin more useful?

You can issue refunds for cash as opposed to just for card payments.

Additional context

Support countries other than the US

Describe the functionality you would like to see

Would love to see this project become available to all regions, not just the United States,

Don't think it needs much more explanation than that, or what the benefits would be...

Happy to dedicate some resources to making this happen.

Disable modal after successful transaction

Describe the functionality you would like to see

Option to disable change modal after a successful transaction. This doensn't happen in Android and only one modal can be visible at a time in IOS. Moreover the modal is on a timer with no way to keep it visible for longer or dissmiss it.

How would this feature make the plugin more useful?

Better user experience.

authorizeAsync(authCode) throws error (iOS)

Trying to authorize the reader returns

Cannot read property 'authorize' of undefined.

When I try to authorize the reader with the correct location and oauth param it returns an exception.

To me it looks like the SDK framework is not being instantiated correctly. Android works as expected.

const { RNReaderSDKAuthorization, RNReaderSDKCheckout, RNReaderSDKReaderSettings } = NativeModules;

export async function authorizeAsync(authCode) {
  try {
// it looks like that RNReaderSDKAuthorization is undefined
    return await RNReaderSDKAuthorization.authorize(authCode);
  } catch (ex) {
    throw createReaderSDKError(ex);
  }
}

The permissions have been granted on app start.

My workflow is:

  1. Request mobile auth code from API
  2. authorize async.
  3. let ReaderSDK checkout handle the rest

EDIT:

This is my AppDelegate.m main method.

#import "AppDelegate.h"
#import <CodePush/CodePush.h>
#import <Firebase.h>

#import "RNFirebaseNotifications.h" 
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

@import SquareReaderSDK;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];
  [RNFirebaseNotifications configure];
  [SQRDReaderSDK initializeWithApplicationLaunchOptions:launchOptions];
  
  NSURL *jsCodeLocation;
  
  #ifdef DEBUG
    jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.bundle?platform=ios&dev=true"];
  #else
    jsCodeLocation = [CodePush bundleURL];
  #endif

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"nativeApp"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
  
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  return YES;
}

@end

UPDATE 2:
After consulting the Square-slack channel, I ran react-native link again. It looks like something happened because now the build fails with the following:

(....)/Build/Intermediates.noindex/nativeApp.build/Debug-iphonesimulator/nativeApp.build/Script-86134DB72160763400358288.sh: line 2: /SquareReaderSDK.framework/setup: No such file or directory

Upon investigation, it turns out the only file that is in that folder that looks remotely close to SquareReaderSDK.framework is SquareReaderSDK.framework.xcent.

UPDATE 3

This fails also with the provided sample app. It looks like to script that calls the setup method has the wrong environment variables or the *.framework file is not copied.

Conflicting error on Android

Hi!

I get this error when I use Product Flavors
INSTALL_FAILED_CONFLICTING_PROVIDER

productFlavors {
        ver1 {
            flavorDimensions "environment"
            applicationIdSuffix ". ver1"
            versionNameSuffix "-ver1"
        }
        ver2 {
            flavorDimensions "environment"
            applicationIdSuffix ". ver2"
            versionNameSuffix "-ver2"
        }
    }

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 21
        compileSdkVersion = 28
        targetSdkVersion = 27
        supportLibVersion = "28.0.0"
        sqipVersion = "1.1.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
    }
}

error

"Square needs device storage" Android

Describe the issue

Android users are receiving "Square needs device storage" error, even with storage permissions accepted and showing as accepted in settings.

To Reproduce

Expected behavior

Environment (please complete the following information):

platform: Android
OS: Android 12
Reader SDK version: 1.4.0

Screenshots

Additional context

Screen Shot 2022-01-14 at 12 58 09 PM

Screen Shot 2022-01-14 at 1 01 00 PM

Support other countries than US (we are UK based)

Describe the functionality you would like to see

Would like to use reader SDK in the UK for react native project.
Alternatively, please let me know an alternative that would allow me to take contactless payments on our app using the Square reader. At a very simple level all I need to do it allow a user to buy a product pay by contactless and then if that transaction is successful trigger another function in my app. Any ideas on how this might be done without this reader sdk being released for the UK?

How would this feature make the plugin more useful?

Self-explanatory really.

Could not resolve all files for configuration ':app:debugCompileClasspath'. Could not find com.squareup.sdk.reader:reader-sdk-************:1.0.4.

when trying to integrate the square sdk in a react native project already created I came across the following error, I follow the install instructions and get the following error: "Could not resolve all files for configuration ':app:debugCompileClasspath'. Could not find com.squareup.sdk.reader:reader-sdk-************:1.0.4."
To make my app work i needed to manually change the readerSdkVersion on 'node_modules/react-native-square-reader-sdk/android/build.gradle' to '1.1.3' this reader sdk version i found following manually the url '"https://sdk.squareup.com/android/com/squareup/sdk/reader/reader-sdk-*****-*************/"

I'm using on my project the "react-native-square-reader-sdk" package version "1.0.3"

authCode throws error

authCode throws error -- null is not an object (evaluating 'RNReaderSDKAuthorization.authorize') when trying to get authorize whith my authCode. Can any one help me to get out of it.....

Reader SDK is missing `android:exported` property on AndroidManifest.xml - Issues with Android 12/SDK 31

Describe the issue

Targeting Android 12 (SDK 31) results in the following build error:

Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

List of apks:
[0] '<redacted>\android\app\build\outputs\apk\debug\app-debug.apk'
Installation failed due to: 'Failed to commit install session 1920095454 with command cmd package install-commit 1920095454. Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1920095454.tmp/base.apk (at Binary XML file line #407): com.squareup.queue.QueueService$BootReceiver: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'
Retry
Failed to launch an application on all devices

To Reproduce

  1. With an existing android project that uses the Square Reader SDK, set compileSdkVersion and targetSdkVersion to 31.
  2. Try to build and run the app.

Expected behavior

The app should build and install successfully.

Additional context

Frameworks/SquareReaderSDK.framework/setup: No such file or directory when building for react-native 0.60.5

Describe the issue

When I try to build my project in xcode, I get an error saying:
Frameworks/SquareReaderSDK.framework/setup: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

Error log details:

/Users/katye/Library/Developer/Xcode/DerivedData/HunkSquadv2-fwguotvgreavojcyfmgepmznkasw/Build/Intermediates.noindex/HunkSquadv2.build/Debug-iphonesimulator/HunkSquadv2.build/Script-0A78BC7D23735553005322EC.sh: line 4: /Users/katye/Library/Developer/Xcode/DerivedData/HunkSquadv2-fwguotvgreavojcyfmgepmznkasw/Build/Products/Debug-iphonesimulator/HunkSquadv2.app/Frameworks/SquareReaderSDK.framework/setup: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

Environment (please complete the following information):

  • platform: iOS
  • OS and version: iOS
  • dev environment: MacOS Catalina 10.15
  • Reader SDK version: 1.3.0

System:
OS: macOS 10.15.1
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 782.69 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 8.11.3 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 5.6.0 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5692245
Xcode: 11.2/11B52 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5
npmGlobalPackages:
react-native-create-library: 3.1.2
react-native: 0.55.4

Additional context

The documentation given in the get-started.md file doesn't seem to be up to date with the react native 0.60 release. I'm honestly at a loss of what to do to fix the problem. Any help would be greatly appreciated!

This project is using react-native 0.60.5

Error: Program type already present: com.jakewharton.threetenabp.AndroidThreeTen

Describe the issue

I am unable to run my project because of an error with AndroidThreeTen and as far as I can tell, this library is the only thing using it. Does anyone have any idea where to go with this? Thanks!

Error log details:

AGPBI: {"kind":"error","text":"Program type already present: com.jakewharton.threetenabp.AndroidThreeTen","sources":[{}],"tool":"D8"}
> Task :app:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: com.jakewharton.threetenabp.AndroidThreeTen

Expected behavior

The project should build and run correctly.

Environment (please complete the following information):

  • platform: Android
  • dev environment: MacOS
  • Reader SDK version: 1.3.0 and 1.3.1
  • Android Studio: v3.4.2
  • Gradle: v5.5.1

In addition: Run react-native info in your terminal and copy the results here.

System:
    OS: macOS 10.15.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 135.21 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 8.11.3 - /usr/local/bin/node
    Yarn: 1.7.0 - /usr/local/bin/yarn
    npm: 5.6.0 - /usr/local/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5692245
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.5 => 0.60.5 

Screenshots

image

Usage of UIWebView prevents uploading app to Apple's App Store Connect

Note: this problem exists also for react-native-square-in-app-payments. I am not opening a separate issue there.

The problem

  • I am trying to build and upload an app to Apple's App Store Connect, and I am getting the following error:
    ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).
  • I found the following in SO: https://stackoverflow.com/a/57730461/5532513
  • Running the following:
cd ~/Library/Developer/Xcode/Archives/<date>/myapp.xcarchive/Products/Applications/myapp.app

for framework in Frameworks/*.framework; do
  fname=$(basename $framework .framework)
  echo $fname
  nm $framework/$fname | grep UIWeb
done
  • I get:
CorePaymentCard
SquareCore
SquareInAppPaymentsSDK
SquareReader
SquareReaderSDK

explanation in the Apple developer site

https://apple.co/3eV0FgZ

Any suggestion on what to do?

authorizeAsync crashes app (ANDROID)

The app works perfectly fine when the authCode that is executed in authorizeAsync is incorrect or expired, but when it is correct the app crashes indefinitely. I saw another issue which is identical with this one ( #19 ) but it was on IOS. I have attached the logcat for this bug. I am looking forward for any help. Thanks a lot.

[iOS] PodsDummy_CocoaAsyncSocket is implemented in both SquareReaderSDK and...

Issue description

  • I have built my app for iOS, using the latest versions of react-native-square-reader-sdk and react-native-square-in-app-payments
  • I am using RN 0.62.2 and latest square-reader-sdk version (1.3.8)
  • When the app starts, the following message is printed:

objc[7955]: Class PodsDummy_CocoaAsyncSocket is implemented in both /Users/user172615/Library/Developer/CoreSimulator/Devices/B4BCD2F3-8787-4F77-AA76-5DB45FA2EA7C/data/Containers/Bundle/Application/36574EF1-2F18-444B-B47B-F9FEA43DC7BE/plumpPlum.app/Frameworks/SquareReaderSDK.framework/SquareReaderSDK (0x10ed07c90) and /Users/user172615/Library/Developer/CoreSimulator/Devices/B4BCD2F3-8787-4F77-AA76-5DB45FA2EA7C/data/Containers/Bundle/Application/36574EF1-2F18-444B-B47B-F9FEA43DC7BE/plumpPlum.app/plumpPlum (0x10ac05238). One of the two will be used. Which one is undefined.

Assertion failure in +[SQRDReaderSDK sharedSDK], /Users/build/.jenkins/workspace/CI+IOS+Reg+jTUsJA+ReaderSDK-Release-Bucket-0/ios-builder/s/r/ReaderSDK/Sources/SQRDReaderSDK.m:109
2020-06-16 09:17:24.441 [info][tid:com.facebook.react.JavaScript] 'loadSkus. Number of products is', 36
2020-06-16 09:17:24.441160+0200 plumpPlum[38754:294966] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Square Reader SDK: You must call +initializeWithApplicationLaunchOptions before calling +sharedSDK.'

Environment

System:
    OS: macOS 10.15.5
    CPU: (8) x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
    Memory: 284.37 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.16.2 - /usr/local/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6392135
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild

Reference id field on checkout

Hi!

Is it possible to set the reference id on the checkout? I would like to send the id of a record in my back-end so I can relate it with the transaction using a webhook, and I was hoping to do it using the reference id (as seen here and here) instead of the note field.

Thank you in advance!

SquareReaderSDK not found

I've followed the installation on this correctly, did this a couple months ago and didn't have any problems. Now when I'm running my build the react-native-square-reader-sdk is having a problem finding SquareReaderSDK in the node modules.

Specifically this file: In file included from node_modules/react-native-square-reader-sdk/ios/Converters/SQRDTenderCardDetails+RNReaderSDKAdditions.m:

It's failing to recognize the import. The Framework is installed and linked, just errors every time I try to run my project.

Unable to start receiver com.squareup.queue.QueueService$BootReceiver: java.lang.SecurityException: getSerial: The user 10191 does not meet the requirements to access device identifiers

Describe the issue

When I try to launch the app on Android Q (10) the app instantly crashes.

Error log details:

java.lang.RuntimeException Unable to start receiver com.squareup.queue.QueueService$BootReceiver: java.lang.SecurityException: getSerial: The user 10191 does not meet the requirements to access device identifiers. 
  ActivityThread.java:3797 android.app.ActivityThread.handleReceiver
  ActivityThread.java:219 android.app.ActivityThread.access$1400
  ActivityThread.java:1870 android.app.ActivityThread$H.handleMessage
  Handler.java:107 android.os.Handler.dispatchMessage
  Looper.java:214 android.os.Looper.loop
  ActivityThread.java:7356 android.app.ActivityThread.main
  Method.java:-2 java.lang.reflect.Method.invoke
  RuntimeInit.java:492 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
  ZygoteInit.java:930 com.android.internal.os.ZygoteInit.main


Caused by: java.lang.SecurityException getSerial: The user 10191 does not meet the requirements to access device identifiers. 
  Parcel.java:2071 android.os.Parcel.createException
  Parcel.java:2039 android.os.Parcel.readException
  Parcel.java:1987 android.os.Parcel.readException
  IDeviceIdentifiersPolicyService.java:159 android.os.IDeviceIdentifiersPolicyService$Stub$Proxy.getSerialForPackage
  Build.java:162 android.os.Build.getSerial
  AndroidModule.java:234 com.squareup.util.AndroidModule.provideBuild
  AndroidModule_ProvideBuildFactory.java:32 com.squareup.util.AndroidModule_ProvideBuildFactory.proxyProvideBuild
  AndroidModule_ProvideBuildFactory.java:23 com.squareup.util.AndroidModule_ProvideBuildFactory.get
  AndroidModule_ProvideBuildFactory.java:9 com.squareup.util.AndroidModule_ProvideBuildFactory.get
  CrashReportingLogger_Factory.java:86 com.squareup.log.CrashReportingLogger_Factory.get
  CrashReportingLogger_Factory.java:11 com.squareup.log.CrashReportingLogger_Factory.get
  DoubleCheck.java:47 dagger.internal.DoubleCheck.get
  CommonAppModule_Real_ProvideForegroundServiceStarterFactory.java:47 com.squareup.CommonAppModule_Real_ProvideForegroundServiceStarterFactory.get
  CommonAppModule_Real_ProvideForegroundServiceStarterFactory.java:14 com.squareup.CommonAppModule_Real_ProvideForegroundServiceStarterFactory.get
  DoubleCheck.java:47 dagger.internal.DoubleCheck.get
  QueueService_Starter_Factory.java:27 com.squareup.queue.QueueService_Starter_Factory.get
  QueueService_Starter_Factory.java:9 com.squareup.queue.QueueService_Starter_Factory.get
  DoubleCheck.java:47 dagger.internal.DoubleCheck.get
  DaggerReaderSdkReleaseAppComponent.java:4357 com.squareup.DaggerReaderSdkReleaseAppComponent.injectBootReceiver
  DaggerReaderSdkReleaseAppComponent.java:4267 com.squareup.DaggerReaderSdkReleaseAppComponent.inject
  QueueService.java:412 com.squareup.queue.QueueService$BootReceiver.onReceive
  ActivityThread.java:3788 android.app.ActivityThread.handleReceiver
  ActivityThread.java:219 android.app.ActivityThread.access$1400
  ActivityThread.java:1870 android.app.ActivityThread$H.handleMessage
  Handler.java:107 android.os.Handler.dispatchMessage
  Looper.java:214 android.os.Looper.loop
  ActivityThread.java:7356 android.app.ActivityThread.main
  Method.java:-2 java.lang.reflect.Method.invoke
  RuntimeInit.java:492 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
  ZygoteInit.java:930 com.android.internal.os.ZygoteInit.main

Environment (please complete the following information):

  • Platform: Pixel 2 XL on Android Q (10) - device
  • react-native-square-reader-sdk version: 98e75a0
  • Android SDK version: 1.3.2
React Native Environment Info:
    System:
      OS: macOS 10.14.4
      CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
      Memory: 20.69 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
      Yarn: 1.12.1 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5692245
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3
      react-native: 0.59.9 => 0.59.9
    npmGlobalPackages:
      react-native-cli: 2.0.1

No AndroidX Support

Describe the issue

There is currently no support for migration to AndroidX due to DateFormatUtils Libary in internals folder.

Suggestion would be to remove import android.support.annotation.NonNull; and replace with import androidx.annotation.NonNull; This will allow for future proofing with AndroidX

To Reproduce

Simply use a clean install and Refactor->Migrate to AndroidX

Expected behavior

Should migrate cleanly to AndroidX

Environment (please complete the following information):

Screenshots

Additional context

SQUARE DATA ERROR: Could not add persistent store for LOBLogEventDataStoreController due to Error Domain=NSCocoaErrorDomain Code=256 "The file “LogEvent.sqlite” couldn’t be opened

Describe the issue

NSInternalInconsistencyException SQUARE DATA ERROR: Could not add persistent store for LOBLogEventDataStoreController due to Error Domain=NSCocoaErrorDomain Code=256 "The file “LogEvent.sqlite” couldn’t be opened." UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/E4EBDB64-9D06-4339-9B49-95CE98220CEC/Library/Application Support/SquareReaderSDK/LogEvent.sqlite, NSSQLiteErrorDomain=13}. 
  Frameworks/CoreFoundation.framework/CoreFoundation ___exceptionPreprocess
  /usr/lib/libobjc.A.dylib _objc_exception_throw
  Frameworks/CoreFoundation.framework/CoreFoundation +[NSException raise:format:arguments:]
  Frameworks/Foundation.framework/Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  /usr/lib/system/libdispatch.dylib __dispatch_client_callout
  /usr/lib/system/libdispatch.dylib __dispatch_once_callout
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  Frameworks/SquareReaderSDK.framework/SquareReaderSDK SQRDCurrencyCodeGetISOCurrencyCode
  ExampleApp _mh_execute_header
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[UIApplication _runWithMainScene:transitionContext:completion:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore ___111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke
  PrivateFrameworks/UIKitCore.framework/UIKitCore +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore ___82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore ___125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke
  PrivateFrameworks/UIKitCore.framework/UIKitCore __performActionsWithDelayForTransitionContext
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[UIApplication workspace:didCreateScene:withTransitionContext:completion:]
  PrivateFrameworks/UIKitCore.framework/UIKitCore -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:]
  PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices -[FBSSceneImpl _didCreateWithTransitionContext:completion:]
  PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices ___56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2
  PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices ___40-[FBSWorkspace _performDelegateCallOut:]_block_invoke
  /usr/lib/system/libdispatch.dylib __dispatch_client_callout
  /usr/lib/system/libdispatch.dylib __dispatch_block_invoke_direct$VARIANT$mp
  PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
  PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices -[FBSSerialQueue _performNext]
  PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices -[FBSSerialQueue _performNextFromRunLoopSource]
  Frameworks/CoreFoundation.framework/CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
  Frameworks/CoreFoundation.framework/CoreFoundation ___CFRunLoopDoSource0
  Frameworks/CoreFoundation.framework/CoreFoundation ___CFRunLoopDoSources0
  Frameworks/CoreFoundation.framework/CoreFoundation ___CFRunLoopRun
  Frameworks/CoreFoundation.framework/CoreFoundation _CFRunLoopRunSpecific
  PrivateFrameworks/GraphicsServices.framework/GraphicsServices _GSEventRunModal
  PrivateFrameworks/UIKitCore.framework/UIKitCore _UIApplicationMain
  ExampleApp _mh_execute_header
  /usr/lib/system/libdyld.dylib _start

Expected behavior

No crashes

Environment (please complete the following information):

  • platform: iOS
  • OS and version: 12.4.1
  • dev environment: MacOS
  • Reader SDK version: (1.2.1) square/react-native-square-reader-sdk#98e75a0c3ca899f2f3aad7ee805597f65dec5fe5

React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 486.48 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
Yarn: 1.12.1 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5692245
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-cli: 2.0.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.