undefined is not an object (evaluating 'RNIapIos.canMakePayments') && [Unhandled promise rejection: ReferenceError: Can't find variable: products] #364
Labels
🙏 help wanted
Extra attention is needed
Version of react-native-iap
latest 2.4.0-beta6
Version of react-native
16.3.1
Platforms you faced the error (IOS or Android or both?)
IOS
Expected behavior
Get items details or something else
Actual behavior
[19:38:36] itemSkus : Array [
[19:38:36] "Get_SlickFit_Workout_Plans_Great",
[19:38:36] ]
[19:38:41] >>>>>>>>>>>>>>>>>>>>> undefined is not an object (evaluating 'RNIapIos.canMakePayments')
[19:38:45] [Unhandled promise rejection: ReferenceError: Can't find variable: products]
Tested environment (Emulator? Real Device?)
Real device with Expo app installed and testing on localhost.
Steps to reproduce the behavior
Code below:
import React, { Component } from 'react';
var styles = require('../../assets/files/Styles');
import { Alert, Dimensions, Image, TouchableOpacity, ScrollView, Linking, Platform } from 'react-native';
import { Container, Body, Header, Input, Item, Left, Text, Title, Right, View, Button, Toast, Thumbnail, Grid, Row } from 'native-base';
import Strings from '../utils/Strings';
import { Constants, Location, Permissions, ImagePicker } from 'expo';
import * as RNIap from 'react-native-iap';
const itemSkus = Platform.select({
ios: [
'Get_SlickFit_Workout_Plans_Great'
],
android: [
'Get_SlickFit_Workout_Plans_Great'
]
});
var { width, height } = Dimensions.get('window');
export default class Register extends Component {
static navigationOptions = {
title:
${Strings.ST125}
,};
constructor() {
super();
async componentDidMount() {
try {
await RNIap.initConnection();
const products = await RNIap.getProducts(itemSkus);
// this.setState({ items });
Alert.alert("Successfull")
} catch(err) {
console.warn(">>>>>>>>>>>>>>>>>>>>> "+err.message);
Alert.alert(err.message);
}
The text was updated successfully, but these errors were encountered: