Ionic User Information

Use AwesomeCordovaPluginReteno service methods.

Set User Attributes (identified user)

await this.reteno.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'],
  },
});
šŸ“˜

Note

When a user logs in to the app under a different External User Id, the device and its push token are re-linked to the contact with that identifier, and the previous contact loses this device and token. One contact can have multiple devices and receives push notifications on all of them.

Set Anonymous User Attributes

await this.reteno.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' }],
});

Anonymous attributes cannot include phone or email.

Multi-account Mode

await this.reteno.setMultiAccountUserAttributes({
  externalUserId: 'user-123',
  user: {
    userAttributes: {
      email: '[email protected]',
      firstName: 'John',
      lastName: 'Doe',
      marketId: 'market_1',
    },
  },
});

Market ID

marketId requires [email protected]. The
[email protected] wrapper includes its TypeScript declaration. It is
supported by setUserAttributes, setAnonymousUserAttributes, and
setMultiAccountUserAttributes.

  • The value can contain up to 64 Latin letters, digits, hyphens (-), and underscores (_).
  • Pass an empty string to clear the existing value:
await this.reteno.setUserAttributes({
  externalUserId: 'USER_ID',
  user: {
    userAttributes: {
      marketId: '',
    },
  },
});
  • Omit marketId to 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

  • languageCode: RFC 5646 (example: de-AT)
  • timeZone: TZ database value (example: Europe/Kyiv)