0

I am using aws-amplify to get data from socket, here is my code, I got an error ---> Actually its working for below iOS 12 but not working for iOS 12.1.4

Possible Unhandled Promise Rejection (id: 1): Object { "errorCode": 7, "errorMessage": "AMQJS0007E Socket error:undefined.", "invocationContext": undefined, } Please help me out Thanks in advance

 import { PubSub } from 'aws-amplify';
 import { AWSIoTProvider } from 'aws-amplify/lib/PubSub/Providers';

 this.subscription = new AWSIoTProvider(this.iotConfig).subscribe(topic).subscribe({

        next: data => this._receiveGameState(data),
        error: error => console.log("Error: " + error),
        close: () => console.log('Done'),

      });
  • You are not really making use of `PubSub` of [Amplify](https://aws-amplify.github.io/docs/js/pubsub#working-with-the-api). Putting it aside, you may check your policy again if it allows access by some statement like `"Action": "iot:*"` – vahdet Feb 27 '19 at 11:48
  • Hi Vahdet, Actually its working for below iOS 12 but not working for iOS 12.1.4 – VinukondaPraveen Feb 27 '19 at 12:35
  • So, did you encounter this question then: https://stackoverflow.com/q/53675028/4636715 Looks similar to your case regarding the breaking-up with v12.1 there. – vahdet Feb 27 '19 at 12:45
  • Thank you so much, I will look into it. – VinukondaPraveen Feb 27 '19 at 13:26

1 Answers1

0

iOS 12.1.1 requires that publicly-trusted Transport Layer Security (TLS) server authentication certificates issued after October 15, 2018 meet the Certificate Transparency policy to be evaluated as trusted on Apple platforms.

This policy is becoming a widespread standard which Google already enforces in its Chrome browser. Amazon knew this was coming and, in response to these new policies, released updates to their MQTT backend (AWS IoT) to include appropriate certification on a new endpoint. See link

  • Have a look here https://stackoverflow.com/questions/61501005/can-not-connect-to-aws-amplify-pubsub-socket-errorundefined/61555722 – Thomas Dittmar May 02 '20 at 07:20