<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Suluuboi</title>
    <description>The latest articles on DEV Community by Suluuboi (@suluuboi).</description>
    <link>https://dev.to/suluuboi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1429823%2F5f653b9d-8f42-4976-a47a-63502d39afde.png</url>
      <title>DEV Community: Suluuboi</title>
      <link>https://dev.to/suluuboi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/suluuboi"/>
    <language>en</language>
    <item>
      <title>React-Native Glassfy SDK error "Items you are try to purchase could not be found"</title>
      <dc:creator>Suluuboi</dc:creator>
      <pubDate>Tue, 16 Apr 2024 21:23:11 +0000</pubDate>
      <link>https://dev.to/suluuboi/react-native-glassfy-sdk-error-items-you-are-try-to-purchase-could-not-be-found-42o4</link>
      <guid>https://dev.to/suluuboi/react-native-glassfy-sdk-error-items-you-are-try-to-purchase-could-not-be-found-42o4</guid>
      <description>&lt;p&gt;Im a react-native developer using expo, I added Glassfy to my project for in app purchases I followed all the steps for the documentation, the skues for the my glassfy account are loading in my react native app. I created a purchase function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; // Load all offerings a user can purchase
  async function loadOfferings() {
    let offerings = await Glassfy.offerings();
    console.log(JSON.stringify(offerings.all, null, 2));
    setOfferings(offerings);
    setLoading(false);
  }

  // Purchase one SKU and handle a successful transaction
  async function purchase(sku: GlassfySku) {
    console.log(sku);

    try {
      const transaction = await Glassfy.purchaseSku(sku);

      if (transaction.receiptValidated) {
        console.log("successfull purchase");
      }
    } catch (error) {
      console.log(error);
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;loading offering works just fine and the offerings include sku data that is only avalible fom my google playstore which I asume means there is a connection between my glassfy and my playstore.&lt;/p&gt;

&lt;p&gt;when I run the the purchase function this is what happens on my mobile phones screen. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa29cj3ycgo74rvqkkwk6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa29cj3ycgo74rvqkkwk6.jpg" alt="Image description" width="474" height="1080"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the error code printed in the console looks like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; LOG  [Error: GlassfyError(code=StoreError, description=Store error, debug=Requested product is not available for purchase. (ITEM_UNAVAILABLE))]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the sku being supplied to the funtion is loaded from the glassfy SDK so that means it does exist. The console of the sku being fed to the purchase function looks like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; LOG  {"extravars": {}, "product": {"basePlanId": "", "currencyCode": "USD", "description": "300 livestock is at it.", "identifier": "com.suluuboi.farmtrack.large", "period": "", "price": 5, "title": "Large (com.suluuboi.farmtrack (unreviewed))"}, "productId": "com.suluuboi.farmtrack.large", "skuId": "large", "store": 2}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I really need help debugging the the error. the app I am developing is still under internal tesing in the playstore development console. Im trying to use sandbox for my testing. Im suspecting this error has something to do with the sandbox testing as my purchase window does not say anything about sandbox. Any assistance would be much appreciated.&lt;/p&gt;

</description>
      <category>reactnative</category>
    </item>
  </channel>
</rss>
