AWS IoT device is not getting message published by iOS app

So I am building an iOS app that can communicate with a device via AWS IoT. both the device and the app are subscribed to the update/accepted, get/accepted and update/delta. I can publish updates from either side, and the update is reflected on AWS IoT thing shadow, but somehow the update was never relayed from one device to another. So if I press send on the app the update will be shown on AWS IoT, but the device that is supposedly subscribed to the topics never seem to receive such update, and vice versa. Below is the cod snippet on the device side.

# For certificate based connection
myShadowClient = AWSIoTMQTTShadowClient("myDevice")
myShadowClient.configureEndpoint("xxxxxxxxx.iot.us-east-1.amazonaws.com", 8883)
myShadowClient.configureCredentials("certs/root-CA.crt", "certs/private.pem.key", "certs/certificate.pem.crt")
myShadowClient.configureConnectDisconnectTimeout(10)  # 10 sec
myShadowClient.configureMQTTOperationTimeout(5)  # 5 sec


# Custom MQTT message callback
def customCallback(client, userdata, message):
    print("Received a new message: ")
    print(message.payload)
    print("from topic: ")
    print(message.topic)
    print("--------------\n\n")

# Custom Shadow callback
def customShadowCallback_Update(payload, responseStatus, token):
    # payload is a JSON string ready to be parsed using json.loads(...)
    # in both Py2.x and Py3.x
    if responseStatus == "timeout":
        print("Update request " + token + " time out!")
    if responseStatus == "accepted":
        payloadDict = json.loads(payload)
        print("~~~~~~~~~~~~~~~~~~~~~~~")
        print("Update request with token: " + token + " accepted!")
        print("property: " + str(payloadDict["state"]["desired"]["property"]))
        print("~~~~~~~~~~~~~~~~~~~~~~~\n\n")
    if responseStatus == "rejected":
        print("Update request " + token + " rejected!")

def customShadowCallback_Delete(payload, responseStatus, token):
    if responseStatus == "timeout":
        print("Delete request " + token + " time out!")
    if responseStatus == "accepted":
        print("~~~~~~~~~~~~~~~~~~~~~~~")
        print("Delete request with token: " + token + " accepted!")
        print("~~~~~~~~~~~~~~~~~~~~~~~\n\n")
    if responseStatus == "rejected":
        print("Delete request " + token + " rejected!")

#MQTT Operations
JSONPayload = '{"state":{"reported":{"property": "published from Device"}}}'


myShadowClient.connect()
myMQTTClient = myShadowClient.getMQTTConnection()

# AWSIoTMQTTClient connection configuration
myMQTTClient.configureAutoReconnectBackoffTime(1, 32, 20)
myMQTTClient.configureOfflinePublishQueueing(-1)  # Infinite offline Publish queueing
myMQTTClient.configureDrainingFrequency(2)  # Draining: 2 Hz
myMQTTClient.configureConnectDisconnectTimeout(10)  # 10 sec
myMQTTClient.configureMQTTOperationTimeout(5)  # 5 sec

myMQTTClient.publish("$aws/things/myDevice/shadow/update", JSONPayload, 1)
myMQTTClient.publish("$aws/things/myDevice/shadow/get", "", 1)
myMQTTClient.subscribe("$aws/things/myDevice/shadow/update/accepted", 1, customCallback)
myMQTTClient.subscribe("$aws/things/myDevice/shadow/update/rejected", 1, customCallback)

myMQTTClient.subscribe("$aws/things/myDevice/shadow/get/accepted", 1, customCallback)
myMQTTClient.subscribe("$aws/things/myDevice/shadow/get/rejected", 1, customCallback)
myMQTTClient.subscribe("$aws/things/myDevice/shadow/update/delta", 1, customCallback)


# Create a device shadow instance using persistent subscription

myDeviceShadow = myShadowClient.createShadowHandlerWithName("Bot", True)
while True:
    time.sleep(10)

Solution 1:

This is intended behavior. The explanation can be found here

Delta state is a virtual type of state that contains the difference between the desired and reported states. Fields in the desired section that are not in the reported section are included in the delta. Fields that are in the reported section and not in the desired section are not included in the delta.