@@ -381,17 +381,13 @@ class AndroidClickAction(object):
381
381
1: to specific activity of application
382
382
2: specific URL
383
383
3: to specific application
384
- rich_resource: rich_resource of the android.notification (optional).
385
384
"""
386
- def __init__ (self , action_type = None , intent = None , action = None , url = None , rich_resource = None ):
387
- MessageValidator .check_click_action (action_type = action_type , intent = intent , action = action , url = url ,
388
- rich_resource = rich_resource )
385
+ def __init__ (self , action_type = None , intent = None , action = None , url = None ):
386
+ MessageValidator .check_click_action (action_type = action_type , intent = intent , action = action , url = url )
389
387
self .action_type = action_type
390
388
self .intent = intent
391
389
self .action = action
392
390
self .url = url
393
- self .rich_resource = rich_resource
394
-
395
391
396
392
class AndroidBadgeNotification (object ):
397
393
"""A BadgeNotification that can be included in a message.android.notification.
@@ -736,12 +732,6 @@ def check_android(cls, title, body, icon, color, sound, default_sound, tag, clic
736
732
raise ValueError ('AndroidNotification.big_title must be valid string when style is 1' )
737
733
if (big_body is None ) and (not isinstance (big_body , str )):
738
734
raise ValueError ('AndroidNotification.big_body must be valid string when style is 1' )
739
- # # big_picture
740
- # if style == 2:
741
- # if (big_picture is None) or (not isinstance(big_picture, str)):
742
- # raise ValueError('AndroidNotification.big_picture must be valid string when style is 2')
743
- # if not big_picture.upper().startswith('HTTPS'):
744
- # raise ValueError('AndroidNotification.big_picture must be valid https url address when type is 2')
745
735
# auto_clear
746
736
cls .check_number (label = 'AndroidNotification.auto_clear ' , value = auto_clear )
747
737
# notify_id
@@ -786,7 +776,7 @@ def check_badge_notification(cls, add_num, set_num, clazz):
786
776
cls .check_string (hint = "AndroidBadgeNotification.clazz" , value = clazz )
787
777
788
778
@classmethod
789
- def check_click_action (cls , action_type , intent , action , url , rich_resource ):
779
+ def check_click_action (cls , action_type , intent , action , url ):
790
780
# type must be in [1, 4]
791
781
if (action_type is None ) or (action_type not in [1 , 2 , 3 , 4 ]):
792
782
raise ValueError ('ClickAction.type must be in [1, 2, 3, 4]' )
@@ -804,13 +794,6 @@ def check_click_action(cls, action_type, intent, action, url, rich_resource):
804
794
if not url .upper ().startswith ('HTTPS' ):
805
795
raise ValueError ('ClickAction.url must be https prefix when ClickAction.type is 2' )
806
796
807
- # rich_resource, if type is 4, rich_resource must
808
- if action_type == 4 :
809
- if not isinstance (rich_resource , str ):
810
- raise ValueError ('ClickAction.rich_resource must when ClickAction.type is 4' )
811
- if not rich_resource .upper ().startswith ('HTTPS' ):
812
- raise ValueError ('ClickAction.rich_resource must be https prefix when ClickAction.type is 4' )
813
-
814
797
@classmethod
815
798
def check_light_settings (cls , color , light_on_duration , light_off_duration ):
816
799
cls .check_type (color , AndroidLightSettingsColor , "color must be an instance of AndroidLightSettingsColor" )
0 commit comments