Getting error after login to apple for in app purchase payment
Err. message - An unknown or unexpected error has occured. Please try again later.
Err.Code - E_UNKNOWN
First I am loading product via product id then calling for payment
async buyplan() {
try {
await RNIap.prepare();
const products = await RNIap.getProducts([${this.state.productid}]);
await RNIap.buyProduct(this.state.productid).then(purchase => {
Toast.show("Payment Successfully Completed");
}).catch(err => {
// Toast.show("Payment Transaction Failed");
console.warn(err);
alert(err.message);
})
} catch (err) {
console.warn(err);
}
}

Please help me out from this.
Thanks in advance.
@immohdali Could you please fill up issue again based on below format so we can help?
Also where exactly is warning occuring? Which line?
In your source code.
const products = await RNIap.getProducts([${this.state.productid}]);
Why did you enclose the productid with ${} ? How about to try this ?
const products = await RNIap.getProducts([ this.state.productid ]);
Of course, the productid should be string.
Version of react-native-iap
"react-native-iap": "^1.1.6"
Platforms you faced the error (IOS or Android or both?)
Only IOS
Tested environment (Emulator? Real Device?)
Real Device + Simular
Steps to reproduce the behavior
No idea
What is a meaning of E_UNKNOWN error..?
please help me it very urgent.
@immohdali Would you read my answer above ?
@immohdali You are wrapping the two possible err handling at once so it would be better to seperate them and see which line it exactly is occuring.
const products = await RNIap.getProducts([${this.state.productid}]);
await RNIap.buyProduct(this.state.productid).then(purchase => {
md5-8b7a4dc2770a705762118f42107fa22b
try {
const products = await RNIap.getProducts([${this.state.productid}]);
} catch (err) {
console.warn(`getProducts: ${err}`);
}
try {
await RNIap.buyProduct(this.state.productid).then(purchase => {
console.log('done')
}).catch(err => {
console.warn(`buyProduct: ${err}`);
})
}
We need to understand the problem to help you out.
@JJMoon Yes...
@dooboolab ... I implement your code but still i am getting E_UNKNOWN error after login for payment
try {
//await RNIap.prepare();
const products = await RNIap.getProducts([`${this.state.productid}`]);
} catch (err) {
console.warn(`getProducts: ${err}`);
}
try {
await RNIap.buyProduct(this.state.productid).then(purchase => {
console.warn('done')
}).catch(err => {
console.warn(`buyProduct: ${err}`);
})
}catch (err) {
console.warn(`try error: ${err}`);
}

@immohdali Alright, you are having problem from getting product which means your app is having problem fetching in-app items. Have you followed blog? Have you checked your product id?
No.. products are fetching properly. it will be helpful if u help me via teamviewer
Its very urgent for me
@immohdali Alright. Today, I am out of time. I'll comeback 18 hours later from now. Is it fine?
Its only 2 min work for you...actually from tomorrow 2 days holidays. I hope you understand
if you want i will share you files you can update and send me again
@immohdali I am working on phone right now and will not stay with my pc for today.. Yeah it will be better if you can share the repo instead files. Also you should share itunnesconnect account too so I can access your in app items. My email address is [email protected]
Repo link - https://github.com/immohdali/janmo.git
I added my src folder where all components
Its a matrimonial site below i shared you login access when u will click on profile chat icon it will redirect you to membership screen.
Login Details :
Email : [email protected]
Password : 123456
@immohdali Hey, I've just looked your repo and I can't help you with this. You gotta give me your complete building environment to just start the project. Also you've not given me your itunesconnect which I can't help either. You should think yourself how to help somebody like you. You are wasting my time~
@dooboolab after 2 hours i will be at mac. if possible i will share you my mac control via TeamViewer. i hope you will be free
skype id - immohdali
@immohdali I have to go out exactly after 90 minutes from now.. I'll be back at night which is 8hours from now.
no problem. i will be there after 8 hours from now
On Sat, 16 Jun 2018, 8:49 am Hyo Chan Jang, notifications@github.com
wrote:
@immohdali https://github.com/immohdali I have to go out exactly after
90 minutes from now.. I'll be back at night which is 8hours from now.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dooboolab/react-native-iap/issues/191#issuecomment-397782715,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFONdOEZBik3CQ3IlAIqpkxnvasfajb1ks5t9HlBgaJpZM4UkFpf
.
no problem i will be there after 8 hours from now
@immohdali Sorry, I think I'll take two more hours to be back home.
no problem. i am waiting
Add me at skype - immohdali
On Sat, 16 Jun 2018, 3:16 pm Hyo Chan Jang, notifications@github.com
wrote:
@immohdali https://github.com/immohdali Sorry, I think I'll take two
more hours to be back home.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dooboolab/react-native-iap/issues/191#issuecomment-397801206,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFONdFolE9-7BtlDnYaqxYbvPoewmueoks5t9NPugaJpZM4UkFpf
.
I am not using skype. What about slack? Here is invitation link for ReactNativeSeoul.
I added myself at ReactNativeSeoul.slack.com. you are online now..?
On Sat, Jun 16, 2018 at 3:38 PM, Hyo Chan Jang notifications@github.com
wrote:
[image: Boxbe] https://www.boxbe.com/overview This message is eligible
for Automatic Cleanup! ([email protected]) Add cleanup rule
https://www.boxbe.com/popup?url=https%3A%2F%2Fwww.boxbe.com%2Fcleanup%3Fkey%3DgbvMe53H6sOJz67WjoWidgwIEKBRSthbPDX8JWzhBRo%253D%26token%3DOXC8osTfJTxRs3f%252BnwF%252B6bg1WJxcG1VlfAnM6%252BQ7qUDE1pfpVQ44HIJSMJHQOkLIOrtwGTEvMUY%252FcvFdTIH%252FJztlEPwMcgIVK98GzrNnmoQI3rl87LcJLEn5EhN7L2R1mCC5tZ78UhcSHQMvS%252BiVug%253D%253D&tc_serial=40258572687&tc_rand=57944719&utm_source=stf&utm_medium=email&utm_campaign=ANNO_CLEANUP_ADD&utm_content=001
| More info
http://blog.boxbe.com/general/boxbe-automatic-cleanup?tc_serial=40258572687&tc_rand=57944719&utm_source=stf&utm_medium=email&utm_campaign=ANNO_CLEANUP_ADD&utm_content=001I am not using skype. What about slack? Here is invitation link
https://join.slack.com/t/reactnativeseoul/shared_invite/enQtMzgyNjkyMDYzNDkxLTg1Y2RjNGI1NmE3YTY2NDBmMThmZTU1YTRmN2Q3YjA3MTZiMTQ3MjQ4ZGEzMzJiMDZmZmM0ZTAxODAxMTgwYWQ
for ReactNativeSeoul.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dooboolab/react-native-iap/issues/191#issuecomment-397802485,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFONdMT1jiOQnqVABR5Rldb4UigVLSGNks5t9NkAgaJpZM4UkFpf
.
@immohdali I am on now. Write me something on slack. I'll close this for now. Please add new issue when someone experience same issue.
Sorry... there was internet issue... please tell me when u will be
available..?
On Sat, Jun 16, 2018 at 6:00 PM, Hyo Chan Jang notifications@github.com
wrote:
Closed #191 https://github.com/dooboolab/react-native-iap/issues/191.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dooboolab/react-native-iap/issues/191#event-1684638022,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFONdIOJjzjG40GN6VuRGjc9MOI1SQOrks5t9PpdgaJpZM4UkFpf
.
@immohdali Can't help you more than that. I've look into your code remotely more than an hour yesterday and told you how to improve your code in slack. It was not a bug or anything but just your immature coding skill. You need to solve your problem yourself. I can answer to your question and guide your coding like I've done yesterday but I won't edit your code anymore. I've done this kind of thing lots of time and I know that it isn't healthy. Won't comeback to this issue either. Also, please see the example project and compare with yours too.
@hyochan @JJMoon
I am facing the same issue on ios, the situation is once I successfully purchased 12 months recurring subscription. Then on sandbox environment on the device when I try to purchase 3 months or any other subscription less than 12 months I asked for sandbox user creds It shows purchase is a success then suddenly getting pop up which says An unknown or unexpected error has occurred." getting this error :
{ [Error: An unknown or unexpected error has occurred. Please try again later.]
framesToPop: 1,
code: 'E_UNKNOWN',
nativeStackIOS:
[ '0 RadioSpirit 0x0000000102bfd3e8 RCTJSErrorFromCodeMessageAndNSError + 152',
'1 RadioSpirit 0x0000000102b96b24 __41-[RCTModuleMethod processMethodSignature]_block_invoke_2.218 + 176',
'2 RadioSpirit 0x0000000102aeeb64 -[RNIapIos rejectPromisesForKey:code:message:error:] + 512',
'3 RadioSpirit 0x0000000102af10ec __45-[RNIapIos paymentQueue:updatedTransactions:]_block_invoke + 348',
'4 libdispatch.dylib 0x0000000104534dc8 _dispatch_client_callout + 16',
'5 libdispatch.dylib 0x000000010454382c _dispatch_lane_barrier_sync_invoke_and_complete + 124',
'6 RadioSpirit 0x0000000102af0e74 -[RNIapIos paymentQueue:updatedTransactions:] + 908',
'7 libdispatch.dylib 0x0000000104533824 _dispatch_call_block_and_release + 24',
'8 libdispatch.dylib 0x0000000104534dc8 _dispatch_client_callout + 16',
'9 libdispatch.dylib 0x0000000104542a78 _dispatch_main_queue_callback_4CF + 1360',
'10 CoreFoundation 0x0000000220894df4
'11 CoreFoundation 0x000000022088fcbc
'12 CoreFoundation 0x000000022088f1f0 CFRunLoopRunSpecific + 436',
'13 GraphicsServices 0x0000000222b08584 GSEventRunModal + 100',
'14 UIKitCore 0x000000024dbe6d40 UIApplicationMain + 212',
'15 RadioSpirit 0x0000000102996d70 main + 124',
'16 libdyld.dylib 0x000000022034ebb4
userInfo: { NSLocalizedDescription: 'Cannot connect to iTunes Store' },
domain: 'SKErrorDomain',
line: 2268,
column: 26,
sourceURL: 'http://192.168.1.107:8081/index.bundle?platform=ios&dev=true&minify=false' }
Please help me understand and resolve this situation.
Most helpful comment
@immohdali Can't help you more than that. I've look into your code remotely more than an hour yesterday and told you how to improve your code in slack. It was not a bug or anything but just your immature coding skill. You need to solve your problem yourself. I can answer to your question and guide your coding like I've done yesterday but I won't edit your code anymore. I've done this kind of thing lots of time and I know that it isn't healthy. Won't comeback to this issue either. Also, please see the example project and compare with yours too.