Skip to content

APNSMessage#collapse_id parameter rejected in create_campaign despite being documentedΒ #3324

@Migoo

Description

@Migoo

Describe the bug

When using Aws::Pinpoint::Client#create_campaign with an apns_message containing collapse_id, the SDK raises an ArgumentError even though collapse_id is a documented parameter for APNSMessage.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

The collapse_id parameter should be accepted and passed to the Pinpoint API, which would then set the apns-collapse-id header when sending the push notification to APNs.

Current Behavior

The SDK raises an ArgumentError before making the API call:

unexpected value at params[:write_campaign_request][:message_configuration][:apns_message][:collapse_id] (ArgumentError)
    raise ArgumentError, error_messages(errors) unless errors.empty?

Reproduction Steps

require 'aws-sdk-pinpoint'

client = Aws::Pinpoint::Client.new(region: 'eu-west-1')

client.create_campaign({
  application_id: "my-app-id",
  write_campaign_request: {
    name: "test",
    segment_id: "my-segment-id",
    message_configuration: {
      apns_message: {
        action: "OPEN_APP",
        silent_push: false,
        raw_content: '{"aps":{"alert":{"title":"Test","body":"Test body"}}}',
        collapse_id: "offer-85817"
      }
    },
    schedule: {
      start_time: "IMMEDIATE"
    }
  }
})

Possible Solution

No response

Additional Information/Context

The CollapseId parameter is documented in the AWS Pinpoint API reference for APNSMessage
The collapse_id parameter works correctly with send_messages endpoint
The parameter is essential for iOS notification grouping/replacement via the apns-collapse-id APNs header

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-pinpoint 1.116.0

Environment details (Version of Ruby, OS environment)

ruby 3.4.7, multiple env (osX, linux)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.investigatingIssue is being investigated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions