Set User Attributes (identified user)
Use setUserAttributes with required externalUserId:
RetenoPlugin.setUserAttributes({
externalUserId: 'USER_ID',
user: {
userAttributes: {
email: '[email protected]',
phone: '+1234567890',
firstName: 'John',
lastName: 'Doe',
languageCode: 'en',
timeZone: 'Europe/Kyiv',
marketId: 'market_1',
address: {
region: 'Kyivska',
town: 'Kyiv',
address: 'Khreshchatyk St, 1',
postcode: '01001',
},
fields: [{ key: 'plan', value: 'premium' }],
},
subscriptionKeys: ['news', 'promotions'],
groupNamesInclude: ['beta-testers'],
groupNamesExclude: ['unsubscribed'],
},
})
.then(() => console.log('setUserAttributes: OK'))
.catch((err) => console.error('setUserAttributes: ERROR', err));Set Anonymous User Attributes
Use setAnonymousUserAttributes before user identification:
RetenoPlugin.setAnonymousUserAttributes({
firstName: 'John',
lastName: 'Doe',
languageCode: 'en',
timeZone: 'Europe/Kyiv',
marketId: 'market_1',
address: {
region: 'Kyivska',
town: 'Kyiv',
address: 'Khreshchatyk St, 1',
postcode: '01001',
},
fields: [{ key: 'utm_source', value: 'google' }],
})
.then(() => console.log('setAnonymousUserAttributes: OK'))
.catch((err) => console.error('setAnonymousUserAttributes: ERROR', err));Note: anonymous attributes cannot include phone or email.
Multi-account Mode
Use setMultiAccountUserAttributes when one device should receive push for multiple accounts:
RetenoPlugin.setMultiAccountUserAttributes({
externalUserId: 'user-123',
user: {
userAttributes: {
email: '[email protected]',
phone: '+1234567890',
firstName: 'John',
lastName: 'Doe',
languageCode: 'en',
timeZone: 'Europe/Kyiv',
marketId: 'market_1',
},
},
})
.then(() => console.log('setMultiAccountUserAttributes: OK'))
.catch((err) => console.error('setMultiAccountUserAttributes: ERROR', err));If you want default one-token-per-device behavior, switch back to setUserAttributes.
Market ID
marketId is supported by setUserAttributes, setAnonymousUserAttributes, and setMultiAccountUserAttributes starting with [email protected].
- The value can contain up to 64 Latin letters, digits, hyphens (
-), and underscores (_). - Pass an empty string to clear the existing value:
RetenoPlugin.setUserAttributes({
externalUserId: 'USER_ID',
user: {
userAttributes: {
marketId: '',
},
},
});- Omit
marketIdto keep the existing value unchanged. - The feature requires Reteno Android SDK 2.9.5+ or Reteno iOS SDK 2.7.1+. These versions are included in
[email protected].
Notes
languageCodeshould follow RFC 5646 (de-AT,en, etc).timeZoneshould be from TZ database (Europe/Kyiv, etc).- API payload types are available in plugin types.