Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an error in the docs regarding setAttributes? #232

Open
nijakobius opened this issue Mar 22, 2024 · 2 comments
Open

Is there an error in the docs regarding setAttributes? #232

nijakobius opened this issue Mar 22, 2024 · 2 comments

Comments

@nijakobius
Copy link

nijakobius commented Mar 22, 2024

I recently migrated to this plugin (from cordova-plugin-purchases) and had to change my code in some places but overall everything seemed to work. Then, I just realised in the RevenuCat dashboard that setAttributes hasn't been working in weeks.

The docs say:
setAttributes(attributes: { [key: string]: string | null; }) => Promise<void>

And my code was:
Capacitor.Plugins.Purchases.setAttributes({email: '[email protected]'});

I had to change it to this to work:
Capacitor.Plugins.Purchases.setAttributes({attributes: {email: '[email protected]'}});

As comparison, the docs for logIn say:
logIn(options: { appUserID: string; }) => Promise<LogInResult>

And Capacitor.Plugins.Purchases.logIn({appUserID: 'abcdef}); works and Capacitor.Plugins.Purchases.logIn({options: {appUserID: 'abcdef}}); does not.

@rglanz-rc
Copy link

Hi,
Is Capacitor.Plugins.Purchases.setAttributes({email: '[email protected]'}}); your exact code?

That syntax is fine, and we use it in our tests. I see an extra brace here (two closing braces), so I'm wondering if that's the culprit.

Does Capacitor.Plugins.Purchases.setAttributes({email: '[email protected]'}); work for you?

@nijakobius
Copy link
Author

nijakobius commented Mar 26, 2024

Sry that was a typo in the post only. I corrected it above.

And no, Capacitor.Plugins.Purchases.setAttributes({email: '[email protected]'}); does not work unfortunately.

Are you surprised that Capacitor.Plugins.Purchases.setAttributes({attributes: {email: '[email protected]'}}); does work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants