Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

AppsFlyer - logPurchase validation in sandbox mode?
Started by borderleap Sep 19 2018 05:07 AM

11 replies to this topic
plugins appsflyer ios
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

borderleap

[GLOBAL: userInfoPane.html]
borderleap
  • Contributor

  • 383 posts
  • Corona SDK

Hi, I've been able to successfully use AppsFlyer so far in one of my games across both iOS and Android.  All seems to be working well.  It appears to be built by Corona and I have a quick question about using the logPurchase function.

 

https://marketplace.coronalabs.com/corona-plugins/appsflyer

http://docs.coronalabs.com/plugin/appsflyer/index.html

 

When I install my game via TestFlight to do a formal IAP test, and in iOS when I use the logPurchase() function (see http://docs.coronalabs.com/plugin/appsflyer/logPurchase.html), I'm getting an error code 21007.  Per this link on Apple docs, it states essentially that the validation call is pointing to production servers at Apple rather than test ones.

 
21007:  This receipt is from the test environment, but it was sent to the production environment for verification. Send it to the test environment instead.
 
In AppsFlyer docs, there is an actual "useReceiptValidationSandbox" flag that can be applied to force an IAP validation event to point towards Apple's testing servers rather than production.  On this AppsFlyer doc, here's what it shows:
 
"Important: For testing purposes, we recommend to set the useReceiptValidationSandbox flag to YES, as this redirects the requests to Apple sandbox servers."
 
AppsFlyer support said they didn't make the plugin, so they're not sure how this flag can be implemented...
 
Any ideas if this is possible?
 
Thanks,
Nate


[TOPIC: post.html]
#2

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 817 posts
  • Corona SDK

I don't believe it is available, but this should be an easy plugin to make. Not a brand new Appsflyer plugin, but one that complements the one that is already available.



[TOPIC: post.html]
#3

borderleap

[GLOBAL: userInfoPane.html]
borderleap
  • Contributor

  • 383 posts
  • Corona SDK

Thanks agramonte.  That'd be great to have a secondary plugin that could be used alongside the primary AppsFlyer plugin that would simply set useReceiptValidationSandbox to true or false.  I have not created a plugin yet... is this something that you have done before?



[TOPIC: post.html]
#4

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 817 posts
  • Corona SDK

I started it last night shouldn't be hard to do, but I would need your help to test it. I don't have a project at the moment with both a store and AppsFlyer.



[TOPIC: post.html]
#5

borderleap

[GLOBAL: userInfoPane.html]
borderleap
  • Contributor

  • 383 posts
  • Corona SDK

Oh wow thanks!  I'm available to test whenever you're ready!  Would this involve Corona Enterprise or a special setup on my end?



[TOPIC: post.html]
#6

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 817 posts
  • Corona SDK

No. I"ll publish it and then make it available as a beta. Regular corona builds. What version of Corona are you using? 



[TOPIC: post.html]
#7

borderleap

[GLOBAL: userInfoPane.html]
borderleap
  • Contributor

  • 383 posts
  • Corona SDK

Awesome.  Using the latest daily build right now... I think 3378.



[TOPIC: post.html]
#8

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 817 posts
  • Corona SDK

Ok. I submitted the plug-in. Now we just have to wait for Corona (usually a couple of days at the most) and probably a couple a version updates to fix any bugs. I implemented two methods:

 

  1. appsFlyerExtras:setUseUninstallSandbox(bool) : Sets uninstall flag on iOS.
  2. appsFlyerExtras:setUseReceiptValidationSandbox(bool): Sets receipt validation flag for iOS.



[TOPIC: post.html]
#9

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 817 posts
  • Corona SDK

The documentation is up:

https://github.com/agramonte/AppsFlyer-Extras

 

I can confirm that it works from my logs.

2018-09-20 19:27:00.207848-0400 App[733:212145] AppsFlyer SDK version 4.8.9 started build (728)

2018-09-20 19:27:00.208087-0400 App[733:212145] [DEBUG] AppsFlyer: -[AppsFlyerTracker setIsDebug:] * * * AppsFlyer is set to debug mode. This should only be used in development enviornment!!!! * * *

2018-09-20 19:27:00.271968-0400 App[733:212145] Status bar could not find cached time string image. Rendering in-process.

2018-09-20 19:27:01.287080-0400 App[733:212145] version: 4.8.9 (build 728)



2018-09-20 19:27:01.290899-0400 App[733:212145] [DEBUG] AppsFlyer: -[AppsFlyerTracker setUseReceiptValidationSandbox:] * * * AppsFlyer is set to verify in app purchases on Apple sandbox. This should only be used in development enviornment!!!! * * *

Edited by agramonte, 20 September 2018 - 05:15 PM.


[TOPIC: post.html]
#10

borderleap

[GLOBAL: userInfoPane.html]
borderleap
  • Contributor

  • 383 posts
  • Corona SDK

This is AWESOME.  Thank you so much!!  Will you be notified by Corona that it's up and live in the Marketplace?



[TOPIC: post.html]
#11

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 817 posts
  • Corona SDK

Yes. They will let me know.

 

It is live and working. I don't have any receipts but at least I know it is setting the property correctly:

 

 

Sep 22 10:26:06.481 [Device] [DEBUG] AppsFlyer: -[AppsFlyerTracker setUseReceiptValidationSandbox:] * * * AppsFlyer is set to verify in app purchases on Apple sandbox. This should only be used in development enviornment!!!! * * *

 

Please make sure to activate it first:

 

https://marketplace.coronalabs.com/corona-plugins/appsflyer-extras

 

And here are the instructions:

 

https://github.com/agramonte/AppsFlyer-Extras

 

As I side note, I was informed that a new version of AppsFlyer plugin is coming so the usefulness of this plugin might be short-lived. 


Edited by agramonte, 22 September 2018 - 06:32 AM.


[TOPIC: post.html]
#12

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 817 posts
  • Corona SDK

Ok. I tried everything and contact support the last couple of days. Unfortunately even though in the logs it says it should be pointing the sandbox the actual request is going to the live servers. thank you for helping try to test it.




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: plugins, appsflyer, ios