Skip to content

Return nextToken in subscriber list methods

Choose a tag to compare

@chrisbarr chrisbarr released this 06 Apr 14:27
· 8 commits to master since this release

Previously the listSubscriptions and listSubscriptionsByTopic methods had no way of returning a nextToken if one existed. Now the method returns an array of members and nextToken elements like so:

$result = $sns->listSubscriptions();

print_r($result);
/*
Array
(
    [members] => Array
        (
            [0] => Array
                (
                    [Owner] => ...
                    [Endpoint] => ...
                    [Protocol] => ...
                    [SubscriptionArn] => ...
                    [TopicArn] => ...
                )
        )

    [nextToken] => ... // This is only set if a nextToken was returned from Amazon
)
*/

// Fetch the next page of results
$sns->listSubscriptions($result['nextToken']);