ÿÿ ãƒ¦ãƒ¼ã‚¶ãƒ¼ãƒ‡ãƒ¼ã‚¿ã®æ›´æ–° | Capacitor SDK | Adapty ドキュメント

Capacitor SDKã§ãƒ¦ãƒ¼ã‚¶ãƒ¼å±žæ€§ã‚’設定ã™ã‚‹

メールアドレスや電話番å·ãªã©ã€ã‚¢ãƒ—リã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã«ã‚ªãƒ—ションã®å±žæ€§ã‚’設定ã§ãã¾ã™ã€‚設定ã—ãŸå±žæ€§ã¯ã€ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ã‚»ã‚°ãƒ¡ãƒ³ãƒˆä½œæˆã‚„CRMã§ã®é–²è¦§ã«æ´»ç”¨ã§ãã¾ã™ã€‚

ユーザー属性ã®è¨­å®š

ユーザー属性を設定ã™ã‚‹ã«ã¯ã€.updateProfile() メソッドを呼ã³å‡ºã—ã¾ã™ï¼š


const params = {
  email: 'email@email.com',
  phoneNumber: '+18888888888',
  firstName: 'John',
  lastName: 'Appleseed',
  gender: 'other',
  birthday: new Date().toISOString(),
};

try {
  await adapty.updateProfile(params);
  console.log('Profile updated successfully');
} catch (error) {
  console.error('Failed to update profile:', error);
}

updateProfile メソッドã§ä»¥å‰ã«è¨­å®šã—ãŸå±žæ€§ã¯ãƒªã‚»ãƒƒãƒˆã•れãªã„ã®ã§ã”注æ„ãã ã•ã„。

Adapty SDK ãŒãƒ¢ãƒã‚¤ãƒ«ã‚¢ãƒ—リã«ã©ã®ã‚ˆã†ã«çµ±åˆã•れã¦ã„ã‚‹ã‹ã€å®Ÿéš›ã®ä¾‹ã‚’見ã¦ã¿ã¾ã›ã‚“ã‹ï¼Ÿãƒšã‚¤ã‚¦ã‚©ãƒ¼ãƒ«ã®è¡¨ç¤ºã€è³¼å…¥å‡¦ç†ã€ãã®ä»–ã®åŸºæœ¬æ©Ÿèƒ½ã‚’å«ã‚€å®Œå…¨ãªã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—を実演ã—ã¦ã„るサンプルアプリをã”覧ãã ã•ã„。

使用å¯èƒ½ãªã‚­ãƒ¼ã®ä¸€è¦§

AdaptyProfileParameters ã§ä½¿ç”¨å¯èƒ½ãªã‚­ãƒ¼ã¨ãã®å€¤ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼š

キー値
email文字列
phoneNumber文字列
firstName文字列
lastName文字列
gender列挙型。使用å¯èƒ½ãªå€¤ï¼š 'female'ã€'male'ã€'other'
birthdayISOå½¢å¼ã®æ—¥ä»˜æ–‡å­—列

カスタムユーザー属性

独自ã®ã‚«ã‚¹ã‚¿ãƒ å±žæ€§ã‚’設定ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚通常ã€ã‚¢ãƒ—リã®åˆ©ç”¨çжæ³ã«é–¢é€£ã™ã‚‹ã‚‚ã®ã§ã™ã€‚ãŸã¨ãˆã°ã€ãƒ•ィットãƒã‚¹ã‚¢ãƒ—リãªã‚‰é€±ã‚ãŸã‚Šã®é‹å‹•回数ã€èªžå­¦å­¦ç¿’アプリãªã‚‰ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ç¿’熟度レベルãªã©ãŒè©²å½“ã—ã¾ã™ã€‚ã‚»ã‚°ãƒ¡ãƒ³ãƒˆã«æ´»ç”¨ã—ã¦ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã‚’絞ã£ãŸãƒšã‚¤ã‚¦ã‚©ãƒ¼ãƒ«ã‚„オファーを作æˆã—ãŸã‚Šã€åŽç›Šã«æœ€ã‚‚影響を与ãˆã‚‹ãƒ—ロダクト指標を分æžã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚


try {
  await adapty.updateProfile({
    codableCustomAttributes: {
      key_1: 'value_1',
      key_2: 2,
    },
  });
  console.log('Custom attributes updated successfully');
} catch (error) {
  console.error('Failed to update custom attributes:', error);
}

既存ã®ã‚­ãƒ¼ã‚’削除ã™ã‚‹ã«ã¯ã€å€¤ã¨ã—㦠null を渡ã—ã¾ã™ï¼š


try {
  // to remove keys, pass null as their values
  await adapty.updateProfile({
    codableCustomAttributes: {
      key_1: null,
      key_2: null,
    },
  });
  console.log('Custom attributes removed successfully');
} catch (error) {
  console.error('Failed to remove custom attributes:', error);
}

事å‰ã«è¨­å®šã•れã¦ã„るカスタム属性を確èªã—ãŸã„å ´åˆã¯ã€AdaptyProfile オブジェクト㮠customAttributes フィールドを使用ã—ã¦ãã ã•ã„。

customAttributes ã®å€¤ã¯æœ€æ–°ã§ãªã„å¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚ユーザー属性ã¯ç•°ãªã‚‹ãƒ‡ãƒã‚¤ã‚¹ã‹ã‚‰ã„ã¤ã§ã‚‚é€ä¿¡ã•れるå¯èƒ½æ€§ãŒã‚ã‚‹ãŸã‚ã€æœ€å¾Œã®åŒæœŸä»¥é™ã«ã‚µãƒ¼ãƒãƒ¼ä¸Šã®å±žæ€§ãŒå¤‰æ›´ã•れã¦ã„ã‚‹å ´åˆãŒã‚りã¾ã™ã€‚

制é™äº‹é …

  • ユーザーã‚ãŸã‚Šæœ€å¤§30個ã®ã‚«ã‚¹ã‚¿ãƒ å±žæ€§
  • キーåã¯æœ€å¤§30文字。使用ã§ãる文字ã¯è‹±æ•°å­—㨠_ã€-ã€. ã®ã„ãšã‚Œã‹
  • å€¤ã¯æ–‡å­—列ã¾ãŸã¯æµ®å‹•å°æ•°ç‚¹æ•°ã§ã€50文字以内
ÿÿÿÿ