React-native-iap: [SOLVED] RNIap.getSubscriptions-Fehler: [TypeError: undefined ist kein Objekt (Auswertung von 'RNIapIos.getItems')]

Erstellt am 21. Juni 2018  ·  4Kommentare  ·  Quelle: dooboolab/react-native-iap

Version von react-native-iap

1,20

Plattformen, auf denen Sie den Fehler hatten (IOS oder Android oder beides?)

Nur unter iOS getestet

Erwartetes Verhalten

Liste der Abonnements abrufen

Tatsächliches Verhalten

RNIap.getSubscriptions-Fehler: [TypeError: undefined ist kein Objekt (Auswertung von 'RNIapIos.getItems')]

Getestete Umgebung (Emulator? Reales Gerät?)

beide

Schritte zum Reproduzieren des Verhaltens

`` ``
const itemSkus = Platform.select ({
ios: [
'com.shares.sharesapp', // Ich habe auch versucht ['BASIC', 'CLASSIC', 'MAX', 'PLUS'] ..
],
Android: [
'com.shares.sharesapp',
],
});

async componentDidMount () {
Versuchen {
warte auf RNIap.prepare ();
}}
catch (err1) {
console.log ("RNIap.prepare error:", err1);
}}
endlich {
console.log ("endlich");
Versuchen {
const products = warte auf RNIap.getSubscriptions (itemSkus);
console.log ('Abonnements', Produkte);
}}
catch (err) {
console.log ("RNIap.getSubscriptions error:", err);
}}
}}
}}
`` ``
Ich kann keine Verbindung mit dem Sandbox-Konto im Simulator herstellen
capture d ecran 2018-06-20 a 15 37 42

und in realen Geräten mit diesen Popup
photo

Hier ist die Liste der Abonnements in App Store Connect
capture d ecran 2018-06-20 a 12 42 30

Kann mir bitte jemand helfen, dies in einem guten Zustand einzurichten?

📱 iOS 🙏 help wanted

Hilfreichster Kommentar

Ich musste wie beschrieben manuell installieren ...
`` ``
Manuelle Installation
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)

`` ``

Alle 4 Kommentare

Ich habe es auch mit versucht
const purchases = await RNIap.getAvailablePurchases(); console.info('Available purchases :: ', purchases);
Ergebnis gleich:
RNIap.getSubscriptions error : [TypeError: undefined is not an object (evaluating 'RNIapIos.getAvailableItems')]

Und um ProductID als "com.shares.sharesapp.basic" in App Store Connect und zu ändern

const itemSkus = Platform.select({ ios: [ 'com.shares.sharesapp.basic' ],
Kein Erfolg mehr ...

Ich musste wie beschrieben manuell installieren ...
`` ``
Manuelle Installation
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)

`` ``

Dieses Mal, nachdem ich aufgefordert wurde, eine Verbindung herzustellen (zuerst auf Ihrem realen Gerät trennen), gab ich den Sandbox-Benutzer ein und konnte die Abonnementdetails abrufen
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); } } }
Ergebnisse :
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", }, ]

Zu Ihrer Information, RNIap.getSubscriptions (itemSkus) funktioniert auch im Simulator.

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen