React-native-iap: [تم الحل] خطأ RNIap.getSubscriptions: [TypeError: undefined ليس كائنًا (تقييم 'RNIapIos.getItems')]

تم إنشاؤها على ٢١ يونيو ٢٠١٨  ·  4تعليقات  ·  مصدر: dooboolab/react-native-iap

نسخة من رد فعل - أصلية - IAP

1.20

المنصات التي واجهت الخطأ فيها (IOS أو Android أو كليهما؟)

تم اختباره على نظام iOS فقط

سلوك متوقع

احصل على قائمة الاشتراكات

السلوك الفعلي

خطأ RNIap.getSubscriptions: [TypeError: undefined ليس كائنًا (تقييم 'RNIapIos.getItems')]

بيئة اختبار (محاكي؟ جهاز حقيقي؟)

على حد سواء

خطوات إعادة إنتاج السلوك

""
const itemSkus = Platform.select ({
iOS: [
'com.shares.sharesapp'، // حاولت أيضًا ['BASIC'، 'CLASSIC'، 'MAX'، 'PLUS'] ..
] ،
ذكري المظهر: [
"com.shares.sharesapp"،
] ،
}) ؛

componentDidMount () {غير متزامن
محاولة {
انتظار RNIap.prepare () ؛
}
قبض (خطأ 1) {
console.log ("RNIap.prepare error:"، err1)؛
}
أخيرا {
console.log ("أخيرًا") ؛
محاولة {
منتجات const = انتظار RNIap.getSubscriptions (itemSkus) ؛
console.log ("الاشتراكات" ، المنتجات) ؛
}
قبض (يخطئ) {
console.log ("خطأ RNIap.getSubscriptions:"، err)؛
}
}
}
""
لا يمكنني الاتصال بحساب sandbox في المحاكاة
capture d ecran 2018-06-20 a 15 37 42

وفي جهاز حقيقي ، وجود هذه النوافذ المنبثقة
photo

فيما يلي قائمة الاشتراكات في App Store Connect
capture d ecran 2018-06-20 a 12 42 30

هل يمكن لأي شخص مساعدتي في إعداد هذا في حالة جيدة؟

📱 iOS 🙏 help wanted

التعليق الأكثر فائدة

اضطررت إلى التثبيت يدويًا كما هو موضح ...
""
التثبيت اليدوي
iOS

In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
Go to node_modules ➜ react-native-iap and add RNIap.xcodeproj
In XCode, in the project navigator, select your project. Add libRNIap.a to your project's Build Phases ➜ Link Binary With Libraries
Run your project (Cmd+R)

""

ال 4 كومينتر

أنا أيضا حاولت مع
const purchases = await RNIap.getAvailablePurchases(); console.info('Available purchases :: ', purchases);
النتيجة نفسها:
RNIap.getSubscriptions error : [TypeError: undefined is not an object (evaluating 'RNIapIos.getAvailableItems')]

ولتغيير ProductID إلى "com.shares.sharesapp.basic" في App Store Connect و

const itemSkus = Platform.select({ ios: [ 'com.shares.sharesapp.basic' ],
لا مزيد من النجاح ...

اضطررت إلى التثبيت يدويًا كما هو موضح ...
""
التثبيت اليدوي
iOS

In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
Go to node_modules ➜ react-native-iap and add RNIap.xcodeproj
In XCode, in the project navigator, select your project. Add libRNIap.a to your project's Build Phases ➜ Link Binary With Libraries
Run your project (Cmd+R)

""

هذه المرة بعد أن طلبت مني الاتصال (قطع الاتصال بجهازك الحقيقي أولاً) ، دخلت إلى مستخدم Sandbox ، وتمكنت من الحصول على تفاصيل الاشتراك 👍
async componentDidMount() { try { await RNIap.prepare(); } catch (err1) { console.log("RNIap.prepare error : ", err1); } finally { console.log("finally"); try { console.log("itemSkus : ", itemSkus); const products = await RNIap.getSubscriptions(itemSkus); console.log('Subscriptions', products); } catch (err) { console.log("RNIap.getSubscriptions error : ", err); } } }
النتائج :
itemSkus : Array [ "com.shares.sharesapp.basic", ] Subscriptions Array [ Object { "currency": "EUR", "description": "***", "localizedPrice": "3,99 €", "price": "3.99", "productId": "com.shares.sharesapp.basic", "title": "Abonnement BASIQUE", "type": "Do not use this. It returned sub only before", }, ]

FYI، RNIap.getSubscriptions (itemSkus) يعمل أيضًا في المحاكاة.

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات