Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ioS] "Invalid Product ID" #256

Closed
azanli opened this issue Sep 12, 2018 · 15 comments
Closed

[ioS] "Invalid Product ID" #256

azanli opened this issue Sep 12, 2018 · 15 comments
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS

Comments

@azanli
Copy link

azanli commented Sep 12, 2018

Version of react-native-iap

2.1.0

Platforms you faced the error (IOS or Android or both?)

iOS

Expected behavior

RNIap.buyProduct('com.app.product.id') should return an object.

Actual behavior

Screen displays "Invalid Product ID" and catches error:

{ [Error: Invalid product ID.]
  line: 2060,
  column: 26,
  sourceURL: 'http://192.168.1.65:8081/index.bundle?platform=ios&dev=true&minify=false',
  framesToPop: 1,
  code: 'E_DEVELOPER_ERROR',
  userInfo: null,
  nativeStackIOS: 
   [ '0   O2Balloons                          0x006c2c8f RCTJSErrorFromCodeMessageAndNSError + 104',
     '1   O2Balloons                          0x00669129 __41-[RCTModuleMethod processMethodSignature]_block_invoke_2.218 + 184',
     '2   O2Balloons                          0x005d5caf -[RNIapIos buyProduct:resolve:reject:] + 886',
     '3   CoreFoundation                      0x1b4c8354 <redacted> + 68',
     '4   CoreFoundation                      0x1b3ec2b9 <redacted> + 300',
     '5   CoreFoundation                      0x1b3efe87 <redacted> + 48',
     '6   O2Balloons                          0x0066ab9b -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1806',
     '7   O2Balloons                          0x0070104d _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 640',
     '8   O2Balloons                          0x00700bd1 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 176',
     '9   O2Balloons                          0x00700b1d ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 16',
     '10  libdispatch.dylib                   0x022d7467 _dispatch_call_block_and_release + 10',
     '11  libdispatch.dylib                   0x022e366f _dispatch_queue_serial_drain + 988',
     '12  libdispatch.dylib                   0x022daa39 _dispatch_queue_invoke + 872',
     '13  libdispatch.dylib                   0x022e3b31 _dispatch_queue_override_invoke + 342',
     '14  libdispatch.dylib                   0x022e576b _dispatch_root_queue_drain + 666',
     '15  libdispatch.dylib                   0x022e5471 _dispatch_worker_thread3 + 112',
     '16  libsystem_pthread.dylib             0x1ad4687d _pthread_wqthread + 1040',
     '17  libsystem_pthread.dylib             0x1ad4645c start_wqthread + 8' ],
  domain: 'RCTErrorDomain' }

Tested environment (Emulator? Real Device?)

Emulator and real device.

Steps to reproduce the behavior

I followed every instruction in the documentation to the T and have scoured through pages of Google results as well as relevant resolved issues in this repo. My checklist to date:

  1. Completed an effective "Agreements, Tax, and Banking."
  2. Setup sandbox testing account in "Users and Roles."
  3. Signed into iOS device with sandbox account.
  4. Set up three In-App Purchases with the following status:
    i. Ready to Submit
    ii. Missing Metadata
    iii. Waiting for Review
  5. Enable "In-App Purchase" in Xcode "Capabilities" and in Apple Developer -> "App ID" setting.
  6. Delete app / Restart device / Quit "store" related processes in Activity Monitor / Xcode Development Provisioning Profile -> Clean -> Build
  7. Attempt RNIap.buyProduct('com.app.product.id') for each product all throwing the same error.

The only thing I haven't tried yet is fast forward time (I thought going to sleep last night might help! :) because it hasn't been a full 24 hours since I've created the sandbox account / initialized the in-app purchases / everything above basically. Please help, it seems as though many people were missing one of the steps above before it started working for them but I've tried them all and it still doesn't work. Am I missing something?

@hyochan hyochan added 🐛 bug Something isn't working 📱 iOS Related to iOS labels Sep 13, 2018
@hyochan
Copy link
Member

hyochan commented Sep 13, 2018

@friendly-robot Looks fine. Could you try 2.1.1? There was some bug in 2.1.0. Did you call getProducts before buying?

@hyochan hyochan added 🙏 help wanted Extra attention is needed and removed 🐛 bug Something isn't working labels Sep 13, 2018
@azanli
Copy link
Author

azanli commented Sep 13, 2018

@dooboolab Wow, upgrading really solved the issue. Thank you so much! I was starting to get really frustrated because everything seemed to be correct but it just wasn't working. I'm so happy now. Very awesome work on this library. And I love your name by the way! =D

@tmjordan
Copy link

Hi everyone, I have the same problem. I always get an empty array when calling getProducts
@hyochan @friendly-robot

@AriesTech
Copy link

me too

@rahulmishra1991
Copy link

same here

@hyochan
Copy link
Member

hyochan commented Oct 2, 2019

Have you all checked above steps? I'll post this below again.

  1. Complete an effective "Agreements, Tax, and Banking."
  2. Setup sandbox testing account in "Users and Roles."
  3. Signed into iOS device with sandbox account.
  4. Set up In-App Purchases with the following status:
    i. Ready to Submit
    Enable "In-App Purchase" in Xcode "Capabilities" and in Apple Developer -> "App ID" setting. Delete app / Restart device / Quit "store" related processes in Activity Monitor / Xcode Development Provisioning Profile -> Clean -> Build

@djGrill
Copy link

djGrill commented Oct 3, 2019

Xcode Development Provisioning Profile -> Clean -> Build

Please what does this step mean? is it Clean Build Folder?

@kgirma
Copy link

kgirma commented Oct 4, 2019

@djGrill open XCode > Product > Clean

@kgirma
Copy link

kgirma commented Oct 4, 2019

@djGrill To do it manually you can just go to your Project ios folder under your_app_name_here and delete build

@wootwoot1234
Copy link
Contributor

What does this mean?

and in Apple Developer -> "App ID" setting.

@ramidec
Copy link

ramidec commented May 12, 2020

And how can I do this exactly?

Quit "store" related processes in Activity Monitor / Xcode Development Provisioning Profile

@southerneer
Copy link

@wootwoot1234

and in Apple Developer -> "App ID" setting.

image

  • Scroll down and check the "In-App Purchase" capability (which is currently disabled in my case because we haven't completed the tax and banking information step)

image

@HappyCodingLover
Copy link

HappyCodingLover commented Apr 19, 2021

does this work on simulator?
cause I am getting empty array when I call getSubscriptions function.@hyochan

Signed into iOS device with sandbox account.
how to this?

@EnginYilmaz
Copy link

EnginYilmaz commented Apr 23, 2021

@HappyCodingLover are you sure you submitted your purchase items to apple https://appstoreconnect.apple.com -> In-App Purchases and submitted items to the store? Besides you should have your first binary with the in app purchase capability in the store to the being reviewed at least to make your items available to your debug or release version.

@Mihai-github
Copy link

Hi,
I have the following example and cannot make this works.... for getPorducts or getSubscriptions it return empty [] even if I checked everything that needs to be checked to enable in-app purchases.

Code example:

const testAction = useCallback(async (): Promise<void> => {
        try {
            RNIap.initConnection()
                .then(async () => {
                    RNIap.clearProductsIOS();
                    RNIap.getProducts([
                        'prod_L4Wy7ChjBu4HpD',
                        'prod_L4WwpLJdMBs4Qk',
                    ])
                        .then(resp => console.log('Products', resp))
                        .catch(error =>
                            console.log('error fetching the products', error),
                        );

                    RNIap.getSubscriptions([
                        'prod_L4Wy7ChjBu4HpD',
                        'prod_L4WwpLJdMBs4Qk',
                    ])
                        .then(resp => console.log('Subscriptions', resp))
                        .catch(error =>
                            console.log(
                                'error fetching the subscriptions',
                                error,
                            ),
                        );
                })
                .catch((error: any) =>
                    console.log('Connection Problems', error),
                );
        } catch (err) {
            console.log({xxx: err});
        }
    }, []);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS
Projects
None yet
Development

No branches or pull requests