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

STOREKIT2_MODE getSubscriptions Error #2607

Closed
isnolan opened this issue Nov 12, 2023 · 1 comment
Closed

STOREKIT2_MODE getSubscriptions Error #2607

isnolan opened this issue Nov 12, 2023 · 1 comment

Comments

@isnolan
Copy link
Contributor

isnolan commented Nov 12, 2023

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description
When use STOREKIT2_MODE getSubscriptions, catch an error for :

Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'ios' of undefined
TypeError: Cannot read property 'ios' of undefined
    at subscriptionSk2Map (http://192.168.2.8:8081/node_modules/react-native-iap/src/types/appleSk2.bundle//&platform=ios&hot=false&lazy=true&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true:35:39)
    at map (native)
    at ?anon_0_ (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:275666:59)
    at next (native)
    at asyncGeneratorStep (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:6072:26)
    at _next (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:6091:29)
    at tryCallOne (/Users/distiller/react-native/packages/react-native/sdks/hermes/build_iphoneos/lib/InternalBytecode/InternalBytecode.js:53:16)
    at anonymous (/Users/distiller/react-native/packages/react-native/sdks/hermes/build_iphoneos/lib/InternalBytecode/InternalBytecode.js:139:27)
    at apply (native)
    at anonymous (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:39695:26)
    at _callTimer (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:39574:17)
    at _callReactNativeMicrotasksPass (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:39619:17)
    at callReactNativeMicrotasks (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:39825:44)
    at __callReactNativeMicrotasks (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:3677:46)
    at anonymous (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:3451:45)
    at __guard (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:3650:15)
    at flushedQueue (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:3450:21)
    at invokeCallbackAndReturnFlushedQueue (http://192.168.2.8:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:3444:33)

Expected Behavior
Got subscriptions successful

Screenshots

Environment:

  • react-native-iap: 12.10.8
  • react-native: 0.72.5
  • Platforms (iOS, Android, emulator, simulator, device): iOS, simulator, iPad, iPhone
@isnolan
Copy link
Contributor Author

isnolan commented Nov 12, 2023

Trace the code to find the cause of the problem:

1、The problem occurs in subscriptionSk2Map funcition , appleSk2.ts, SubscriptionPlatform is undefined.
2、The reason is that there is a problem with the way the SubscriptionPlatform object is referenced.

import {SubscriptionPlatform} from '.';

3、we are change it , will be ok.

import {SubscriptionPlatform} from './';

hyochan pushed a commit that referenced this issue Dec 8, 2023
@isnolan isnolan closed this as completed Dec 11, 2023
arthurgeron pushed a commit to arthurgeron/react-native-iap that referenced this issue Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant