Player

Struct Player 

Source
pub struct Player {
Show 27 fields pub id: Option<String>, pub invalid_identifier: Option<bool>, pub app_id: Option<String>, pub device_type: i32, pub external_user_id: Option<String>, pub external_user_id_auth_hash: Option<String>, pub email_auth_hash: Option<String>, pub identifier: Option<String>, pub language: Option<String>, pub timezone: Option<i32>, pub game_version: Option<String>, pub device_model: Option<String>, pub device_os: Option<String>, pub ad_id: Option<String>, pub sdk: Option<String>, pub session_count: Option<i32>, pub tags: Option<Value>, pub amount_spent: Option<f32>, pub created_at: Option<i64>, pub playtime: Option<i64>, pub badge_count: Option<i32>, pub last_active: Option<i32>, pub notification_types: Option<i32>, pub test_type: Option<i32>, pub long: Option<f32>, pub lat: Option<f32>, pub country: Option<String>,
}

Fields§

§id: Option<String>

The device’s OneSignal ID

§invalid_identifier: Option<bool>

If true, this is the equivalent of a user being Unsubscribed

§app_id: Option<String>§device_type: i32

Required The device’s platform: 0 = iOS 1 = Android 2 = Amazon 3 = WindowsPhone (MPNS) 4 = Chrome Apps / Extensions 5 = Chrome Web Push 6 = Windows (WNS) 7 = Safari 8 = Firefox 9 = MacOS 10 = Alexa 11 = Email 13 = For Huawei App Gallery Builds SDK Setup. Not for Huawei Devices using FCM 14 = SMS

§external_user_id: Option<String>

a custom user ID

§external_user_id_auth_hash: Option<String>

Only required if you have enabled Identity Verification and device_type is NOT 11 email.

§email_auth_hash: Option<String>

Email - Only required if you have enabled Identity Verification and device_type is email (11).

§identifier: Option<String>

Recommended: For Push Notifications, this is the Push Token Identifier from Google or Apple. For Apple Push identifiers, you must strip all non alphanumeric characters. Examples: iOS: 7abcd558f29d0b1f048083e2834ad8ea4b3d87d8ad9c088b33c132706ff445f0 Android: APA91bHbYHk7aq-Uam_2pyJ2qbZvqllyyh2wjfPRaw5gLEX2SUlQBRvOc6sck1sa7H7nGeLNlDco8lXj83HWWwzV… For Email Addresses, set the full email address email@email.com and make sure to set device_type to 11.

§language: Option<String>

Language code. Typically lower case two letters, except for Chinese where it must be one of zh-Hans or zh-Hant. Example: en

§timezone: Option<i32>

Number of seconds away from UTC. Example: -28800

§game_version: Option<String>

Version of your app. Example: 1.1

§device_model: Option<String>

Device make and model. Example: iPhone5,1

§device_os: Option<String>

Device operating system version. Example: 7.0.4

§ad_id: Option<String>

The ad id for the device’s platform: Android = Advertising Id iOS = identifierForVendor WP8.0 = DeviceUniqueId WP8.1 = AdvertisingId

§sdk: Option<String>

Name and version of the sdk/plugin that’s calling this API method (if any)

§session_count: Option<i32>

Number of times the user has played the game, defaults to 1

§tags: Option<Value>

Custom tags for the player. Only support string and integer key value pairs. Does not support arrays or other nested objects. Setting a tag value to null or an empty string will remove the tag. Example: {"foo":"bar","this":"that"} Limitations: - 100 tags per call - Android SDK users: tags cannot be removed or changed via API if set through SDK sendTag methods. Recommended to only tag devices with 1 kilobyte of data Please consider using your own Database to save more than 1 kilobyte of data. See: Internal Database & CRM

§amount_spent: Option<f32>

Amount the user has spent in USD, up to two decimal places

§created_at: Option<i64>

Unixtime when the player joined the game

§playtime: Option<i64>

Seconds player was running your app.

§badge_count: Option<i32>

Current iOS badge count displayed on the app icon NOTE: Not supported for apps created after June 2018, since badge count for apps created after this date are handled on the client.

§last_active: Option<i32>

Unixtime when the player was last active

§notification_types: Option<i32>

1 = subscribed -2 = unsubscribed iOS - These values are set each time the user opens the app from the SDK. Use the SDK function set Subscription instead. Android - You may set this but you can no longer use the SDK method setSubscription later in your app as it will create synchronization issues.

§test_type: Option<i32>

This is used in deciding whether to use your iOS Sandbox or Production push certificate when sending a push when both have been uploaded. Set to the iOS provisioning profile that was used to build your app. 1 = Development 2 = Ad-Hoc Omit this field for App Store builds.

§long: Option<f32>

Longitude of the device, used for geotagging to segment on.

§lat: Option<f32>

Latitude of the device, used for geotagging to segment on.

§country: Option<String>

Country code in the ISO 3166-1 Alpha 2 format

Implementations§

Source§

impl Player

Source

pub fn new(device_type: i32) -> Player

Trait Implementations§

Source§

impl Clone for Player

Source§

fn clone(&self) -> Player

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Player

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Player

Source§

fn default() -> Player

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Player

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Player

Source§

fn eq(&self, other: &Player) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Player

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Player

Auto Trait Implementations§

§

impl Freeze for Player

§

impl RefUnwindSafe for Player

§

impl Send for Player

§

impl Sync for Player

§

impl Unpin for Player

§

impl UnwindSafe for Player

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,