Shopify / mobile-buy-sdk-android

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using their credit card.
MIT License
212 stars 136 forks source link

Get Selling Plans access denied issue #707

Open arusyakhov opened 2 years ago

arusyakhov commented 2 years ago

We are using shopify android sdk 10.0.1 to manage our shop in android mobile app. In the shop admin panel selling plans are set, but there is an issue getting selling plans on mobile as we get Access denied error.

This is how I query products

 Storefront.QueryRootQuery query = Storefront.query(root ->
                root.products(args -> args
                        .first(limit)
                        .after(cursor)
                        .sortKey(getSortKeyForProducts(filterType))
                        .reverse(isReverseSort(filterType))
                        .query(searchKey), Query::products
                )
        );

And this is the products model

product
            .title()
            .descriptionHtml()
            .images(args -> args.first(250), imageConnection -> imageConnection
                    .edges(imageEdge -> imageEdge
                            .node(Storefront.ImageQuery::src)
                    )
            )
            .options(optionConnection -> optionConnection
                    .name()
                    .values()
                    )

            .variants(args ->  args.first(250), variantConnection -> variantConnection
                    .edges(variantEdge -> variantEdge
                            .node(variant -> variant
                                    .title()
                                    .quantityAvailable()
                                    .selectedOptions(selectedOption -> selectedOption
                                            .name()
                                            .value()
                                    )
                                    .price()
                                    .compareAtPrice()
                            )
                    )
            )
            .sellingPlanGroups(args -> args.edges(
                    planEdge -> planEdge.node(
                            node -> node.name()
                                    .options(option -> option.name().values()))))
            .onlineStoreUrl()
            .availableForSale()
            .totalInventory();

Can you advise what there is wrong, or what extra exions I need to do to solve the problem. Also is there any waty to get Selling Plans without getting products?

Thanks in advance