Question

RevenueCat Implementation with Unity

  • 21 February 2022
  • 10 replies
  • 567 views

Badge +1

So I’m getting ready to launch our company app that features a paid subscription model. The app is built in Unity and we’ve been testing the features through testflight for the last few months now. A few weeks ago I looked into the advantages of using RevenueCat to manage the subscription side of the app. Below are a few questions and issues I’m having and wondering if anyone can help me.

I’ve gone through the step-by-step guide on how to implement RevenueCat into my Unity project. At the moment I’m just trying to get the basics working. As a start all I’m looking to do is pull in the different products from our App on RevenueCat and display them on screen.

  1. I’m wondering if it’s possible to test this in the Unity Editor. Am I able to pull in the subscription products from RevenueCat when running from the unity editor? Or is it exclusive to running the built app on a phone. ( Currently when i run in the editor with the existing code i’m getting a null reference error on “_wrapper” in the purchases class whenever I try to use this object: var purchases = GetComponent<Purchases>(); , and yes the purchases listener script does have a purchases script attached and referenced.
  2. Now when building the app in xcode i’m getting an error which I wasn’t before:

Any help would be appreciated!

 

Jamie


10 replies

Userlevel 5
Badge +10

Hey @Jamie 

Currently the Unity Editor is not supported. As for your second question, you'll want to be sure you're opening the .xcworkspace file if you're using CocoaPods, and not the .xcodeproj file.

Badge +1

Hey @Jamie 

Currently the Unity Editor is not supported. As for your second question, you'll want to be sure you're opening the .xcworkspace file if you're using CocoaPods, and not the .xcodeproj file.

Hi @tina , Thanks for your help! I managed to get the build working on XCode so thank you! 
 

I did however, manage to come across an issue when running the app on iPhone. I seem to be getting a Null Reference Exception on the _wrapper object in the Purchases class. (This was something I also saw in the Unity editor but was hoping it might be an issue unique to the Unity editor) Any ideas on how to resolve?

Userlevel 5
Badge +10

Hey @Jamie 

Can you provide more details on this? For example, a stack trace, which files you’re opening, and how you’re running the app?

Badge +1

Hey @Jamie 

Can you provide more details on this? For example, a stack trace, which files you’re opening, and how you’re running the app?

Yeah of course.

 

So this is the purchases listener script I’m running. Super simple, just trying to retrieve the available packages from RevenueCat. I have a couple of debug outputs in there just to display where it bombs out.

 
The error I’m getting is from line 19, when we try to use the purchases component. That error links to a null reference on the _wrapper object here;


The error I’m getting is this:


And as you may expect based on this, this is the output I’m getting from the DebugDraw calls:


I get this error both in the Unity Editor and when running the app on iPhone through TestFlight.

 

Hope this helps clarify!

Userlevel 5
Badge +8

Hi @Jamie, I wonder if you might be running into a variant of this bug? https://github.com/RevenueCat/purchases-unity/issues/89

 

If so, the fix would be to ensure that the API Key is set up in the Editor, could you make sure that happens? 

Badge +1

Hi @Jamie, I wonder if you might be running into a variant of this bug? https://github.com/RevenueCat/purchases-unity/issues/89

 

If so, the fix would be to ensure that the API Key is set up in the Editor, could you make sure that happens? 

Hi @Andy 

Yeah I had the API key filled in beside Revenue Cat API Key Apple before, just added it to the deprecated version above but getting the same issue.


Anything stand out to you there as being off?

Userlevel 5
Badge +8

Hey @Jamie I missed your reply!!! My apologies, I’m not sure how that happened. 

Re-reading this bit: 

I get this error both in the Unity Editor and when running the app on iPhone through TestFlight.

 

In the Unity Editor, the error is expected - since there’s no “platform” in the Editor (i.e.: the Editor isn’t running on iOS or Android). 

I’m not sure why TestFlight would have the same issue. 

Are you getting the same message when running straight on device from Xcode? Could you provide the stack trace from Xcode? Maybe it can give us a clue? 

Userlevel 5
Badge +8

Nothing looks off from the screenshot you posted, though

Badge +1

Hi @Andy 

 

Apologies for the delay on getting back to this one. We put the project on the back burner for a while.

Unfortunately the issue is still present and identical when running on a device direct from Xcode. I’ll post the call stack below.

 

objc[95571]: Class ImageTools is implemented in both /System/Library/PrivateFrameworks/AXMediaUtilities.framework/AXMediaUtilities (0x1f58cd818) and /private/var/containers/Bundle/Application/0187C82A-5760-48B5-91F6-04D3C088D801/MyPersonalAssistant.app/Frameworks/UnityFramework.framework/UnityFramework (0x107d2a9b8). One of the two will be used. Which one is undefined.

2022-05-03 18:10:31.019472+0100 MyPersonalAssistant[95571:17373403] UnityIAP UnityEarlyTransactionObserver: Created

2022-05-03 18:10:31.020738+0100 MyPersonalAssistant[95571:17373403] UnityIAP UnityEarlyTransactionObserver: Registered for lifecycle events

CrashReporter: initialized

2022-05-03 18:10:31.358437+0100 MyPersonalAssistant[95571:17373403] Built from '2019.3/staging' branch, Version '2019.3.6f1 (5c3fb0a11183)', Build type 'Release', Scripting Backend 'il2cpp'

2022-05-03 18:10:31.381126+0100 MyPersonalAssistant[95571:17373403] didFinishLaunchingWithOptions: Not from notification

-> applicationDidFinishLaunching()

2022-05-03 18:10:31.906833+0100 MyPersonalAssistant[95571:17373403] UnityIAP UnityEarlyTransactionObserver: Added to the payment queue

-> applicationDidBecomeActive()

GfxDevice: creating device client; threaded=1

Initializing Metal device caps: Apple A11 GPU

Initialize engine version: 2019.3.6f1 (5c3fb0a11183)

CrashReporter: No pending report exists at /var/mobile/Containers/Data/Application/A46AECDC-6163-4B13-A429-B62CB1AD0023/Library/Caches/CrashReports/crash-pending.plcrash

2022-05-03 18:10:32.674376+0100 MyPersonalAssistant[95571:17373403] Unbalanced calls to begin/end appearance transitions for <SplashScreenController: 0x150037900>.

2022-05-03 18:10:32.675192+0100 MyPersonalAssistant[95571:17373403] Unbalanced calls to begin/end appearance transitions for <UnityDefaultViewController: 0x150037160>.

UnloadTime: 0.292958 ms

2022-05-03 18:10:34.725284+0100 MyPersonalAssistant[95571:17373403] UnityIAP: Requesting 2 products

Unloading 5 Unused Serialized files (Serialized files now loaded: 0)

2022-05-03 18:10:35.294279+0100 MyPersonalAssistant[95571:17373656] [connection] nw_socket_handle_socket_event [C1.1:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:35.294938+0100 MyPersonalAssistant[95571:17373656] [connection] nw_socket_handle_socket_event [C2.1:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:35.322921+0100 MyPersonalAssistant[95571:17373656] [connection] nw_socket_handle_socket_event [C4.1:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:35.325261+0100 MyPersonalAssistant[95571:17373403] UnityIAP: Requesting product data...

2022-05-03 18:10:36.725593+0100 MyPersonalAssistant[95571:17373648] UnityIAP: Received 2 products

2022-05-03 18:10:36.740664+0100 MyPersonalAssistant[95571:17373656] [connection] nw_socket_handle_socket_event [C1.2:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:36.777408+0100 MyPersonalAssistant[95571:17373656] [connection] nw_socket_handle_socket_event [C2.2:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:36.778079+0100 MyPersonalAssistant[95571:17373656] [connection] nw_socket_handle_socket_event [C4.2:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:36.779223+0100 MyPersonalAssistant[95571:17373652] Task <44A4466D-F048-481C-9FFE-703D4DA1B07D>.<3> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x280272b50 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <44A4466D-F048-481C-9FFE-703D4DA1B07D>.<3>, _NSURLErrorRelatedURLSessionTaskErrorKey=(

    "LocalDataTask <44A4466D-F048-481C-9FFE-703D4DA1B07D>.<3>"

), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=http://localhost/MyPersonalAssistant/GetDate.php, NSErrorFailingURLKey=http://localhost/MyPersonalAssistant/GetDate.php, _kCFStreamErrorDomainKey=4}

2022-05-03 18:10:36.785237+0100 MyPersonalAssistant[95571:17373656] Connection 1: received failure notification

2022-05-03 18:10:36.785312+0100 MyPersonalAssistant[95571:17373656] Connection 1: failed to connect 1:61, reason -1

2022-05-03 18:10:36.785345+0100 MyPersonalAssistant[95571:17373656] Connection 1: encountered error(1:61)

2022-05-03 18:10:36.786570+0100 MyPersonalAssistant[95571:17373648] UnityIAP: No App Receipt found

2022-05-03 18:10:36.787259+0100 MyPersonalAssistant[95571:17373656] Connection 2: received failure notification

2022-05-03 18:10:36.787308+0100 MyPersonalAssistant[95571:17373656] Connection 2: failed to connect 1:61, reason -1

2022-05-03 18:10:36.787338+0100 MyPersonalAssistant[95571:17373656] Connection 2: encountered error(1:61)

2022-05-03 18:10:36.788147+0100 MyPersonalAssistant[95571:17373656] Connection 4: received failure notification

2022-05-03 18:10:36.788251+0100 MyPersonalAssistant[95571:17373656] Connection 4: failed to connect 1:61, reason -1

2022-05-03 18:10:36.788289+0100 MyPersonalAssistant[95571:17373656] Connection 4: encountered error(1:61)

2022-05-03 18:10:36.789272+0100 MyPersonalAssistant[95571:17373656] Task <44A4466D-F048-481C-9FFE-703D4DA1B07D>.<3> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])

2022-05-03 18:10:36.789393+0100 MyPersonalAssistant[95571:17373656] Task <FD7368FA-C7CB-41B1-B191-FE3B4E57BBF0>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])

2022-05-03 18:10:36.789442+0100 MyPersonalAssistant[95571:17373656] Task <DABCFD8D-7668-4698-B915-8D45F1F3A2C8>.<2> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])

2022-05-03 18:10:36.789765+0100 MyPersonalAssistant[95571:17373656] Task <FD7368FA-C7CB-41B1-B191-FE3B4E57BBF0>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x280251140 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: lo0, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <FD7368FA-C7CB-41B1-B191-FE3B4E57BBF0>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(

    "LocalDataTask <FD7368FA-C7CB-41B1-B191-FE3B4E57BBF0>.<1>"

), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://localhost/MyPersonalAssistant/GetDate.php, NSErrorFailingURLKey=http://localhost/MyPersonalAssistant/GetDate.php, _kCFStreamErrorDomainKey=1}

2022-05-03 18:10:36.790080+0100 MyPersonalAssistant[95571:17373656] Task <DABCFD8D-7668-4698-B915-8D45F1F3A2C8>.<2> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x28024ca80 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: lo0, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <DABCFD8D-7668-4698-B915-8D45F1F3A2C8>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(

    "LocalDataTask <DABCFD8D-7668-4698-B915-8D45F1F3A2C8>.<2>"

), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://localhost/MyPersonalAssistant/GetUsers.php, NSErrorFailingURLKey=http://localhost/MyPersonalAssistant/GetUsers.php, _kCFStreamErrorDomainKey=1}

GetDate.php: Error: Request timeout

<CheckServerStatus>d__16:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

Server Offline

<CheckServerStatus>d__16:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

Offline Mode: True

<CheckServerStatus>d__16:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

GetDate.php: Error: Cannot connect to destination host

Web:CheckNetworkResponse(UnityWebRequest, String)

<GetDate>d__17:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

Offline Mode: True

<GetDate>d__17:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

GetUsers.php: Error: Cannot connect to destination host

Web:CheckNetworkResponse(UnityWebRequest, String)

<GetUsers>d__18:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

Offline Mode: True

<GetUsers>d__18:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

UnloadTime: 1.251417 ms

 

Unloading 13 unused Assets to reduce memory usage. Loaded Objects now: 1015.

Total: 1.405583 ms (FindLiveObjects: 0.327042 ms CreateObjectMapping: 0.022167 ms MarkObjects: 1.001292 ms  DeleteObjects: 0.054500 ms)

 

Uploading Crash Report

NullReferenceException: Object reference not set to an instance of an object.

  at Purchases.SetDebugLogsEnabled (System.Boolean logsEnabled) [0x00000] in <00000000000000000000000000000000>:0 

  at PurchasesListener.Start () [0x00000] in <00000000000000000000000000000000>:0 

 

(Filename: currently not available on il2cpp Line: -1)

 

2022-05-03 18:10:36.857867+0100 MyPersonalAssistant[95571:17373768] [connection] nw_socket_handle_socket_event [C6.1:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:36.858104+0100 MyPersonalAssistant[95571:17373768] [connection] nw_socket_handle_socket_event [C7.1:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:36.858412+0100 MyPersonalAssistant[95571:17373768] [connection] nw_socket_handle_socket_event [C8.1:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:36.862752+0100 MyPersonalAssistant[95571:17373768] [connection] nw_socket_handle_socket_event [C6.2:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:36.862918+0100 MyPersonalAssistant[95571:17373768] [connection] nw_socket_handle_socket_event [C7.2:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:36.863195+0100 MyPersonalAssistant[95571:17373768] [connection] nw_socket_handle_socket_event [C8.2:2] Socket SO_ERROR [61: Connection refused]

2022-05-03 18:10:36.865772+0100 MyPersonalAssistant[95571:17373768] Connection 6: received failure notification

2022-05-03 18:10:36.865819+0100 MyPersonalAssistant[95571:17373768] Connection 6: failed to connect 1:61, reason -1

2022-05-03 18:10:36.865841+0100 MyPersonalAssistant[95571:17373768] Connection 6: encountered error(1:61)

2022-05-03 18:10:36.867612+0100 MyPersonalAssistant[95571:17373768] Connection 7: received failure notification

2022-05-03 18:10:36.867677+0100 MyPersonalAssistant[95571:17373768] Connection 7: failed to connect 1:61, reason -1

2022-05-03 18:10:36.867701+0100 MyPersonalAssistant[95571:17373768] Connection 7: encountered error(1:61)

2022-05-03 18:10:36.868665+0100 MyPersonalAssistant[95571:17373768] Connection 8: received failure notification

2022-05-03 18:10:36.868699+0100 MyPersonalAssistant[95571:17373768] Connection 8: failed to connect 1:61, reason -1

2022-05-03 18:10:36.868831+0100 MyPersonalAssistant[95571:17373768] Connection 8: encountered error(1:61)

2022-05-03 18:10:36.869652+0100 MyPersonalAssistant[95571:17373403] json = {"purchaserInfo":{"allPurchasedProductIdentifiers":[],"firstSeen":"2022-03-01T00:21:59Z","originalAppUserId":"app8a3956ef3a","requestDateMillis":1646094119000,"allExpirationDates":{},"originalApplicationVersion":null,"managementURL":null,"nonSubscriptionTransactions":[],"latestExpirationDateMillis":null,"allExpirationDatesMillis":{},"allPurchaseDates":{},"entitlements":{"all":{},"active":{}},"requestDate":"2022-03-01T00:21:59Z","originalPurchaseDateMillis":null,"activeSubscriptions":[],"latestExpirationDate":null,"firstSeenMillis":1646094119000,"allPurchaseDatesMillis":{},"originalPurchaseDate":null}}

2022-05-03 18:10:36.869700+0100 MyPersonalAssistant[95571:17373768] Task <F462A6B1-435D-4657-B970-773ED81641EF>.<6> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])

2022-05-03 18:10:36.869879+0100 MyPersonalAssistant[95571:17373768] Task <1EA3E7D4-4717-4696-BEEA-59154695D396>.<7> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])

2022-05-03 18:10:36.869990+0100 MyPersonalAssistant[95571:17373768] Task <9CD193DD-5B9D-4EAB-9F7B-01E3CA558B45>.<5> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])

2022-05-03 18:10:36.870220+0100 MyPersonalAssistant[95571:17373654] Task <F462A6B1-435D-4657-B970-773ED81641EF>.<6> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x280249f80 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: lo0, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <F462A6B1-435D-4657-B970-773ED81641EF>.<6>, _NSURLErrorRelatedURLSessionTaskErrorKey=(

    "LocalDataTask <F462A6B1-435D-4657-B970-773ED81641EF>.<6>"

), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://localhost/MyPersonalAssistant/GetDate.php, NSErrorFailingURLKey=http://localhost/MyPersonalAssistant/GetDate.php, _kCFStreamErrorDomainKey=1}

2022-05-03 18:10:36.871737+0100 MyPersonalAssistant[95571:17373654] Task <1EA3E7D4-4717-4696-BEEA-59154695D396>.<7> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x28024ac10 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: lo0, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <1EA3E7D4-4717-4696-BEEA-59154695D396>.<7>, _NSURLErrorRelatedURLSessionTaskErrorKey=(

    "LocalDataTask <1EA3E7D4-4717-4696-BEEA-59154695D396>.<7>"

), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://localhost/MyPersonalAssistant/GetUsers.php, NSErrorFailingURLKey=http://localhost/MyPersonalAssistant/GetUsers.php, _kCFStreamErrorDomainKey=1}

2022-05-03 18:10:36.872079+0100 MyPersonalAssistant[95571:17373403] UnityIAP: No App Receipt found

2022-05-03 18:10:36.872301+0100 MyPersonalAssistant[95571:17373403] UnityIAP: Add transaction observer

2022-05-03 18:10:36.872345+0100 MyPersonalAssistant[95571:17373403] UnityIAP UnityEarlyTransactionObserver: Request to initiate queued payments

2022-05-03 18:10:36.874808+0100 MyPersonalAssistant[95571:17373654] Task <9CD193DD-5B9D-4EAB-9F7B-01E3CA558B45>.<5> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x28024a7c0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: lo0, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <9CD193DD-5B9D-4EAB-9F7B-01E3CA558B45>.<5>, _NSURLErrorRelatedURLSessionTaskErrorKey=(

    "LocalDataTask <9CD193DD-5B9D-4EAB-9F7B-01E3CA558B45>.<5>"

), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://localhost/MyPersonalAssistant/GetDate.php, NSErrorFailingURLKey=http://localhost/MyPersonalAssistant/GetDate.php, _kCFStreamErrorDomainKey=1}

_receivePurchaserInfo {"purchaserInfo":{"allPurchasedProductIdentifiers":[],"firstSeen":"2022-03-01T00:21:59Z","originalAppUserId":"app8a3956ef3a","requestDateMillis":1646094119000,"allExpirationDates":{},"originalApplicationVersion":null,"managementURL":null,"nonSubscriptionTransactions":[],"latestExpirationDateMillis":null,"allExpirationDatesMillis":{},"allPurchaseDates":{},"entitlements":{"all":{},"active":{}},"requestDate":"2022-03-01T00:21:59Z","originalPurchaseDateMillis":null,"activeSubscriptions":[],"latestExpirationDate":null,"firstSeenMillis":1646094119000,"allPurchaseDatesMillis":{},"originalPurchaseDate":null}}

Purchases:_receivePurchaserInfo(String)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

purchaser info received System.Collections.Generic.List`1[System.String]

PurchasesListener:PurchaserInfoReceived(PurchaserInfo)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

2022-05-03 18:10:36.912057+0100 MyPersonalAssistant[95571:17373403] json = {"products":[{"description":"Full Feature Access, Billed Monthly","introPrice":null,"price_string":"$4.99","intro_price_period_unit":null,"currency_code":"USD","title":"MyPA Full Access Monthly Plan","price":4.9899997711181641,"identifier":"com.mypa.mypa.monthly499","intro_price":null,"intro_price_period_number_of_units":null,"intro_price_period":null,"intro_price_string":null,"discounts":[],"intro_price_cycles":null},{"description":"","introPrice":null,"price_string":"$49.99","intro_price_period_unit":null,"currency_code":"USD","title":"","price":49.990001678466797,"identifier":"com.mypa.mypa.yearly4999","intro_price":null,"intro_price_period_number_of_units":null,"intro_price_period":null,"intro_price_string":null,"discounts":[],"intro_price_cycles":null}]}

GetUsers.php: Error: Cannot connect to destination host

Web:CheckNetworkResponse(UnityWebRequest, String)

<GetUsers>d__18:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

Offline Mode: True

<GetUsers>d__18:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

GetDate.php: Error: Cannot connect to destination host

Web:CheckNetworkResponse(UnityWebRequest, String)

<GetDate>d__17:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

Offline Mode: True

<GetDate>d__17:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

GetDate.php: Error: Cannot connect to destination host

<CheckServerStatus>d__16:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

Offline Mode: True

<CheckServerStatus>d__16:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

_receiveProducts {"products":[{"description":"Full Feature Access, Billed Monthly","introPrice":null,"price_string":"$4.99","intro_price_period_unit":null,"currency_code":"USD","title":"MyPA Full Access Monthly Plan","price":4.9899997711181641,"identifier":"com.mypa.mypa.monthly499","intro_price":null,"intro_price_period_number_of_units":null,"intro_price_period":null,"intro_price_string":null,"discounts":[],"intro_price_cycles":null},{"description":"","introPrice":null,"price_string":"$49.99","intro_price_period_unit":null,"currency_code":"USD","title":"","price":49.990001678466797,"identifier":"com.mypa.mypa.yearly4999","intro_price":null,"intro_price_period_number_of_units":null,"intro_price_period":null,"intro_price_string":null,"discounts":[],"intro_price_cycles":null}]}

Purchases:_receiveProducts(String)

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

2022-05-03 18:10:49.933035+0100 MyPersonalAssistant[95571:17373403] UnityIAP: PurchaseProduct: com.mypa.mypa.monthly499

2022-05-03 18:10:49.980457+0100 MyPersonalAssistant[95571:17373403] UnityIAP: UpdatedTransactions

-> applicationWillResignActive()

2022-05-03 18:10:54.184787+0100 MyPersonalAssistant[95571:17373653] <SKPaymentQueue: 0x280f38360>: Payment completed with error: Error Domain=ASDErrorDomain Code=907 "Unhandled exception" UserInfo={NSUnderlyingError=0x280255980 {Error Domain=AMSErrorDomain Code=100 "Authentication Failed" UserInfo={NSLocalizedFailureReason=The verify credentials call failed., NSLocalizedDescription=Authentication Failed, NSUnderlyingError=0x2802552c0 {Error Domain=AMSErrorDomain Code=6 "Authentication Failed" UserInfo={NSLocalizedFailureReason=User cancelled, NSLocalizedDescription=Authentication Failed, NSUnderlyingError=0x280255470 {Error Domain=AMSErrorDomain Code=15 "An unknown error occurred. Please try again." UserInfo=0x280dab6a0 (not displayed)}}}}}, NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception}

2022-05-03 18:10:54.186368+0100 MyPersonalAssistant[95571:17373403] UnityIAP: UpdatedTransactions

2022-05-03 18:10:54.186631+0100 MyPersonalAssistant[95571:17373403] UnityIAP: PurchaseFailed: 2

-> applicationDidBecomeActive()

onPurchaseFailedEvent(productId:com.mypa.mypa.monthly499 message:APPLE_The operation couldn’t be completed. (SKErrorDomain error 2.))

UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)

System.Action:Invoke()

UnityEngine.Purchasing.Extension.UnityUtil:Update()

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

com.mypa.mypa.monthly499 failed due to UserCancelled

SubscriptionDealer:OnPurchaseFailed(Product, PurchaseFailureReason)

UnityEngine.Events.UnityAction`2:Invoke(T0, T1)

UnityEngine.Events.UnityEvent`2:Invoke(T0, T1)

UnityEngine.Purchasing.CodelessIAPStoreListener:OnPurchaseFailed(Product, PurchaseFailureReason)

System.Action:Invoke()

UnityEngine.Purchasing.Extension.UnityUtil:Update()

 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

 

2022-05-03 18:11:07.810987+0100 MyPersonalAssistant[95571:17373653] [tcp] tcp_input [C11.1.1:3] flags=[R] seq=3037850430, ack=0, win=0 state=LAST_ACK rcv_nxt=3037850430, snd_una=1377209848

2022-05-03 18:11:07.815143+0100 MyPersonalAssistant[95571:17373653] [tcp] tcp_input [C11.1.1:3] flags=[R] seq=3037850430, ack=0, win=0 state=CLOSED rcv_nxt=3037850430, snd_una=1377209848

Userlevel 5
Badge +8

🤔

It looks like the issue is when getting the Purchases object… Which makes me think that perhaps there’s an issue in the initial setup. Maybe in the GameObject? 

 

Could you try removing the SDK, and then following the steps here again? https://docs.revenuecat.com/docs/unity#installation

 

Reply