Giter Club home page Giter Club logo

mobile-buy-android-sample's Introduction

Mobile Buy SDK

Mobile Buy SDK - Sample Android App

The Mobile Buy SDK makes it easy to create custom storefronts in your mobile app, where users can buy products using Google Pay or their credit card.

The Buy SDK includes a comprehensive sample application that covers the SDK's most common use cases. It's built on best practices and our recommended ViewModel architecture. You can use it as a template, a starting point, or a place to cherrypick components as needed.

Table of contents

Setup

To run the sample application, you can import this repository in Android Studio and run the project on a virtual device that you've created in the AVD manager.

Provide your own credentials

You may choose to provide credentials to the shop that the app will point to:

  1. Create a private app with a Storefront API access token to access the storefront data. The storefront access token acts as the API key.
  2. Modify the file sample/shop.properties with your credentials.
SHOP_DOMAIN=<your-shop-here>.myshopify.com
API_KEY=<your-api-key>

Contributions

We welcome contributions. Please follow the steps in our contributing guidelines.

Help

For help, see the Android Buy SDK documentation or post questions on our forum, in Shopify APIs & SDKs section.

License

The Mobile Buy SDK is provided under an MIT License.

mobile-buy-android-sample's People

Contributors

alejandrohcruz avatar cocoahero avatar madmath avatar

Stargazers

 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  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

mobile-buy-android-sample's Issues

shopify sdk custom android app

This source code not support custom app store api it will support only private app .

please any one have custom app support shopify support api app have pls send me source code location

Sample app is not working

Hi Team,

I just imported the project into my Android Studio and build successfully. I have edited API Key, Domain in shop.properties file. But when I open the app, it says:
"oops something went wrong. please try again". Please let me know how to resolve it?

Also, we see the version of Mobile Buy SDK using by sample is "5.0.0". So, we can get sample on latest SDK version, i.e. 16.2.0.

App Not Working

After launching the app in AVD the app shows "Oops, something went wrong please try again".

In Android Studio the following error message is displayed at the bottom the logs window:

E/BaseApplication: Failed to fetch shop settings
com.shopify.buy3.GraphError$HttpError: HTTP(403)
at com.shopify.buy3.internal.HttpResponseParser.successResponse(HttpResponseParser.kt:55)
at com.shopify.buy3.internal.HttpResponseParser.parse(HttpResponseParser.kt:42)
at com.shopify.buy3.internal.GraphHttpResultCallback.parse(RealGraphCall.kt:332)
at com.shopify.buy3.internal.GraphHttpResultCallback.onResponse(RealGraphCall.kt:311)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:141)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)

Connecting to older API

Using 201-07 API . Changed shop.properties with domain, storefront key . But sample app is connecting older API always . Tried removing cache , rebuilt the app and also tried Network_ONLY cache mode . But still can not connect to Rebuild app . Error is

D/OkHttp: <-- 403 https://mydom.myshopify.com/api/2020-04/graphql

Can someone suggest me a fix .

When I open the app, it crashes and displays this error.

java.lang.NullPointerException: Attempt to invoke virtual method 'com.shopify.buy3.Storefront$Shop com.shopify.buy3.Storefront$QueryRoot.getShop()' on a null object reference
at com.shopify.sample.domain.usecases.FetchCollectionsUseCaseImpl.lambda$execute$7(FetchCollectionsUseCaseImpl.java:52)
at com.shopify.sample.domain.usecases.-$$Lambda$FetchCollectionsUseCaseImpl$i44dMPEfUSM1FloXC8d1zqj8mcQ.invoke(Unknown Source:4)
at com.shopify.buy3.internal.RetryableGraphHttpCall$dispatch$$inlined$also$lambda$1.run(RealGraphCall.kt:283)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7884)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

products didn't appear

hey, I'm new in Shopify development, I followed all steps but when I launch the app, it doesn't show the products existing in the Shopify store. Someone have any idea about that ?
Thanks in advance.

Crashed on startup

Crash happened after provide my own credentials

java.lang.NullPointerException: Attempt to invoke virtual method 'com.shopify.buy3.Storefront$Shop com.shopify.buy3.Storefront$QueryRoot.getShop()' on a null object reference
                 	at com.shopify.sample.domain.usecases.FetchCollectionsUseCaseImpl.lambda$execute$7(FetchCollectionsUseCaseImpl.java:52)
                 	at com.shopify.sample.domain.usecases.-$$Lambda$FetchCollectionsUseCaseImpl$i44dMPEfUSM1FloXC8d1zqj8mcQ.invoke(Unknown Source:4)
                 	at com.shopify.buy3.internal.RetryableGraphHttpCall$dispatch$$inlined$also$lambda$1.run(RealGraphCall.kt:283)
                 	at android.os.Handler.handleCallback(Handler.java:942)
                 	at android.os.Handler.dispatchMessage(Handler.java:99)
                 	at android.os.Looper.loopOnce(Looper.java:201)
                 	at android.os.Looper.loop(Looper.java:288)
                 	at android.app.ActivityThread.main(ActivityThread.java:7884)
                 	at java.lang.reflect.Method.invoke(Native Method)
                 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

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.