x

Intent working when running on device but erroring when downloading from Play Store

I am working on a native Point of Sale application for Android. The application is being written using Xamarin.

Most of the functionality for the app will reside in a single web page application. The native app will mostly be a wrapper around this website.

In my Point of Sale app, when the user goes to close a ticket, I want to launch the Square POS app to handle credit card entry.

I've followed this documentation on the Square website (https://developer.squareup.com/docs/pos-api/web-technical-reference#mobile-web-on-android) which tells you how to build the Intent to launch the Square POS app.

 

When I build my native app in Debug mode and debug it, the Intent works correctly. I click a button in my app, the Intent object is built, the Square app loads, I can swipe/key in a credit card, the response calls back to my native app, everything works.

 

If I build my native app in Release mode and upload it to my physical Android device and then run the app, the Intent also works correctly. The Square app loads, I can process cards, etc.

 

If I publish my app to the Google Play store, download it onto the same Android device, and run the app, the Intent does not work. When I click the button in my app and build the Intent and run it, I get this error code from Square: "com.squareup.pos.ERROR_INVALID_REQUEST". According to Square's website, this error code means: "The information provided in this transaction request is invalid (e.g., a required field is missing or malformed)."

 

I don't understand how debugging the app on my physical Android device works correctly, building the app in Release mode and uploading it to my Android device works correctly, but when publishing the app to the app store and downloading and running it does not work correctly.

 

I've tried uninstalling the app from my device then downloading it from the Play Store, I've tried clearing the cache/data from the Play Store app, nothing seems to work.

546 Views
Message 1 of 2
Report
1 Best Answer

Best Answer

Found the issue. In the Square Developers page, you have to specify the fingerprint of the certificate used to sign your mobile app. I had done that, but in our most recent release of our native app to the Google Play store, we had turned on the "Re-sign app using Google's certificate". So the native app was getting re-signed with another certificate, which had a different fingerprint.

 

I added that fingerprint in the Square Developers dashboard and now the process is working.

View Best Answer >

533 Views
Message 2 of 2
Report
1 REPLY 1

Best Answer

Found the issue. In the Square Developers page, you have to specify the fingerprint of the certificate used to sign your mobile app. I had done that, but in our most recent release of our native app to the Google Play store, we had turned on the "Re-sign app using Google's certificate". So the native app was getting re-signed with another certificate, which had a different fingerprint.

 

I added that fingerprint in the Square Developers dashboard and now the process is working.

534 Views
Message 2 of 2
Report