RNIapQueue.shared as undefined in AppDelegate for promoted products in ios
See original GitHub issuePlease use Discussion board if you want get some help out of it. Please report issue if there is a bug.
Version of react-native-iap
8.0.0
Version of react-native
0.67
Platforms you faced the error (IOS or Android or both?)
ios
Expected behavior
Able to add listener for SKPaymentQueue in AppDelegate
Actual behavior
RNIapQueue module is not available if your create an AppDelegate.swift file with bridging header?
Tested environment (Emulator? Real Device?)
Steps to reproduce the behavior
- create new swift file with name AppDelegate.swift
- xcode asks to create Bridging Header file and click yes
- follow Troubleshooting instructions
import UIKit
import StoreKit
class AppDelegate: UIResponder, UIApplicationDelegate {
....
// Attach an observer to the payment queue.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
SKPaymentQueue.default().add(RNIapQueue.shared)
return true
}
// Called when the application is about to terminate.
func applicationWillTerminate(_ application: UIApplication) {
// Remove the observer.
SKPaymentQueue.default().remove(RNIapQueue.shared)
}
....
}
RNIapQueue.shared shows as undefined and build fails
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5
Top Results From Across the Web
unrecognized selector sent to instance" error since version ...
Open ios/ArticleTest5.xcworkspace in XCode; Choose ArticleTest5Clip target and click Run; Error should be thrown. Repositories: Working App Clip ...
Read more >dooboolab/react-native-iap (Raised $40.00) - Issuehunt
[iOS] getSubscriptions isn't the same on emulator and in phone ... RNIapQueue.shared as undefined in AppDelegate for promoted products in ios.
Read more >react-native-iap - bytemeta
Receipt missing data IOS. fontesrp ... RNIapQueue.shared as undefined in AppDelegate for promoted products in ios. adambeer.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After some research, I set all of my targets’
Objective-C Generated Interface Header Name
to the same & attempted to use#import <{ProductName}-Swift.h>
but the build still failed with the same error.I’m in this position currently. Following the docs here is very rough if you have an objective c
AppDelegate
& aren’t as knowledgable outside the JS context. The method names forSKPaymentQueue
are even different in objective c,default
vsdefaultQueue
&add
vsaddTransactionObserver
for examples.Tbh I don’t even know if this is how you pass arguments to method calls here, but the symbol definitely isn’t defined.