App group not working between iOS and watchOS

Hi everyone, I'm using an app group to share data between iOS and it's watch companion app. I ensured that is has the same identifier in Signing & Capabilities and in the .entitlements files. Here is the UserDefaults part:

class UserDefaultsManager {

private let suitName = "group.com.sanjeevbalakrishnan.Test"

public func saveItems(_ items: [ItemDTO]) {
    print("Save \(items.count) items to shared defaults")
    let defaults = UserDefaults(suiteName: suitName)
    let data = try? JSONEncoder().encode(items)
    defaults?.set(data, forKey: "items")        
}

public func loadItems() -> [ItemDTO] {
    let defaults = UserDefaults(suiteName: suitName)
    print(defaults)
    guard let data = defaults?.data(forKey: "items") else {
        print("watchOS received data is empty")
        return []
    }
    
    let items = [ItemDTO].from(data: data)
    print("Load \(items.count) items from user defaults")
    return items
}

}

For testing I called loadItems after saveItems on iOS app and it returned items. However, on watchOS app it always returns empty array. What do I need to consider? Thanks.

Best regards Sanjeev

App group not working between iOS and watchOS
 
 
Q