aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.59k stars 1.55k forks source link

Pinpoint SMS Message with URL Isn't Actually Sent(Received by phone) #4334

Closed mjmostachetti closed 1 month ago

mjmostachetti commented 1 year ago

Describe the bug

I can send messages via the Pinpoint SMS without a problem if there is no https:// url in the text message. It even works just fine with a custom scheme(fakeScheme://). I'm trying to setup some deep linking messages on Android, which requires an https url, but these texts are not received by the phones. Is this expected? Am I missing something/configuration within pinpoint, or is this a bug?

Expected Behavior

I can send text messages with valid https:// urls in the message and it be received by the phone.

Current Behavior

I get this response, even though the message never gets to my phone.

{
    "MessageResponse": {
        "ApplicationId": "34740ce3c47e44d2adc7bfbd7fa3a9b8",
        "RequestId": "145d4e31-0c93-4a69-a5b5-c27fbb477ef5",
        "Result": {
            "myvalidnumber": {
                "DeliveryStatus": "SUCCESSFUL",
                "MessageId": "q9r65afkslog0pbpk248c1tto0d89d5poq1hj5o0",
                "StatusCode": 200,
                "StatusMessage": "MessageId: q9r65afkslog0pbpk248c1tto0d89d5poq1hj5o0"
            }
        }
    }
}

Reproduction Steps

var message = "Hello, please go to this link - https://environment.fjasdfaklsjdfasd.amplifyapp.com/blah/blah";

 const params = {
      ApplicationId: applicationId,
      MessageRequest: {
        Addresses: {
          [phoneNumber]: {
            ChannelType: "SMS",
          },
        },
        MessageConfiguration: {
          SMSMessage: {
            Body: message,
            Keyword: registeredKeyword,
            MessageType: "TRANSACTIONAL",
            OriginationNumber: originationNumber,
            SenderId: senderId,
          },
        },
      },
    };

pinpoint.sendMessages(params, function (err, data) {
      if (err) {
        console.log(`ERROR : ${JSON.stringify(err)}`);
        reject(err);
      } else {
        console.log(`SUCCESS : ${JSON.stringify(data)}`);
        resolve();
      }
    });

Possible Solution

No response

Additional Information/Context

No response

SDK version used

^2.1264.0

Environment details (OS name and version, etc.)

Node AWS Lambda

RanVaknin commented 1 year ago

Hi @mjmostachetti ,

While we try to reproduce this, can you please check out this troubleshooting guide? I would also check against a different phone on a different network, and check your spam folder for auto-screened messages.

Maybe the carrier blocks incoming messages with hyperlinks in them as a security measure against phishing attacks and marketing campaigns?

Thanks, Ran~

CayneBartoo commented 11 months ago

I am experiencing something similar, is this still an issue?

mjmostachetti commented 11 months ago

We stopped trying this and resorted to sending emails with the url instead.

On Thu, Sep 14, 2023 at 10:15 PM CayneBartoo @.***> wrote:

I am experiencing something similar, is this still an issue?

— Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-js/issues/4334#issuecomment-1720689693, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRPWL6AQVB6YS2YB472YX3X2PQARANCNFSM6AAAAAAUQYMEPY . You are receiving this because you were mentioned.Message ID: @.***>

mjmostachetti commented 10 months ago

@RanVaknin Do you have any documentation or info about this? How does AWS assign a phone number to send from in Pinpoint? It seems like there's an issue there or however carriers allow/block numbers from sending content. I just tried out a trial Twilio account, and I can send links through their API without any issues to my phone. The Twilio number is toll-free, just like the AWS phone number.

RanVaknin commented 1 month ago

Hi there,

This is definitely not an SDK issue, since the entity that sends the SMS is the Pinpoint backend API. The reason the messages with URL are not sent might be a reason with Pinpoint, or more likely with the network carrier receiving the message.

From the docs:

Don't use shortened URLs created from third-party URL shorteners, as these messages are more likely to be filtered as spam. If you want to use a shortened URL, use a 10LDC phone number or short code. Using either of these number types requires that you register your message template, which can then include a shortened URL in the message.

Carriers automatically profile and block suspicious senders on your behalf. Depending on your carrier, the type of virtual number, the content of your message you might be flagged and messages containing URLs might not appear (worth checking your phone's spam folder if one exists).

When you get the response back from sending the SendMessages API request, you can take the provided RequestID field, and file a support ticket to AWS internal support using the developer console. Those will end up with the Pinpoint team and they can investigate whether there's a specific issue with the contents of your request, or if the carrier is the one blocking the SMS message from being received. Also at least for the US, major carriers would let you see all the text messages your phone received and sent (not the contents, but the count and timeline) you might want to cross reference to see if the message actually makes it to the provider but perhaps blocked by your device.

Since this is not an issue with the SDK, and not actionable by the SDK team, I'm going to close this issue. Thanks, Ran~

mjmostachetti commented 1 month ago

Sounds good. We switched to twilio and haven’t had any problems since.

On Fri, Jul 19, 2024 at 1:48 PM Ran Vaknin @.***> wrote:

Hi there,

This is definitely not an SDK issue, since the entity that sends the SMS is the Pinpoint backend API. The reason the messages with URL are not sent might be a reason with Pinpoint, or more likely with the network carrier receiving the message.

From the docs:

Don't use shortened URLs created from third-party URL shorteners, as these messages are more likely to be filtered as spam. If you want to use a shortened URL, use a 10LDC phone number or short code. Using either of these number types requires that you register your message template, which can then include a shortened URL in the message.

Carriers automatically profile and block suspicious senders on your behalf. Depending on your carrier, the type of virtual number, the content of your message you might be flagged and messages containing URLs might not appear (worth checking your phone's spam folder if one exists).

When you get the response back from sending the SendMessages API request, you can take the provided RequestID field, and file a support ticket to AWS internal support using the developer console. Those will end up with the Pinpoint team and they can investigate whether there's a specific issue with the contents of your request, or if the carrier is the one blocking the SMS message from being received. Also at least for the US, major carriers would let you see all the text messages your phone received and sent (not the contents, but the count and timeline) you might want to cross reference to see if the message actually makes it to the provider but perhaps blocked by your device.

Since this is not an issue with the SDK, and not actionable by the SDK team, I'm going to close this issue. Thanks, Ran~

— Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-js/issues/4334#issuecomment-2240083400, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRPWLYC4QW5MAIVCREJJZLZNF3R5AVCNFSM6AAAAABLFHCD6CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBQGA4DGNBQGA . You are receiving this because you were mentioned.Message ID: @.***>