Basically i had an existing project developed using swift 5. I integrated watch app, and developed it using swift UI. Now i have followed all the required steps , even followed apple documentation, but i am getting connectivity issues between my watch app and ios app.I have created the session successfully , when i send a message form watch app to ios app, it send successfully , but when i send a message from ios app to watch app, i get the error "WCSession counterpart app not installed". I have verified and cross checked all the below items
- bundle identifiers are correctly placed
- Supports running without IOS App installation is also unchecked.
- Session is activated successfully
- I am activating the session in App delegate in applicationDidFinishLaunchingWithOptions on IOS App and in onAppear function of my watch app main class
I have even tried creating a new project with the same configurations like my main project, i created a dummy app using swift and added a Swift UI watch extension just like i did in my main project. The catch is i am not facing any connectivity issue in this dummy app, watch and ios app are communicating perfectly, i can receive the message successfully on both the devices using the same lines of code which i use ion my main project.
I would really appreciate if someone can help me in this, i have tried almost all the solutions and wasted almost a month on this issue.
I have attached my WCSession Manager code
Here are the snippets of my code App Delegate
WatchSessionManager.sharedManager.startSession()
Watch App
import SwiftUI
@main
struct AmbitBoxApp: App {
@SceneBuilder var body: some Scene {
WindowGroup {
NavigationView {
HomeView()
}
.onAppear {
WatchSessionManager.sharedManager.startSession()
}
}
WKNotificationScene(controller: NotificationController.self, category: "myCategory")
}
}