IAP plugin “This In-App Purchase has already been bought. It will be restored for free.” issue


#43

Ah, even with non-consumable purchases? We are testing on iOS 11 as well. So there is no repro for the issue as shown in the video i sent so far on your side?

I’ve seen the thread. Thread seems to be implying its Apple side issue and we cannot do anything about it.

Here’s a thread discussing handling of the issue by various projects that coded their own IAPs https://stackoverflow.com/questions/34001868/ios-this-in-app-purchase-has-already-been-bought-pop-up


#44

yes, i tried non-consumable purchase.

and i tried consumable purchase. many times. but every time i try to repurchase, it’s a new purchase. the last purchase success, and it’s product have been consumed

how about, you test with https://github.com/sdkbox/sdkbox-sample-iap/cpp. then we are use the same app to test.


#45

this thread (https://stackoverflow.com/questions/34001868/ios-this-in-app-purchase-has-already-been-bought-pop-up). maybe you can try sdkbox::IAP::finishTransaction.


#46

do you have any other analytics SDK such as Firebase? As http://greensopinion.com/2017/03/22/This-In-App-Purchase-Has-Already-Been-Bought.html

These SDK may add its own SKPaymentTransactionObserver.

            // ORDER DEPENDENCY: before analytics
            SKPaymentQueue.default().add(createPaymentTransactionObserver())

            // ORDER DEPENDENCY: do this after store service setup!
            FIRApp.configure()

#47

Trying to build the test project to repro. I think I followed the steps, I’ve run the setup scrip and sdkbox-cocos2d-x-binary is created with the right structure. However, on trying opening and trying to build iap_cpp.xcodeproj, I get multiple errors. Attached here is screenshot:


#48

I got this error, too.
The binary lib seems not support arm64.
The workaround is to build only for arm7 and run it on arm7 devices, not arm64.
I could run it on iPhone 4s, I think iPhone 5 works, too.


#49

Thanks. this made it work, but hard for me to get repro now as I can’t build on iOS11 devices. @htlxyz is there any way to update test project so that it builds on arm64?


#50

@IvanLoo
Glad that works.

I have few questions about how you use the sdkbox:

  1. Do you call IAP::init() when appdidlaunch? Or you call it later?
  2. Do you add listener before IAP::init() or after?

I may find some clues but not really sure for now, so I would like to know your information.

Thanks,
Jo


#51

@joappdev, @IvanLoo

Hi, I upload the lib which support arm64 prebuilt/ios/libcocos2d iOS.a.zip.
You need to unzip the zip and replace it with libcocos2d iOS.a.

steps:

cd sdkbox-cocos2d-x-binary
git pull

## unzip prebuilt/ios/libcocos2d\ iOS.a.zip -d prebuilt/ios/
unzip prebuilt/ios/Archive.zip -d prebuilt/ios/

And then try it on iOS11 device again. Thanks.

P.S: Because Github is not allow file size >= 100M, so the libcocos2d iOS.a in repo only support

  • i386
  • armv7

#52

Hi Jimmy,

Thanks for uploading. I managed to get it to build and run, but the app crashed on launch on iOS11, iPhone 8.

Screenshot of crash:


#53

how about clean, and rebuild?


#55

Same problem. I’ve built on iPhone 5 simulator as well with same result.


#57

regarding your question:

we actually have to code hunt and review a little bit as our project was built over the years with various SDKs. “organic code” haha.

I’m hoping to first verify whether its an SDKBox issue before jumping into to figure out whether its one of the other SDKs or a combination of them that is the problem.


#58

fix steps:

cd sdkbox-cocos2d-x-binary
git pull
unzip prebuilt/ios/Archive.zip -d prebuilt/ios/

The reason is the libcocos2d\ iOS.a file is not match cocos2d’s headers. Our engineer did some modify for GitHub 100M file limit.

I sync up all cocos2d-x 3.8.1 lib now, sorry for above runtime error. It should launch without crash.

BTW, you need to change the sdkbox_config.json with your conf.
Thanks,


#59

Thanks, will try now.

oh hm, how do I set up the sdkbox_config.json? Sorry I actually wasn’t responsible for implementing the SDK into the product.


#60

Managed to test by replacing sdkbox_config.json and renaming app bundle Ids to our own.

No repro so far, I’m going to ask the original issue finder to repro on test project. If no repro, we’ll start looking at our code to figure out whats going on.


#61

@IvanLoo Thanks for your testing.

@kale1 @joappdev Please test this https://github.com/sdkbox/sdkbox-sample-iap repo, because IvanLoo can not reproduce this issue with it.

If you clone sdkbox-cocos2d-x-binary before, plz pull the latest code and unzip the iOS library:

cd sdkbox-cocos2d-x-binary
git pull
unzip prebuilt/ios/Archive.zip -d prebuilt/ios/

#62

Just following up real quick: Can confirm no repro with Test Project from various testers.


#63

Hi

I can reproduce in my app, but not in the sdk-sample.

possible reasons:

  1. I didn’t put IAP::init() in the appdidlaunch because I need to ask server for config json.
  2. I set listener AFTER IAP::init().
  3. I use some third party sdk for statistics, so I guess they might listen to the Payment queue also.

workaround:
set listener BEFORE IAP::init(),
put IAP::init() in the appdidlaunch,
and IAP::init(config.json) again after I got config.json.

If the case happened, I can get the onSuccess callback right after appdidlaunch, and I guess SDK box finish transaction at that time.

Hope this info helpful for other developers.

Jo