Class: OneSignal::Notification
- Inherits:
-
Object
- Object
- OneSignal::Notification
- Defined in:
- lib/onesignal/models/notification.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#adm_big_picture ⇒ Object
Channel: Push Notifications Platform: Amazon Picture to display in the expanded view.
-
#adm_group ⇒ Object
Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android’s Notification Grouping feature.
-
#adm_group_message ⇒ Object
Channel: Push Notifications Platform: Amazon Summary message to display when 2+ notifications are stacked together.
-
#adm_large_icon ⇒ Object
Channel: Push Notifications Platform: Amazon If blank the small_icon is used.
-
#adm_small_icon ⇒ Object
Channel: Push Notifications Platform: Amazon If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name.
-
#adm_sound ⇒ Object
Channel: Push Notifications Platform: Amazon ⚠️Deprecated, this field doesn’t work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android.
-
#aggregation ⇒ Object
Returns the value of attribute aggregation.
-
#android_accent_color ⇒ Object
Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text.
-
#android_background_layout ⇒ Object
Returns the value of attribute android_background_layout.
-
#android_channel_id ⇒ Object
Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under.
-
#android_group ⇒ Object
Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android’s Notification Grouping feature.
-
#android_group_message ⇒ Object
Channel: Push Notifications Platform: Android Note: This only works for Android 6 and older.
-
#android_led_color ⇒ Object
Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn’t work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android.
-
#android_sound ⇒ Object
Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn’t work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android.
-
#android_visibility ⇒ Object
Channel: Push Notifications Platform: Android 5.0_ ⚠️Deprecated, this field doesn’t work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android.
-
#apns_alert ⇒ Object
Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key.
-
#apns_push_type_override ⇒ Object
Channel: Push Notifications Platform: iOS valid values: voip Set the value to voip for sending VoIP Notifications This field maps to the APNS header apns-push-type.
-
#app_id ⇒ Object
Required: Your OneSignal Application ID, which can be found in Keys & IDs.
-
#app_url ⇒ Object
Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms.
-
#big_picture ⇒ Object
Channel: Push Notifications Platform: Android Picture to display in the expanded view.
-
#buttons ⇒ Object
Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification.
-
#channel_for_external_user_ids ⇒ Object
Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id.
-
#chrome_big_picture ⇒ Object
Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text.
-
#chrome_icon ⇒ Object
Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chrome_web_icon instead.
-
#chrome_web_badge ⇒ Object
Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade.
-
#chrome_web_icon ⇒ Object
Channel: Push Notifications Platform: Chrome Sets the web push notification’s icon.
-
#chrome_web_image ⇒ Object
Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification’s large image to be shown below the notification’s title and text.
-
#collapse_id ⇒ Object
Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device.
-
#content_available ⇒ Object
Channel: Push Notifications Platform: iOS Sending true wakes your app from background to run custom native code (Apple interprets this as content-available=1).
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#custom_data ⇒ Object
Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution.
-
#data ⇒ Object
Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app.
-
#delayed_option ⇒ Object
Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery .
-
#delivery_time_of_day ⇒ Object
Channel: All Use with delayed_option=timezone.
-
#email_body ⇒ Object
Channel: Email Required unless template_id is set.
-
#email_from_address ⇒ Object
Channel: Email The email address the email is from.
-
#email_from_name ⇒ Object
Channel: Email The name the email is from.
-
#email_preheader ⇒ Object
Channel: Email The preheader text of the email.
-
#email_subject ⇒ Object
Channel: Email Required.
-
#excluded_segments ⇒ Object
Segment that will be excluded when sending.
-
#existing_android_channel_id ⇒ Object
Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code.
-
#external_id ⇒ Object
Correlation and idempotency key.
-
#filters ⇒ Object
Returns the value of attribute filters.
-
#firefox_icon ⇒ Object
Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons.
-
#headings ⇒ Object
Returns the value of attribute headings.
-
#huawei_accent_color ⇒ Object
Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count.
-
#huawei_big_picture ⇒ Object
Channel: Push Notifications Platform: Huawei Picture to display in the expanded view.
-
#huawei_channel_id ⇒ Object
Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under.
-
#huawei_existing_channel_id ⇒ Object
Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code.
-
#huawei_large_icon ⇒ Object
Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL.
-
#huawei_led_color ⇒ Object
Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices.
-
#huawei_msg_type ⇒ Object
Channel: Push Notifications Platform: Huawei Use "data" or "message" depending on the type of notification you are sending.
-
#huawei_small_icon ⇒ Object
Channel: Push Notifications Platform: Huawei Icon shown in the status bar and on the top left of the notification.
-
#huawei_sound ⇒ Object
Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices.
-
#huawei_visibility ⇒ Object
Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices.
-
#id ⇒ Object
Returns the value of attribute id.
-
#include_aliases ⇒ Object
Returns the value of attribute include_aliases.
-
#include_amazon_reg_ids ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.
-
#include_android_reg_ids ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.
-
#include_chrome_reg_ids ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.
-
#include_chrome_web_reg_ids ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.
-
#include_email_tokens ⇒ Object
Recommended for Sending Emails - Target specific email addresses.
-
#include_external_user_ids ⇒ Object
Target specific devices by custom user IDs assigned via API.
-
#include_ios_tokens ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.
-
#include_phone_numbers ⇒ Object
Recommended for Sending SMS - Target specific phone numbers.
-
#include_player_ids ⇒ Object
Specific playerids to send your notification to.
-
#include_unsubscribed ⇒ Object
Channel: Email Default is ‘false`.
-
#include_wp_wns_uris ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead.
-
#included_segments ⇒ Object
The segment names you want to target.
-
#ios_attachments ⇒ Object
Channel: Push Notifications Platform: iOS 10+ Adds media attachments to notifications.
-
#ios_badge_count ⇒ Object
Channel: Push Notifications Platform: iOS Used with ios_badgeType, describes the value to set or amount to increase/decrease your app’s iOS badge count by.
-
#ios_badge_type ⇒ Object
Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app’s iOS badge count by the ios_badgeCount specified count.
-
#ios_category ⇒ Object
Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code.
-
#ios_sound ⇒ Object
Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound.
-
#is_adm ⇒ Object
Indicates whether to send to all devices registered under your app’s Amazon Fire platform.
-
#is_android ⇒ Object
Indicates whether to send to all devices registered under your app’s Google Android platform.
-
#is_any_web ⇒ Object
Indicates whether to send to all subscribed web browser users, including Chrome, Firefox, and Safari.
-
#is_chrome ⇒ Object
This flag is not used for web push Please see isChromeWeb for sending to web push users.
-
#is_chrome_web ⇒ Object
Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform.
-
#is_firefox ⇒ Object
Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform.
-
#is_huawei ⇒ Object
Indicates whether to send to all devices registered under your app’s Huawei Android platform.
-
#is_ios ⇒ Object
Indicates whether to send to all devices registered under your app’s Apple iOS platform.
-
#is_safari ⇒ Object
Does not support iOS Safari.
-
#is_wp_wns ⇒ Object
Indicates whether to send to all devices registered under your app’s Windows platform.
-
#large_icon ⇒ Object
Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL.
-
#mutable_content ⇒ Object
Channel: Push Notifications Platform: iOS 10+ Always defaults to true and cannot be turned off.
-
#name ⇒ Object
Required for SMS Messages.
-
#priority ⇒ Object
Channel: Push Notifications Platform: Android, Chrome, ChromeWeb Delivery priority through the push server (example GCM/FCM).
-
#send_after ⇒ Object
Channel: All Schedule notification for future delivery.
-
#small_icon ⇒ Object
Channel: Push Notifications Platform: Android Icon shown in the status bar and on the top left of the notification.
-
#sms_from ⇒ Object
Channel: SMS Phone Number used to send SMS.
-
#sms_media_urls ⇒ Object
Channel: SMS URLs for the media files to be attached to the SMS content.
-
#subtitle ⇒ Object
Returns the value of attribute subtitle.
-
#summary_arg ⇒ Object
Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary.
-
#summary_arg_count ⇒ Object
Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group.
-
#target_channel ⇒ Object
Returns the value of attribute target_channel.
-
#target_content_identifier ⇒ Object
Channel: Push Notifications Platform: iOS 13+ Use to target a specific experience in your App Clip, or to target your notification to a specific window in a multi-scene App.
-
#template_id ⇒ Object
Channel: Push Notifications Platform: All Use a template you setup on our dashboard.
-
#thread_id ⇒ Object
Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above.
-
#throttle_rate_per_minute ⇒ Object
Channel: All Apps with throttling enabled: - the parameter value will be used to override the default application throttling value set from the dashboard settings.
-
#ttl ⇒ Object
Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds.
-
#url ⇒ Object
Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification.
-
#value ⇒ Object
Returns the value of attribute value.
-
#web_buttons ⇒ Object
Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification.
-
#web_push_topic ⇒ Object
Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics.
-
#web_url ⇒ Object
Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms.
-
#wp_wns_sound ⇒ Object
Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Notification
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Notification
Initializes the object
679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 |
# File 'lib/onesignal/models/notification.rb', line 679 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::Notification` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::Notification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'included_segments') if (value = attributes[:'included_segments']).is_a?(Array) self.included_segments = value end end if attributes.key?(:'excluded_segments') if (value = attributes[:'excluded_segments']).is_a?(Array) self.excluded_segments = value end end if attributes.key?(:'include_player_ids') if (value = attributes[:'include_player_ids']).is_a?(Array) self.include_player_ids = value end end if attributes.key?(:'include_external_user_ids') if (value = attributes[:'include_external_user_ids']).is_a?(Array) self.include_external_user_ids = value end end if attributes.key?(:'include_email_tokens') if (value = attributes[:'include_email_tokens']).is_a?(Array) self.include_email_tokens = value end end if attributes.key?(:'include_phone_numbers') if (value = attributes[:'include_phone_numbers']).is_a?(Array) self.include_phone_numbers = value end end if attributes.key?(:'include_ios_tokens') if (value = attributes[:'include_ios_tokens']).is_a?(Array) self.include_ios_tokens = value end end if attributes.key?(:'include_wp_wns_uris') if (value = attributes[:'include_wp_wns_uris']).is_a?(Array) self.include_wp_wns_uris = value end end if attributes.key?(:'include_amazon_reg_ids') if (value = attributes[:'include_amazon_reg_ids']).is_a?(Array) self.include_amazon_reg_ids = value end end if attributes.key?(:'include_chrome_reg_ids') if (value = attributes[:'include_chrome_reg_ids']).is_a?(Array) self.include_chrome_reg_ids = value end end if attributes.key?(:'include_chrome_web_reg_ids') if (value = attributes[:'include_chrome_web_reg_ids']).is_a?(Array) self.include_chrome_web_reg_ids = value end end if attributes.key?(:'include_android_reg_ids') if (value = attributes[:'include_android_reg_ids']).is_a?(Array) self.include_android_reg_ids = value end end if attributes.key?(:'include_aliases') self.include_aliases = attributes[:'include_aliases'] end if attributes.key?(:'target_channel') self.target_channel = attributes[:'target_channel'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'value') self.value = attributes[:'value'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'aggregation') self.aggregation = attributes[:'aggregation'] end if attributes.key?(:'is_ios') self.is_ios = attributes[:'is_ios'] end if attributes.key?(:'is_android') self.is_android = attributes[:'is_android'] end if attributes.key?(:'is_huawei') self.is_huawei = attributes[:'is_huawei'] end if attributes.key?(:'is_any_web') self.is_any_web = attributes[:'is_any_web'] end if attributes.key?(:'is_chrome_web') self.is_chrome_web = attributes[:'is_chrome_web'] end if attributes.key?(:'is_firefox') self.is_firefox = attributes[:'is_firefox'] end if attributes.key?(:'is_safari') self.is_safari = attributes[:'is_safari'] end if attributes.key?(:'is_wp_wns') self.is_wp_wns = attributes[:'is_wp_wns'] end if attributes.key?(:'is_adm') self.is_adm = attributes[:'is_adm'] end if attributes.key?(:'is_chrome') self.is_chrome = attributes[:'is_chrome'] end if attributes.key?(:'channel_for_external_user_ids') self.channel_for_external_user_ids = attributes[:'channel_for_external_user_ids'] end if attributes.key?(:'app_id') self.app_id = attributes[:'app_id'] end if attributes.key?(:'external_id') self.external_id = attributes[:'external_id'] end if attributes.key?(:'contents') self.contents = attributes[:'contents'] end if attributes.key?(:'headings') self.headings = attributes[:'headings'] end if attributes.key?(:'subtitle') self.subtitle = attributes[:'subtitle'] end if attributes.key?(:'data') self.data = attributes[:'data'] end if attributes.key?(:'huawei_msg_type') self.huawei_msg_type = attributes[:'huawei_msg_type'] end if attributes.key?(:'url') self.url = attributes[:'url'] end if attributes.key?(:'web_url') self.web_url = attributes[:'web_url'] end if attributes.key?(:'app_url') self.app_url = attributes[:'app_url'] end if attributes.key?(:'ios_attachments') self. = attributes[:'ios_attachments'] end if attributes.key?(:'template_id') self.template_id = attributes[:'template_id'] end if attributes.key?(:'content_available') self.content_available = attributes[:'content_available'] end if attributes.key?(:'mutable_content') self.mutable_content = attributes[:'mutable_content'] end if attributes.key?(:'target_content_identifier') self.target_content_identifier = attributes[:'target_content_identifier'] end if attributes.key?(:'big_picture') self.big_picture = attributes[:'big_picture'] end if attributes.key?(:'huawei_big_picture') self.huawei_big_picture = attributes[:'huawei_big_picture'] end if attributes.key?(:'adm_big_picture') self.adm_big_picture = attributes[:'adm_big_picture'] end if attributes.key?(:'chrome_big_picture') self.chrome_big_picture = attributes[:'chrome_big_picture'] end if attributes.key?(:'chrome_web_image') self.chrome_web_image = attributes[:'chrome_web_image'] end if attributes.key?(:'buttons') if (value = attributes[:'buttons']).is_a?(Array) self. = value end end if attributes.key?(:'web_buttons') if (value = attributes[:'web_buttons']).is_a?(Array) self. = value end end if attributes.key?(:'ios_category') self.ios_category = attributes[:'ios_category'] end if attributes.key?(:'android_channel_id') self.android_channel_id = attributes[:'android_channel_id'] end if attributes.key?(:'huawei_channel_id') self.huawei_channel_id = attributes[:'huawei_channel_id'] end if attributes.key?(:'existing_android_channel_id') self.existing_android_channel_id = attributes[:'existing_android_channel_id'] end if attributes.key?(:'huawei_existing_channel_id') self.huawei_existing_channel_id = attributes[:'huawei_existing_channel_id'] end if attributes.key?(:'android_background_layout') self.android_background_layout = attributes[:'android_background_layout'] end if attributes.key?(:'small_icon') self.small_icon = attributes[:'small_icon'] end if attributes.key?(:'huawei_small_icon') self.huawei_small_icon = attributes[:'huawei_small_icon'] end if attributes.key?(:'large_icon') self.large_icon = attributes[:'large_icon'] end if attributes.key?(:'huawei_large_icon') self.huawei_large_icon = attributes[:'huawei_large_icon'] end if attributes.key?(:'adm_small_icon') self.adm_small_icon = attributes[:'adm_small_icon'] end if attributes.key?(:'adm_large_icon') self.adm_large_icon = attributes[:'adm_large_icon'] end if attributes.key?(:'chrome_web_icon') self.chrome_web_icon = attributes[:'chrome_web_icon'] end if attributes.key?(:'chrome_web_badge') self.chrome_web_badge = attributes[:'chrome_web_badge'] end if attributes.key?(:'firefox_icon') self.firefox_icon = attributes[:'firefox_icon'] end if attributes.key?(:'chrome_icon') self.chrome_icon = attributes[:'chrome_icon'] end if attributes.key?(:'ios_sound') self.ios_sound = attributes[:'ios_sound'] end if attributes.key?(:'android_sound') self.android_sound = attributes[:'android_sound'] end if attributes.key?(:'huawei_sound') self.huawei_sound = attributes[:'huawei_sound'] end if attributes.key?(:'adm_sound') self.adm_sound = attributes[:'adm_sound'] end if attributes.key?(:'wp_wns_sound') self.wp_wns_sound = attributes[:'wp_wns_sound'] end if attributes.key?(:'android_led_color') self.android_led_color = attributes[:'android_led_color'] end if attributes.key?(:'huawei_led_color') self.huawei_led_color = attributes[:'huawei_led_color'] end if attributes.key?(:'android_accent_color') self.android_accent_color = attributes[:'android_accent_color'] end if attributes.key?(:'huawei_accent_color') self.huawei_accent_color = attributes[:'huawei_accent_color'] end if attributes.key?(:'android_visibility') self.android_visibility = attributes[:'android_visibility'] end if attributes.key?(:'huawei_visibility') self.huawei_visibility = attributes[:'huawei_visibility'] end if attributes.key?(:'ios_badge_type') self.ios_badge_type = attributes[:'ios_badge_type'] end if attributes.key?(:'ios_badge_count') self.ios_badge_count = attributes[:'ios_badge_count'] end if attributes.key?(:'collapse_id') self.collapse_id = attributes[:'collapse_id'] end if attributes.key?(:'web_push_topic') self.web_push_topic = attributes[:'web_push_topic'] end if attributes.key?(:'apns_alert') self.apns_alert = attributes[:'apns_alert'] end if attributes.key?(:'delayed_option') self.delayed_option = attributes[:'delayed_option'] end if attributes.key?(:'delivery_time_of_day') self.delivery_time_of_day = attributes[:'delivery_time_of_day'] end if attributes.key?(:'ttl') self.ttl = attributes[:'ttl'] end if attributes.key?(:'priority') self.priority = attributes[:'priority'] end if attributes.key?(:'apns_push_type_override') self.apns_push_type_override = attributes[:'apns_push_type_override'] end if attributes.key?(:'throttle_rate_per_minute') self.throttle_rate_per_minute = attributes[:'throttle_rate_per_minute'] end if attributes.key?(:'android_group') self.android_group = attributes[:'android_group'] end if attributes.key?(:'android_group_message') self. = attributes[:'android_group_message'] end if attributes.key?(:'adm_group') self.adm_group = attributes[:'adm_group'] end if attributes.key?(:'adm_group_message') self. = attributes[:'adm_group_message'] end if attributes.key?(:'thread_id') self.thread_id = attributes[:'thread_id'] end if attributes.key?(:'summary_arg') self.summary_arg = attributes[:'summary_arg'] end if attributes.key?(:'summary_arg_count') self.summary_arg_count = attributes[:'summary_arg_count'] end if attributes.key?(:'email_subject') self.email_subject = attributes[:'email_subject'] end if attributes.key?(:'email_body') self.email_body = attributes[:'email_body'] end if attributes.key?(:'email_from_name') self.email_from_name = attributes[:'email_from_name'] end if attributes.key?(:'email_from_address') self.email_from_address = attributes[:'email_from_address'] end if attributes.key?(:'email_preheader') self.email_preheader = attributes[:'email_preheader'] end if attributes.key?(:'include_unsubscribed') self.include_unsubscribed = attributes[:'include_unsubscribed'] end if attributes.key?(:'sms_from') self.sms_from = attributes[:'sms_from'] end if attributes.key?(:'sms_media_urls') if (value = attributes[:'sms_media_urls']).is_a?(Array) self.sms_media_urls = value end end if attributes.key?(:'filters') if (value = attributes[:'filters']).is_a?(Array) self.filters = value end end if attributes.key?(:'custom_data') self.custom_data = attributes[:'custom_data'] end if attributes.key?(:'send_after') self.send_after = attributes[:'send_after'] end end |
Instance Attribute Details
#adm_big_picture ⇒ Object
Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL.
149 150 151 |
# File 'lib/onesignal/models/notification.rb', line 149 def adm_big_picture @adm_big_picture end |
#adm_group ⇒ Object
Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android’s Notification Grouping feature.
283 284 285 |
# File 'lib/onesignal/models/notification.rb', line 283 def adm_group @adm_group end |
#adm_group_message ⇒ Object
Channel: Push Notifications Platform: Amazon Summary message to display when 2+ notifications are stacked together. Default is "# new messages". Include $[notif_count] in your message and it will be replaced with the current number. "en" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. The value of each key is the message that will be sent to users for that language. Example: "You have $[notif_count] new messages"
286 287 288 |
# File 'lib/onesignal/models/notification.rb', line 286 def @adm_group_message end |
#adm_large_icon ⇒ Object
Channel: Push Notifications Platform: Amazon If blank the small_icon is used. Can be a drawable resource name or a URL. See: How to create large icons
196 197 198 |
# File 'lib/onesignal/models/notification.rb', line 196 def adm_large_icon @adm_large_icon end |
#adm_small_icon ⇒ Object
Channel: Push Notifications Platform: Amazon If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons
193 194 195 |
# File 'lib/onesignal/models/notification.rb', line 193 def adm_small_icon @adm_small_icon end |
#adm_sound ⇒ Object
Channel: Push Notifications Platform: Amazon ⚠️Deprecated, this field doesn’t work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: "notification"
220 221 222 |
# File 'lib/onesignal/models/notification.rb', line 220 def adm_sound @adm_sound end |
#aggregation ⇒ Object
Returns the value of attribute aggregation.
65 66 67 |
# File 'lib/onesignal/models/notification.rb', line 65 def aggregation @aggregation end |
#android_accent_color ⇒ Object
Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): "FFFF0000"
232 233 234 |
# File 'lib/onesignal/models/notification.rb', line 232 def android_accent_color @android_accent_color end |
#android_background_layout ⇒ Object
Returns the value of attribute android_background_layout.
178 179 180 |
# File 'lib/onesignal/models/notification.rb', line 178 def android_background_layout @android_background_layout end |
#android_channel_id ⇒ Object
Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it’s id.
167 168 169 |
# File 'lib/onesignal/models/notification.rb', line 167 def android_channel_id @android_channel_id end |
#android_group ⇒ Object
Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android’s Notification Grouping feature.
277 278 279 |
# File 'lib/onesignal/models/notification.rb', line 277 def android_group @android_group end |
#android_group_message ⇒ Object
Channel: Push Notifications Platform: Android Note: This only works for Android 6 and older. Android 7+ allows full expansion of all message. Summary message to display when 2+ notifications are stacked together. Default is "# new messages". Include $[notif_count] in your message and it will be replaced with the current number. Languages - The value of each key is the message that will be sent to users for that language. "en" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. Read more: supported languages. Example: "You have $[notif_count] new messages"
280 281 282 |
# File 'lib/onesignal/models/notification.rb', line 280 def @android_group_message end |
#android_led_color ⇒ Object
Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn’t work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): "FF0000FF"
226 227 228 |
# File 'lib/onesignal/models/notification.rb', line 226 def android_led_color @android_led_color end |
#android_sound ⇒ Object
Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn’t work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: "notification"
214 215 216 |
# File 'lib/onesignal/models/notification.rb', line 214 def android_sound @android_sound end |
#android_visibility ⇒ Object
Channel: Push Notifications Platform: Android 5.0_ ⚠️Deprecated, this field doesn’t work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set "Hide sensitive notification content" in the system settings) -1 = Secret (Notification does not show on the lock screen at all)
238 239 240 |
# File 'lib/onesignal/models/notification.rb', line 238 def android_visibility @android_visibility end |
#apns_alert ⇒ Object
Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apns_alert. Please see Apple’s guide on localizing push notifications to learn more.
256 257 258 |
# File 'lib/onesignal/models/notification.rb', line 256 def apns_alert @apns_alert end |
#apns_push_type_override ⇒ Object
Channel: Push Notifications Platform: iOS valid values: voip Set the value to voip for sending VoIP Notifications This field maps to the APNS header apns-push-type. Note: alert and background are automatically set by OneSignal
271 272 273 |
# File 'lib/onesignal/models/notification.rb', line 271 def apns_push_type_override @apns_push_type_override end |
#app_id ⇒ Object
Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434.
101 102 103 |
# File 'lib/onesignal/models/notification.rb', line 101 def app_id @app_id end |
#app_url ⇒ Object
Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including iOS, Android, macOS, Windows, ChromeApps, etc. Example: onesignal.com
125 126 127 |
# File 'lib/onesignal/models/notification.rb', line 125 def app_url @app_url end |
#big_picture ⇒ Object
Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL.
143 144 145 |
# File 'lib/onesignal/models/notification.rb', line 143 def big_picture @big_picture end |
#buttons ⇒ Object
Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: ["id2", "text": "second button", "icon": "ic_menu_share", "id1", "text": "first button", "icon": "ic_menu_send"]
158 159 160 |
# File 'lib/onesignal/models/notification.rb', line 158 def @buttons end |
#channel_for_external_user_ids ⇒ Object
Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string "push" to indicate you are sending a push notification or the string "email"for sending emails or "sms"for sending SMS.
98 99 100 |
# File 'lib/onesignal/models/notification.rb', line 98 def channel_for_external_user_ids @channel_for_external_user_ids end |
#chrome_big_picture ⇒ Object
Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL.
152 153 154 |
# File 'lib/onesignal/models/notification.rb', line 152 def chrome_big_picture @chrome_big_picture end |
#chrome_icon ⇒ Object
Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chrome_web_icon instead. The local URL to an icon to use. If blank, the app icon will be used.
208 209 210 |
# File 'lib/onesignal/models/notification.rb', line 208 def chrome_icon @chrome_icon end |
#chrome_web_badge ⇒ Object
Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge.
202 203 204 |
# File 'lib/onesignal/models/notification.rb', line 202 def chrome_web_badge @chrome_web_badge end |
#chrome_web_icon ⇒ Object
Channel: Push Notifications Platform: Chrome Sets the web push notification’s icon. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. Firefox will also use this icon, unless you specify firefox_icon.
199 200 201 |
# File 'lib/onesignal/models/notification.rb', line 199 def chrome_web_icon @chrome_web_icon end |
#chrome_web_image ⇒ Object
Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification’s large image to be shown below the notification’s title and text. Please see Web Push Notification Icons.
155 156 157 |
# File 'lib/onesignal/models/notification.rb', line 155 def chrome_web_image @chrome_web_image end |
#collapse_id ⇒ Object
Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters.
250 251 252 |
# File 'lib/onesignal/models/notification.rb', line 250 def collapse_id @collapse_id end |
#content_available ⇒ Object
Channel: Push Notifications Platform: iOS Sending true wakes your app from background to run custom native code (Apple interprets this as content-available=1). Note: Not applicable if the app is in the "force-quit" state (i.e app was swiped away). Omit the contents field to prevent displaying a visible notification.
134 135 136 |
# File 'lib/onesignal/models/notification.rb', line 134 def content_available @content_available end |
#contents ⇒ Object
Returns the value of attribute contents.
106 107 108 |
# File 'lib/onesignal/models/notification.rb', line 106 def contents @contents end |
#custom_data ⇒ Object
Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: 123, "currency": "USD", "amount": 25
324 325 326 |
# File 'lib/onesignal/models/notification.rb', line 324 def custom_data @custom_data end |
#data ⇒ Object
Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: 123, "foo": "bar", "event_performed": true, "amount": 12.1
113 114 115 |
# File 'lib/onesignal/models/notification.rb', line 113 def data @data end |
#delayed_option ⇒ Object
Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app). If send_after is used, this takes effect after the send_after time has elapsed.
259 260 261 |
# File 'lib/onesignal/models/notification.rb', line 259 def delayed_option @delayed_option end |
#delivery_time_of_day ⇒ Object
Channel: All Use with delayed_option=timezone. Examples: "9:00AM" "21:45" "9:45:30"
262 263 264 |
# File 'lib/onesignal/models/notification.rb', line 262 def delivery_time_of_day @delivery_time_of_day end |
#email_body ⇒ Object
Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid.
301 302 303 |
# File 'lib/onesignal/models/notification.rb', line 301 def email_body @email_body end |
#email_from_address ⇒ Object
Channel: Email The email address the email is from. If not specified, will default to "from email" set in the OneSignal Dashboard Email Settings.
307 308 309 |
# File 'lib/onesignal/models/notification.rb', line 307 def email_from_address @email_from_address end |
#email_from_name ⇒ Object
Channel: Email The name the email is from. If not specified, will default to "from name" set in the OneSignal Dashboard Email Settings.
304 305 306 |
# File 'lib/onesignal/models/notification.rb', line 304 def email_from_name @email_from_name end |
#email_preheader ⇒ Object
Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null.
310 311 312 |
# File 'lib/onesignal/models/notification.rb', line 310 def email_preheader @email_preheader end |
#email_subject ⇒ Object
Channel: Email Required. The subject of the email.
298 299 300 |
# File 'lib/onesignal/models/notification.rb', line 298 def email_subject @email_subject end |
#excluded_segments ⇒ Object
Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: ["Active Users", "Inactive Users"]
22 23 24 |
# File 'lib/onesignal/models/notification.rb', line 22 def excluded_segments @excluded_segments end |
#existing_android_channel_id ⇒ Object
Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code.
173 174 175 |
# File 'lib/onesignal/models/notification.rb', line 173 def existing_android_channel_id @existing_android_channel_id end |
#external_id ⇒ Object
Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it’s important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true
104 105 106 |
# File 'lib/onesignal/models/notification.rb', line 104 def external_id @external_id end |
#filters ⇒ Object
Returns the value of attribute filters.
321 322 323 |
# File 'lib/onesignal/models/notification.rb', line 321 def filters @filters end |
#firefox_icon ⇒ Object
Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons. We recommend setting chrome_web_icon instead, which Firefox will also use. Sets the web push notification’s icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices.
205 206 207 |
# File 'lib/onesignal/models/notification.rb', line 205 def firefox_icon @firefox_icon end |
#headings ⇒ Object
Returns the value of attribute headings.
108 109 110 |
# File 'lib/onesignal/models/notification.rb', line 108 def headings @headings end |
#huawei_accent_color ⇒ Object
Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device’s theme color if not set.
235 236 237 |
# File 'lib/onesignal/models/notification.rb', line 235 def huawei_accent_color @huawei_accent_color end |
#huawei_big_picture ⇒ Object
Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL.
146 147 148 |
# File 'lib/onesignal/models/notification.rb', line 146 def huawei_big_picture @huawei_big_picture end |
#huawei_channel_id ⇒ Object
Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it’s id.
170 171 172 |
# File 'lib/onesignal/models/notification.rb', line 170 def huawei_channel_id @huawei_channel_id end |
#huawei_existing_channel_id ⇒ Object
Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code.
176 177 178 |
# File 'lib/onesignal/models/notification.rb', line 176 def huawei_existing_channel_id @huawei_existing_channel_id end |
#huawei_large_icon ⇒ Object
Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL. See: How to create large icons
190 191 192 |
# File 'lib/onesignal/models/notification.rb', line 190 def huawei_large_icon @huawei_large_icon end |
#huawei_led_color ⇒ Object
Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): "0000FF"
229 230 231 |
# File 'lib/onesignal/models/notification.rb', line 229 def huawei_led_color @huawei_led_color end |
#huawei_msg_type ⇒ Object
Channel: Push Notifications Platform: Huawei Use "data" or "message" depending on the type of notification you are sending. More details in Data & Background Notifications.
116 117 118 |
# File 'lib/onesignal/models/notification.rb', line 116 def huawei_msg_type @huawei_msg_type end |
#huawei_small_icon ⇒ Object
Channel: Push Notifications Platform: Huawei Icon shown in the status bar and on the top left of the notification. Use an Android resource path (E.g. /drawable/small_icon). Defaults to your app icon if not set.
184 185 186 |
# File 'lib/onesignal/models/notification.rb', line 184 def huawei_small_icon @huawei_small_icon end |
#huawei_sound ⇒ Object
Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: "/res/raw/notification"
217 218 219 |
# File 'lib/onesignal/models/notification.rb', line 217 def huawei_sound @huawei_sound end |
#huawei_visibility ⇒ Object
Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set "Hide sensitive notification content" in the system settings) -1 = Secret (Notification does not show on the lock screen at all)
241 242 243 |
# File 'lib/onesignal/models/notification.rb', line 241 def huawei_visibility @huawei_visibility end |
#id ⇒ Object
Returns the value of attribute id.
58 59 60 |
# File 'lib/onesignal/models/notification.rb', line 58 def id @id end |
#include_aliases ⇒ Object
Returns the value of attribute include_aliases.
54 55 56 |
# File 'lib/onesignal/models/notification.rb', line 54 def include_aliases @include_aliases end |
#include_amazon_reg_ids ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV… Limit of 2,000 entries per REST API call
43 44 45 |
# File 'lib/onesignal/models/notification.rb', line 43 def include_amazon_reg_ids @include_amazon_reg_ids end |
#include_android_reg_ids ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_… Limit of 2,000 entries per REST API call
52 53 54 |
# File 'lib/onesignal/models/notification.rb', line 52 def include_android_reg_ids @include_android_reg_ids end |
#include_chrome_reg_ids ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_… Limit of 2,000 entries per REST API call
46 47 48 |
# File 'lib/onesignal/models/notification.rb', line 46 def include_chrome_reg_ids @include_chrome_reg_ids end |
#include_chrome_web_reg_ids ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_… Limit of 2,000 entries per REST API call
49 50 51 |
# File 'lib/onesignal/models/notification.rb', line 49 def include_chrome_web_reg_ids @include_chrome_web_reg_ids end |
#include_email_tokens ⇒ Object
Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: [email protected] Limit of 2,000 entries per REST API call
31 32 33 |
# File 'lib/onesignal/models/notification.rb', line 31 def include_email_tokens @include_email_tokens end |
#include_external_user_ids ⇒ Object
Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: ["custom-id-assigned-by-api"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms.
28 29 30 |
# File 'lib/onesignal/models/notification.rb', line 28 def include_external_user_ids @include_external_user_ids end |
#include_ios_tokens ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203… Limit of 2,000 entries per REST API call
37 38 39 |
# File 'lib/onesignal/models/notification.rb', line 37 def include_ios_tokens @include_ios_tokens end |
#include_phone_numbers ⇒ Object
Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call
34 35 36 |
# File 'lib/onesignal/models/notification.rb', line 34 def include_phone_numbers @include_phone_numbers end |
#include_player_ids ⇒ Object
Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: ["1dd608f2-c6a1-11e3-851d-000c2940e62c"] Limit of 2,000 entries per REST API call
25 26 27 |
# File 'lib/onesignal/models/notification.rb', line 25 def include_player_ids @include_player_ids end |
#include_unsubscribed ⇒ Object
Channel: Email Default is ‘false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP’s list of unsubscribed emails to be cleared.
313 314 315 |
# File 'lib/onesignal/models/notification.rb', line 313 def include_unsubscribed @include_unsubscribed end |
#include_wp_wns_uris ⇒ Object
Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: s.notify.live.net/u/1/bn1/HmQAAACPaLDr-… Limit of 2,000 entries per REST API call
40 41 42 |
# File 'lib/onesignal/models/notification.rb', line 40 def include_wp_wns_uris @include_wp_wns_uris end |
#included_segments ⇒ Object
The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: ["Active Users", "Inactive Users"]
19 20 21 |
# File 'lib/onesignal/models/notification.rb', line 19 def included_segments @included_segments end |
#ios_attachments ⇒ Object
Channel: Push Notifications Platform: iOS 10+ Adds media attachments to notifications. Set as JSON object, key as a media id of your choice and the value as a valid local filename or URL. User must press and hold on the notification to view. Do not set mutable_content to download attachments. The OneSignal SDK does this automatically Example: ""
128 129 130 |
# File 'lib/onesignal/models/notification.rb', line 128 def @ios_attachments end |
#ios_badge_count ⇒ Object
Channel: Push Notifications Platform: iOS Used with ios_badgeType, describes the value to set or amount to increase/decrease your app’s iOS badge count by. You can use a negative number to decrease the badge count when used with an ios_badgeType of Increase.
247 248 249 |
# File 'lib/onesignal/models/notification.rb', line 247 def ios_badge_count @ios_badge_count end |
#ios_badge_type ⇒ Object
Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app’s iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. ‘None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count.
244 245 246 |
# File 'lib/onesignal/models/notification.rb', line 244 def ios_badge_type @ios_badge_type end |
#ios_category ⇒ Object
Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category.
164 165 166 |
# File 'lib/onesignal/models/notification.rb', line 164 def ios_category @ios_category end |
#ios_sound ⇒ Object
Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: "notification.wav"
211 212 213 |
# File 'lib/onesignal/models/notification.rb', line 211 def ios_sound @ios_sound end |
#is_adm ⇒ Object
Indicates whether to send to all devices registered under your app’s Amazon Fire platform.
92 93 94 |
# File 'lib/onesignal/models/notification.rb', line 92 def is_adm @is_adm end |
#is_android ⇒ Object
Indicates whether to send to all devices registered under your app’s Google Android platform.
71 72 73 |
# File 'lib/onesignal/models/notification.rb', line 71 def is_android @is_android end |
#is_any_web ⇒ Object
Indicates whether to send to all subscribed web browser users, including Chrome, Firefox, and Safari. You may use this instead as a combined flag instead of separately enabling isChromeWeb, isFirefox, and isSafari, though the three options are equivalent to this one.
77 78 79 |
# File 'lib/onesignal/models/notification.rb', line 77 def is_any_web @is_any_web end |
#is_chrome ⇒ Object
This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app’s Google Chrome Apps & Extension platform.
95 96 97 |
# File 'lib/onesignal/models/notification.rb', line 95 def is_chrome @is_chrome end |
#is_chrome_web ⇒ Object
Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform.
80 81 82 |
# File 'lib/onesignal/models/notification.rb', line 80 def is_chrome_web @is_chrome_web end |
#is_firefox ⇒ Object
Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform.
83 84 85 |
# File 'lib/onesignal/models/notification.rb', line 83 def is_firefox @is_firefox end |
#is_huawei ⇒ Object
Indicates whether to send to all devices registered under your app’s Huawei Android platform.
74 75 76 |
# File 'lib/onesignal/models/notification.rb', line 74 def is_huawei @is_huawei end |
#is_ios ⇒ Object
Indicates whether to send to all devices registered under your app’s Apple iOS platform.
68 69 70 |
# File 'lib/onesignal/models/notification.rb', line 68 def is_ios @is_ios end |
#is_safari ⇒ Object
Does not support iOS Safari. Indicates whether to send to all Apple’s Safari desktop users registered under your Safari web push platform. Read more iOS Safari
86 87 88 |
# File 'lib/onesignal/models/notification.rb', line 86 def is_safari @is_safari end |
#is_wp_wns ⇒ Object
Indicates whether to send to all devices registered under your app’s Windows platform.
89 90 91 |
# File 'lib/onesignal/models/notification.rb', line 89 def is_wp_wns @is_wp_wns end |
#large_icon ⇒ Object
Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL. See: How to create large icons
187 188 189 |
# File 'lib/onesignal/models/notification.rb', line 187 def large_icon @large_icon end |
#mutable_content ⇒ Object
Channel: Push Notifications Platform: iOS 10+ Always defaults to true and cannot be turned off. Allows tracking of notification receives and changing of the notification content in your app before it is displayed. Triggers didReceive(_:withContentHandler:) on your UNNotificationServiceExtension.
137 138 139 |
# File 'lib/onesignal/models/notification.rb', line 137 def mutable_content @mutable_content end |
#name ⇒ Object
Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user.
63 64 65 |
# File 'lib/onesignal/models/notification.rb', line 63 def name @name end |
#priority ⇒ Object
Channel: Push Notifications Platform: Android, Chrome, ChromeWeb Delivery priority through the push server (example GCM/FCM). Pass 10 for high priority or any other integer for normal priority. Defaults to normal priority for Android and high for iOS. For Android 6.0+ devices setting priority to high will wake the device out of doze mode.
268 269 270 |
# File 'lib/onesignal/models/notification.rb', line 268 def priority @priority end |
#send_after ⇒ Object
Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. "Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)" "September 24th 2015, 2:00:00 pm UTC-07:00" "2015-09-24 14:00:00 GMT-0700" "Sept 24 2015 14:00:00 GMT-0700" "Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)" Note: SMS currently only supports send_after parameter.
327 328 329 |
# File 'lib/onesignal/models/notification.rb', line 327 def send_after @send_after end |
#small_icon ⇒ Object
Channel: Push Notifications Platform: Android Icon shown in the status bar and on the top left of the notification. If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons
181 182 183 |
# File 'lib/onesignal/models/notification.rb', line 181 def small_icon @small_icon end |
#sms_from ⇒ Object
Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format.
316 317 318 |
# File 'lib/onesignal/models/notification.rb', line 316 def sms_from @sms_from end |
#sms_media_urls ⇒ Object
Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs.
319 320 321 |
# File 'lib/onesignal/models/notification.rb', line 319 def sms_media_urls @sms_media_urls end |
#subtitle ⇒ Object
Returns the value of attribute subtitle.
110 111 112 |
# File 'lib/onesignal/models/notification.rb', line 110 def subtitle @subtitle end |
#summary_arg ⇒ Object
Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say "12 more notifications from John Doe". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as "X more notifications from summary_arg"
292 293 294 |
# File 'lib/onesignal/models/notification.rb', line 292 def summary_arg @summary_arg end |
#summary_arg_count ⇒ Object
Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be "14 more notifications from summary_arg"
295 296 297 |
# File 'lib/onesignal/models/notification.rb', line 295 def summary_arg_count @summary_arg_count end |
#target_channel ⇒ Object
Returns the value of attribute target_channel.
56 57 58 |
# File 'lib/onesignal/models/notification.rb', line 56 def target_channel @target_channel end |
#target_content_identifier ⇒ Object
Channel: Push Notifications Platform: iOS 13+ Use to target a specific experience in your App Clip, or to target your notification to a specific window in a multi-scene App.
140 141 142 |
# File 'lib/onesignal/models/notification.rb', line 140 def target_content_identifier @target_content_identifier end |
#template_id ⇒ Object
Channel: Push Notifications Platform: All Use a template you setup on our dashboard. The template_id is the UUID found in the URL when viewing a template on our dashboard. Example: be4a8044-bbd6-11e4-a581-000c2940e62c
131 132 133 |
# File 'lib/onesignal/models/notification.rb', line 131 def template_id @template_id end |
#thread_id ⇒ Object
Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group.
289 290 291 |
# File 'lib/onesignal/models/notification.rb', line 289 def thread_id @thread_id end |
#throttle_rate_per_minute ⇒ Object
Channel: All Apps with throttling enabled: - the parameter value will be used to override the default application throttling value set from the dashboard settings. - parameter value 0 indicates not to apply throttling to the notification. - if the parameter is not passed then the default app throttling value will be applied to the notification. Apps with throttling disabled: - this parameter can be used to throttle delivery for the notification even though throttling is not enabled at the application level. Refer to throttling for more details.
274 275 276 |
# File 'lib/onesignal/models/notification.rb', line 274 def throttle_rate_per_minute @throttle_rate_per_minute end |
#ttl ⇒ Object
Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days). Max value to set is 2419200 seconds (28 days).
265 266 267 |
# File 'lib/onesignal/models/notification.rb', line 265 def ttl @ttl end |
#url ⇒ Object
Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: onesignal.com
119 120 121 |
# File 'lib/onesignal/models/notification.rb', line 119 def url @url end |
#value ⇒ Object
Returns the value of attribute value.
60 61 62 |
# File 'lib/onesignal/models/notification.rb', line 60 def value @value end |
#web_buttons ⇒ Object
Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: ["like-button", "text": "Like", "icon": "", "url": "yoursite.com", "read-more-button", "text": "Read more", "icon": "", "url": "yoursite.com"]
161 162 163 |
# File 'lib/onesignal/models/notification.rb', line 161 def @web_buttons end |
#web_push_topic ⇒ Object
Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics.
253 254 255 |
# File 'lib/onesignal/models/notification.rb', line 253 def web_push_topic @web_push_topic end |
#web_url ⇒ Object
Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including Chrome, Firefox, Safari, Opera, etc. Example: onesignal.com
122 123 124 |
# File 'lib/onesignal/models/notification.rb', line 122 def web_url @web_url end |
#wp_wns_sound ⇒ Object
Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: "notification.wav"
223 224 225 |
# File 'lib/onesignal/models/notification.rb', line 223 def wp_wns_sound @wp_wns_sound end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
465 466 467 |
# File 'lib/onesignal/models/notification.rb', line 465 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 |
# File 'lib/onesignal/models/notification.rb', line 352 def self.attribute_map { :'included_segments' => :'included_segments', :'excluded_segments' => :'excluded_segments', :'include_player_ids' => :'include_player_ids', :'include_external_user_ids' => :'include_external_user_ids', :'include_email_tokens' => :'include_email_tokens', :'include_phone_numbers' => :'include_phone_numbers', :'include_ios_tokens' => :'include_ios_tokens', :'include_wp_wns_uris' => :'include_wp_wns_uris', :'include_amazon_reg_ids' => :'include_amazon_reg_ids', :'include_chrome_reg_ids' => :'include_chrome_reg_ids', :'include_chrome_web_reg_ids' => :'include_chrome_web_reg_ids', :'include_android_reg_ids' => :'include_android_reg_ids', :'include_aliases' => :'include_aliases', :'target_channel' => :'target_channel', :'id' => :'id', :'value' => :'value', :'name' => :'name', :'aggregation' => :'aggregation', :'is_ios' => :'isIos', :'is_android' => :'isAndroid', :'is_huawei' => :'isHuawei', :'is_any_web' => :'isAnyWeb', :'is_chrome_web' => :'isChromeWeb', :'is_firefox' => :'isFirefox', :'is_safari' => :'isSafari', :'is_wp_wns' => :'isWP_WNS', :'is_adm' => :'isAdm', :'is_chrome' => :'isChrome', :'channel_for_external_user_ids' => :'channel_for_external_user_ids', :'app_id' => :'app_id', :'external_id' => :'external_id', :'contents' => :'contents', :'headings' => :'headings', :'subtitle' => :'subtitle', :'data' => :'data', :'huawei_msg_type' => :'huawei_msg_type', :'url' => :'url', :'web_url' => :'web_url', :'app_url' => :'app_url', :'ios_attachments' => :'ios_attachments', :'template_id' => :'template_id', :'content_available' => :'content_available', :'mutable_content' => :'mutable_content', :'target_content_identifier' => :'target_content_identifier', :'big_picture' => :'big_picture', :'huawei_big_picture' => :'huawei_big_picture', :'adm_big_picture' => :'adm_big_picture', :'chrome_big_picture' => :'chrome_big_picture', :'chrome_web_image' => :'chrome_web_image', :'buttons' => :'buttons', :'web_buttons' => :'web_buttons', :'ios_category' => :'ios_category', :'android_channel_id' => :'android_channel_id', :'huawei_channel_id' => :'huawei_channel_id', :'existing_android_channel_id' => :'existing_android_channel_id', :'huawei_existing_channel_id' => :'huawei_existing_channel_id', :'android_background_layout' => :'android_background_layout', :'small_icon' => :'small_icon', :'huawei_small_icon' => :'huawei_small_icon', :'large_icon' => :'large_icon', :'huawei_large_icon' => :'huawei_large_icon', :'adm_small_icon' => :'adm_small_icon', :'adm_large_icon' => :'adm_large_icon', :'chrome_web_icon' => :'chrome_web_icon', :'chrome_web_badge' => :'chrome_web_badge', :'firefox_icon' => :'firefox_icon', :'chrome_icon' => :'chrome_icon', :'ios_sound' => :'ios_sound', :'android_sound' => :'android_sound', :'huawei_sound' => :'huawei_sound', :'adm_sound' => :'adm_sound', :'wp_wns_sound' => :'wp_wns_sound', :'android_led_color' => :'android_led_color', :'huawei_led_color' => :'huawei_led_color', :'android_accent_color' => :'android_accent_color', :'huawei_accent_color' => :'huawei_accent_color', :'android_visibility' => :'android_visibility', :'huawei_visibility' => :'huawei_visibility', :'ios_badge_type' => :'ios_badgeType', :'ios_badge_count' => :'ios_badgeCount', :'collapse_id' => :'collapse_id', :'web_push_topic' => :'web_push_topic', :'apns_alert' => :'apns_alert', :'delayed_option' => :'delayed_option', :'delivery_time_of_day' => :'delivery_time_of_day', :'ttl' => :'ttl', :'priority' => :'priority', :'apns_push_type_override' => :'apns_push_type_override', :'throttle_rate_per_minute' => :'throttle_rate_per_minute', :'android_group' => :'android_group', :'android_group_message' => :'android_group_message', :'adm_group' => :'adm_group', :'adm_group_message' => :'adm_group_message', :'thread_id' => :'thread_id', :'summary_arg' => :'summary_arg', :'summary_arg_count' => :'summary_arg_count', :'email_subject' => :'email_subject', :'email_body' => :'email_body', :'email_from_name' => :'email_from_name', :'email_from_address' => :'email_from_address', :'email_preheader' => :'email_preheader', :'include_unsubscribed' => :'include_unsubscribed', :'sms_from' => :'sms_from', :'sms_media_urls' => :'sms_media_urls', :'filters' => :'filters', :'custom_data' => :'custom_data', :'send_after' => :'send_after' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
1324 1325 1326 |
# File 'lib/onesignal/models/notification.rb', line 1324 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
670 671 672 673 674 675 |
# File 'lib/onesignal/models/notification.rb', line 670 def self.openapi_all_of [ :'BasicNotification', :'NotificationAllOf' ] end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 |
# File 'lib/onesignal/models/notification.rb', line 583 def self.openapi_nullable Set.new([ :'include_player_ids', :'include_external_user_ids', :'include_aliases', :'name', :'is_ios', :'is_android', :'is_huawei', :'is_any_web', :'is_chrome_web', :'is_firefox', :'is_safari', :'is_wp_wns', :'is_adm', :'is_chrome', :'external_id', :'contents', :'headings', :'subtitle', :'data', :'huawei_msg_type', :'url', :'web_url', :'app_url', :'ios_attachments', :'template_id', :'content_available', :'target_content_identifier', :'big_picture', :'huawei_big_picture', :'adm_big_picture', :'chrome_big_picture', :'chrome_web_image', :'buttons', :'web_buttons', :'ios_category', :'huawei_channel_id', :'huawei_existing_channel_id', :'small_icon', :'huawei_small_icon', :'large_icon', :'huawei_large_icon', :'adm_small_icon', :'adm_large_icon', :'chrome_web_icon', :'chrome_web_badge', :'firefox_icon', :'chrome_icon', :'ios_sound', :'android_sound', :'huawei_sound', :'adm_sound', :'wp_wns_sound', :'android_led_color', :'huawei_led_color', :'android_accent_color', :'huawei_accent_color', :'android_visibility', :'huawei_visibility', :'ios_badge_type', :'ios_badge_count', :'web_push_topic', :'apns_alert', :'delayed_option', :'delivery_time_of_day', :'ttl', :'priority', :'throttle_rate_per_minute', :'android_group', :'android_group_message', :'adm_group', :'adm_group_message', :'thread_id', :'email_subject', :'email_from_name', :'email_from_address', :'email_preheader', :'sms_from', :'sms_media_urls', :'filters', :'custom_data', :'send_after' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 |
# File 'lib/onesignal/models/notification.rb', line 470 def self.openapi_types { :'included_segments' => :'Array<String>', :'excluded_segments' => :'Array<String>', :'include_player_ids' => :'Array<String>', :'include_external_user_ids' => :'Array<String>', :'include_email_tokens' => :'Array<String>', :'include_phone_numbers' => :'Array<String>', :'include_ios_tokens' => :'Array<String>', :'include_wp_wns_uris' => :'Array<String>', :'include_amazon_reg_ids' => :'Array<String>', :'include_chrome_reg_ids' => :'Array<String>', :'include_chrome_web_reg_ids' => :'Array<String>', :'include_android_reg_ids' => :'Array<String>', :'include_aliases' => :'PlayerNotificationTargetIncludeAliases', :'target_channel' => :'String', :'id' => :'String', :'value' => :'Integer', :'name' => :'String', :'aggregation' => :'String', :'is_ios' => :'Boolean', :'is_android' => :'Boolean', :'is_huawei' => :'Boolean', :'is_any_web' => :'Boolean', :'is_chrome_web' => :'Boolean', :'is_firefox' => :'Boolean', :'is_safari' => :'Boolean', :'is_wp_wns' => :'Boolean', :'is_adm' => :'Boolean', :'is_chrome' => :'Boolean', :'channel_for_external_user_ids' => :'String', :'app_id' => :'String', :'external_id' => :'String', :'contents' => :'StringMap', :'headings' => :'StringMap', :'subtitle' => :'StringMap', :'data' => :'Object', :'huawei_msg_type' => :'String', :'url' => :'String', :'web_url' => :'String', :'app_url' => :'String', :'ios_attachments' => :'Object', :'template_id' => :'String', :'content_available' => :'Boolean', :'mutable_content' => :'Boolean', :'target_content_identifier' => :'String', :'big_picture' => :'String', :'huawei_big_picture' => :'String', :'adm_big_picture' => :'String', :'chrome_big_picture' => :'String', :'chrome_web_image' => :'String', :'buttons' => :'Array<Button>', :'web_buttons' => :'Array<Button>', :'ios_category' => :'String', :'android_channel_id' => :'String', :'huawei_channel_id' => :'String', :'existing_android_channel_id' => :'String', :'huawei_existing_channel_id' => :'String', :'android_background_layout' => :'BasicNotificationAllOfAndroidBackgroundLayout', :'small_icon' => :'String', :'huawei_small_icon' => :'String', :'large_icon' => :'String', :'huawei_large_icon' => :'String', :'adm_small_icon' => :'String', :'adm_large_icon' => :'String', :'chrome_web_icon' => :'String', :'chrome_web_badge' => :'String', :'firefox_icon' => :'String', :'chrome_icon' => :'String', :'ios_sound' => :'String', :'android_sound' => :'String', :'huawei_sound' => :'String', :'adm_sound' => :'String', :'wp_wns_sound' => :'String', :'android_led_color' => :'String', :'huawei_led_color' => :'String', :'android_accent_color' => :'String', :'huawei_accent_color' => :'String', :'android_visibility' => :'Integer', :'huawei_visibility' => :'Integer', :'ios_badge_type' => :'String', :'ios_badge_count' => :'Integer', :'collapse_id' => :'String', :'web_push_topic' => :'String', :'apns_alert' => :'Object', :'delayed_option' => :'String', :'delivery_time_of_day' => :'String', :'ttl' => :'Integer', :'priority' => :'Integer', :'apns_push_type_override' => :'String', :'throttle_rate_per_minute' => :'String', :'android_group' => :'String', :'android_group_message' => :'String', :'adm_group' => :'String', :'adm_group_message' => :'Object', :'thread_id' => :'String', :'summary_arg' => :'String', :'summary_arg_count' => :'Integer', :'email_subject' => :'String', :'email_body' => :'String', :'email_from_name' => :'String', :'email_from_address' => :'String', :'email_preheader' => :'String', :'include_unsubscribed' => :'Boolean', :'sms_from' => :'String', :'sms_media_urls' => :'Array<String>', :'filters' => :'Array<Filter>', :'custom_data' => :'Object', :'send_after' => :'Time' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 |
# File 'lib/onesignal/models/notification.rb', line 1197 def ==(o) return true if self.equal?(o) self.class == o.class && included_segments == o.included_segments && excluded_segments == o.excluded_segments && include_player_ids == o.include_player_ids && include_external_user_ids == o.include_external_user_ids && include_email_tokens == o.include_email_tokens && include_phone_numbers == o.include_phone_numbers && include_ios_tokens == o.include_ios_tokens && include_wp_wns_uris == o.include_wp_wns_uris && include_amazon_reg_ids == o.include_amazon_reg_ids && include_chrome_reg_ids == o.include_chrome_reg_ids && include_chrome_web_reg_ids == o.include_chrome_web_reg_ids && include_android_reg_ids == o.include_android_reg_ids && include_aliases == o.include_aliases && target_channel == o.target_channel && id == o.id && value == o.value && name == o.name && aggregation == o.aggregation && is_ios == o.is_ios && is_android == o.is_android && is_huawei == o.is_huawei && is_any_web == o.is_any_web && is_chrome_web == o.is_chrome_web && is_firefox == o.is_firefox && is_safari == o.is_safari && is_wp_wns == o.is_wp_wns && is_adm == o.is_adm && is_chrome == o.is_chrome && channel_for_external_user_ids == o.channel_for_external_user_ids && app_id == o.app_id && external_id == o.external_id && contents == o.contents && headings == o.headings && subtitle == o.subtitle && data == o.data && huawei_msg_type == o.huawei_msg_type && url == o.url && web_url == o.web_url && app_url == o.app_url && == o. && template_id == o.template_id && content_available == o.content_available && mutable_content == o.mutable_content && target_content_identifier == o.target_content_identifier && big_picture == o.big_picture && huawei_big_picture == o.huawei_big_picture && adm_big_picture == o.adm_big_picture && chrome_big_picture == o.chrome_big_picture && chrome_web_image == o.chrome_web_image && == o. && == o. && ios_category == o.ios_category && android_channel_id == o.android_channel_id && huawei_channel_id == o.huawei_channel_id && existing_android_channel_id == o.existing_android_channel_id && huawei_existing_channel_id == o.huawei_existing_channel_id && android_background_layout == o.android_background_layout && small_icon == o.small_icon && huawei_small_icon == o.huawei_small_icon && large_icon == o.large_icon && huawei_large_icon == o.huawei_large_icon && adm_small_icon == o.adm_small_icon && adm_large_icon == o.adm_large_icon && chrome_web_icon == o.chrome_web_icon && chrome_web_badge == o.chrome_web_badge && firefox_icon == o.firefox_icon && chrome_icon == o.chrome_icon && ios_sound == o.ios_sound && android_sound == o.android_sound && huawei_sound == o.huawei_sound && adm_sound == o.adm_sound && wp_wns_sound == o.wp_wns_sound && android_led_color == o.android_led_color && huawei_led_color == o.huawei_led_color && android_accent_color == o.android_accent_color && huawei_accent_color == o.huawei_accent_color && android_visibility == o.android_visibility && huawei_visibility == o.huawei_visibility && ios_badge_type == o.ios_badge_type && ios_badge_count == o.ios_badge_count && collapse_id == o.collapse_id && web_push_topic == o.web_push_topic && apns_alert == o.apns_alert && delayed_option == o.delayed_option && delivery_time_of_day == o.delivery_time_of_day && ttl == o.ttl && priority == o.priority && apns_push_type_override == o.apns_push_type_override && throttle_rate_per_minute == o.throttle_rate_per_minute && android_group == o.android_group && == o. && adm_group == o.adm_group && == o. && thread_id == o.thread_id && summary_arg == o.summary_arg && summary_arg_count == o.summary_arg_count && email_subject == o.email_subject && email_body == o.email_body && email_from_name == o.email_from_name && email_from_address == o.email_from_address && email_preheader == o.email_preheader && include_unsubscribed == o.include_unsubscribed && sms_from == o.sms_from && sms_media_urls == o.sms_media_urls && filters == o.filters && custom_data == o.custom_data && send_after == o.send_after end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 |
# File 'lib/onesignal/models/notification.rb', line 1355 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = OneSignal.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 |
# File 'lib/onesignal/models/notification.rb', line 1426 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 |
# File 'lib/onesignal/models/notification.rb', line 1331 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
1311 1312 1313 |
# File 'lib/onesignal/models/notification.rb', line 1311 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
1317 1318 1319 |
# File 'lib/onesignal/models/notification.rb', line 1317 def hash [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, , template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, , , ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, , adm_group, , thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, email_preheader, include_unsubscribed, sms_from, sms_media_urls, filters, custom_data, send_after].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
1155 1156 1157 1158 1159 1160 1161 1162 |
# File 'lib/onesignal/models/notification.rb', line 1155 def list_invalid_properties invalid_properties = Array.new if @app_id.nil? invalid_properties.push('invalid value for "app_id", app_id cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
1402 1403 1404 |
# File 'lib/onesignal/models/notification.rb', line 1402 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 |
# File 'lib/onesignal/models/notification.rb', line 1408 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
1396 1397 1398 |
# File 'lib/onesignal/models/notification.rb', line 1396 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
1166 1167 1168 1169 1170 1171 1172 1173 |
# File 'lib/onesignal/models/notification.rb', line 1166 def valid? target_channel_validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) return false unless target_channel_validator.valid?(@target_channel) aggregation_validator = EnumAttributeValidator.new('String', ["sum", "count"]) return false unless aggregation_validator.valid?(@aggregation) return false if @app_id.nil? true end |