2014-07-23 3 views
2

aws sns에 대해 ruby의 sdk를 사용하여 끝점으로 메시지를 게시하려고합니다. 문서에서는 TTL을 메시지 속성에 추가 할 수 있다고 제안합니다. 그러나 다음 코드는 예외 오류 예외를 제공합니다.Ruby AWS SNS SDK : 예기치 않은 옵션 message_attributes

# ArgumentError: 
# unexpected option message_attributes 

@client.publish(:target_arn => endpoint_arn, 
    :subject => title, 
    :message_structure => "json", 
    :message => get_message(title, message).to_json, 
    :message_attributes => { 
     "AWS.SNS.MOBILE.APNS.TTL" => { 
     :data_type => "String", 
     :string_value => TTL_SECONDS 
     } 
    } 

답변

2

이 옵션은 이전 버전의 API에서는 사용할 수 없습니다. 최신 버전 (1.48.1)으로 업그레이드하면 문제가 해결됩니다.