NativebrikUser
定義
public class NativebrikUser {
public var id: String { get }
public var retention: Int { get }
public func setProperties(_ properties: [String: String])
public func comeBack()
public func debugPrint()
}
.id
この値は、エクスペリメントのデータを収集するためにNativebrikサーバーに送信されます。そのため、ユーザーIDとしてプライバシーに関わるデータを設定することは推奨されません。
NativebrikUser にはデフォルトでUUID形式のユーザーIDがプロパティとして設定されています。ユーザーIDは以下のように取得できます:
let userId: String = nativebrik.user.id
オプションで、カスタムユーザーIDを設定することも可能です:
nativebrik.user.setProperties(["userId": "<CUSTOM_USER_ID>"])
.retention
let retention: Int = nativebrik.user.retention
.setProperties
ユーザーのプロパティを設定することができます:
nativebrik.user.setProperties(["<KEY>": "<VALUE>"])
.debugPrint
デバッグ用にユーザーのプロパティを出力できます:
nativebrik.user.debugPrint()
.comeBack
.comeBack
は、ユーザーのリテンション期間を計算します:
nativebrik.user.comeBack()
ビルトインのユーザープロパティ
デフォルトで、以下のビルトインプロパティが設定されています:
Key
Description
userId
User id (uuid by default)
languageCode
language code (e.g. en for English, fr for French) ISO 639-1
regionCode
region code (e.g. US for United States, GB for United Kingdom) ISO 3166-1
sdkVersion
nativebrik sdk version
osName
os name (e.g. iOS, iPadOS)
osVersion
os version (e.g. 15.3.2)
appVersion
your app version (e.g. CFBundleShortVersionString
for Apple platforms)
cfBundleVersion
your apple app CFBundleVersion
Last updated