Using SNS service from the AWS SDK for JavaScript v3 in React Native
When I try to create an endpoint (or execute really any command through AWS) I'm getting this error URL.hostname is not implemented
- I tried a number of other commands; same error
- The only thing I've done that yields a different error is if I remove
region
from the params when creating the client. Then it errorsRegion is missing
in the same place. But worth noting, if I just pass nonsense (asdf123
) for region it yields this same URL.hostname error
import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity";
import { fromCognitoIdentityPool } from "@aws-sdk/credential-provider-cognito-identity";
import { SNSClient, CreatePlatformEndpointCommand } from "@aws-sdk/client-sns";
const region = 'us-west-2'
const sns = new SNSClient({
region: region,
credentials: fromCognitoIdentityPool({
client: new CognitoIdentityClient({ region }),
identityPoolId: identityPoolId,
}) /// doesn't matter whether I pass credentials or not, same result
});
const params = {
PlatformApplicationArn: platformApplicationArn,
Token: token
}
const command = new CreatePlatformEndpointCommand(params);
const res = await sns.send(command)
.catch((err) => {
console.log(err) //// this is the "[Error: not implemented]"
throw err
})
This is saying I should have more data in this error but the only thing in this error is the message. https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sns/index.html#troubleshooting
Seems like this isn't even an AWS error...but I have no idea how to troubleshoot further.
Any suggestions on how to identify where this is coming from would be SUPER APPRECIATED. Thanks all