Code Monkey home page Code Monkey logo

Comments (12)

Rexios80 avatar Rexios80 commented on September 13, 2024

You create it the same way you would if your project was native. The watch connection can be weird in development. Are you running on simulators or physical devices?

from watch_connectivity.

rodydavis avatar rodydavis commented on September 13, 2024

The issue I found was with the latest version of XCode and how the Watchkit extension is a single target now.

I migrated the example and then had to copy the ios folder to my project to get it working (after changing the bundleID)

Now it is working great!

from watch_connectivity.

Rexios80 avatar Rexios80 commented on September 13, 2024

You couldn't just create a new watch target in your app and copy the code you need?

from watch_connectivity.

rodydavis avatar rodydavis commented on September 13, 2024

from watch_connectivity.

Rexios80 avatar Rexios80 commented on September 13, 2024

I recently created a flutter app and added a watch target to it. It worked fine. You're saying you couldn't run the phone app with the flutter run command?

from watch_connectivity.

mdikcinar avatar mdikcinar commented on September 13, 2024

@rodydavis Thanks a lot, i will try it in my first spare time.

@Rexios80 i created a new watch target but its not worked for me, then i tought this update may be cuase of this issue
https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes
Xcode 14 includes a default template for watchOS apps that combines the WatchKit App and WatchKit App Extension
targets into a single Watch App target, simplifying code, asset, and localization management. You can deploy single-target
watchOS apps to watchOS 7 and later. (83222217)

i am using simulators.

from watch_connectivity.

rodydavis avatar rodydavis commented on September 13, 2024

from watch_connectivity.

Rexios80 avatar Rexios80 commented on September 13, 2024

Is your flutter version up to date? There was an issue with running iOS apps with embedded watch apps.

from watch_connectivity.

Rexios80 avatar Rexios80 commented on September 13, 2024

If you haven't updated flutter since flutter/flutter#92294 got released then that's probably the issue

from watch_connectivity.

rodydavis avatar rodydavis commented on September 13, 2024

from watch_connectivity.

rodydavis avatar rodydavis commented on September 13, 2024

Ok sounds good!

from watch_connectivity.

mdikcinar avatar mdikcinar commented on September 13, 2024

I found the solution,
On XCode 14, after the create a watch app target. There are a few things we have to do.

First, we need to add our target as framework to runner target
Screenshot 2023-02-26 at 16 37 07

  1. Change the Watch app's bundle identifier with your app's bundle identifier prefix.

Screenshot 2023-02-26 at 16 39 37

  1. Fill WKCompanionAppBundleIdentifier with your app's bundle identifier on Watch app's info.plist

Screenshot 2023-02-26 at 16 39 51

  1. Then i copied WatchSessionDelegate and ContentView files to my Watch App. Everyting is worked well.

from watch_connectivity.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.