Skip to content

Commit 59a5e59

Browse files
authored
Merge pull request #12 from techjewel/master
return 'SubscriptionArn' from subscribe method
2 parents 26c7285 + 1ddfd18 commit 59a5e59

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/AmazonSNS.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,21 +385,21 @@ public function setTopicAttributes($topicArn, $attrName, $attrValue) {
385385
* @param string $topicArn
386386
* @param string $protocol - http/https/email/email-json/sms/sqs
387387
* @param string $endpoint
388-
* @return bool
388+
* @return string $SubscriptionArn
389389
* @throws InvalidArgumentException
390390
*/
391391
public function subscribe($topicArn, $protocol, $endpoint) {
392392
if(empty($topicArn) || empty($protocol) || empty($endpoint)) {
393393
throw new InvalidArgumentException('Must supply a TopicARN, Protocol and Endpoint to subscribe to a topic');
394394
}
395395

396-
$this->_request('Subscribe', array(
396+
$response = $this->_request('Subscribe', array(
397397
'TopicArn' => $topicArn,
398398
'Protocol' => $protocol,
399399
'Endpoint' => $endpoint
400400
));
401401

402-
return true;
402+
return strval($response->SubscribeResult->SubscriptionArn);
403403
}
404404

405405
/**

0 commit comments

Comments
 (0)