Skip to main content

ionic capacitor 


Hello, I am having a peculiar issue. First of, I do configure revenue cat right of the bat with user guid as appUserId

Purchases.configure({
apiKey: revenueCatApiKey,
appUserID: userStore.tokenData.user_guid,
observerMode: false,
})

then, before even finishing the purchase I do all the sync verification stuff to make sure the user guis is being used 

 async purchasePackage() {
const success = await this.syncRevenueCatUserId()

if (!success) {
this.status = revenueCatStates.FAILURE
return
}

const response = await this.orderStore.purchaseOffering()
this.status = response.state

if (this.stateHalfSuccessful) await this.checkIfBackendSynced(response.paymentId)
},

async syncRevenueCatUserId() {
// Attach email as a subscriber attribute
if (this.user.email) {
await Purchases.setEmail({ email: this.user.email })
console.log("Email set in RevenueCat:", this.user.email) // Log email
}

const { appUserID } = await Purchases.getAppUserID()
console.log("Post-login User ID:", appUserID) // Double-check immediately

if (appUserID === this.user.guid) return true
},

 

as you can see, I do verify whether appUserID equals user.guid and ONLY in that scenario I procede … so all these checks do pass and yet, I have received 3 cases of revenue cat sending me a completely anonymous webhook with not only anonymous ID but no email what so ever… one client was kind enough to provide feedback 

 

Would you say you have a fast internet connection? - yes

In which part did you buy Premium? Right after the tutorial? Elsewhere? - only after I looked at the application 

Regarding payment, did you add a new card? Or did you just use the classic Play Store account, as always - I was choosing from cards on Play Store and after confirming in Air Bank, a message popped up saying that the card could not be added (I managed to do it the second time, but it did not pair with the application at that moment) 

 

I assume the card shuffle was the cause? but why? why does that wipe my attempts to set the ID? Or am I doing it wrong? 

 

Last but not least, in 2/3 cases I immediatelly after received a transfer event that wanted to transfer to the correct user guid and also had that email attribute … whyyyyy why can’t that just be in the initial purchase?? why a transfer event?? especially if I am logging them in straight at configure

 

Please help, I am literally in production with this error not able to fix it

another customer gave me feedback … 


My internet is fast and without any interruptions.
Yes, I bought premium right after the tutorial.
When making online payments, I always enter my card number and other details.
I don't think anything unusual happened during the payment.

 

this time they bought right after tutorial, so literally just configure happened with their user_guid … but again there was some card shuffling… seems like revenue cat drops the id when there is some card shuffle? can anybody help? it’s a very unpleasant issue to have in production.


Hi ​@nagram - I apologize, but I think it would be best to email us about this with a more detailed code sample and so we can dig into your configuration and the logs. We’ll also be able to view webhooks and transfer events to see if we can locate the issue. Thanks!


Hi ​@nagram - I apologize, but I think it would be best to email us about this with a more detailed code sample and so we can dig into your configuration and the logs. We’ll also be able to view webhooks and transfer events to see if we can locate the issue. Thanks!

Hello. Yes I can, but lets wait a bit. I did have launchMode on singleTask in my android manifest, so I think card shuffles and redirects made revenue cat wipe the login?

 

My theory is  that that’s why my checks went through, it was all good initially, then they got a redirect to confirm cards etc. and the app_user_id got replaced with anonymous … then I guess somewhere in the process revenue cat caught back on and sent me a transfer event with the correct guid … I am not sure it’s all that was to it because it did happen one more time after launchMode change. But there is always the possibility of the user not updating the app working with old version … so lets wait first, if it happens again.

 

So far I just solved it with backend work. I made an AnonymousEvent object for when I get anonymous webhook. Then I “wait” for transfer event and in transfer event handling I check whether there is some AnonymousEvent matching and then proceed with purchase handling. Not happy about it but at least people are getting Premiums on frontend.


@nagram Sounds good - please don’t hesitate to reach out if this happens again and we’ll be sure to investigate. For reference, I wanted to share our alias behavior, just so you’re aware of the different cases when identifying a user in the SDK (i.e., they go from anonymous to non-anonymous). Thanks!


@nagram Sounds good - please don’t hesitate to reach out if this happens again and we’ll be sure to investigate. For reference, I wanted to share our alias behavior, just so you’re aware of the different cases when identifying a user in the SDK (i.e., they go from anonymous to non-anonymous). Thanks!

Already did, yesterday, sent code snippet and all, it keeps happening 😞 lost more customers due to it. Obviously if you don’t get a premium trial after submitting your card and going through the payment process you tend to get mad and not trust the product…. I am going go through the link u sent but I already did many times, I just really don’t know where I went wrong.


Reply