No more than one component displaying, including the default components
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- swift, typescript
- 領域
- mobile-dev
調査の方向性
初回ビルド時の表示失敗とデータ更新失敗を再現し、その後、watchappApp.swift、AppDelegate.swift、およびレポートに示されている Watch.updateWatchUI と Watch.updateWatchData の呼び出しを調べます。デフォルトの Watch UI とカスタムの Watch UI の動作を比較し、報告されたデータ更新エラーを診断の出発点として使用します。すべての意図したコンポーネントが表示され、報告されたエラーなしで Watch データが更新されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
When I run the app for the first time after build, it only shows 'Capacitor WATCH' - no button. and when i update the ui with my own items, it only displays the first item in the list.
Here's my .tsx:
const [t1, setT1] = useState("");
async function uploadWatchUI1() {
const watchUI = `Text("Capacitor n")
Button("Add One", "inc")`;
await Watch.updateWatchUI({ watchUI: watchUI });
}
async function updateData1() {
var stateData = {
variable: "data1",
};
await Watch.updateWatchData({ data: stateData });
}
async function updateData2() {
var stateData = {
variable: "data2",
};
await Watch.updateWatchData({ data: stateData });
}
useEffect(() => {
Watch.addListener("runCommand", (data: { command: string }) => {
console.log("PHONE got command - " + data.command);
setT1(`Button was Pressed: ${data.command}`);
});
});
watchappApp.swift:
import SwiftUI
import WatchConnectivity
import iOS_capWatch_watch
@main
struct watchddgg_Watch_AppApp: App {
var body: some Scene {
WindowGroup {
CapWatchContentView()
.onAppear {
assert(WCSession.isSupported(), "This sample requires Watch Connectivity support!")
WCSession.default.delegate = WatchViewModel.shared
WCSession.default.activate()
}
}
}
}
AppDelegate.swift:
import UIKit
import Capacitor
import WatchConnectivity
import CapacitorWatch
import CapacitorBackgroundRunner
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
assert(WCSession.isSupported(), "This sample requires Watch Connectivity support!")
WCSession.default.delegate = CapWatchSessionDelegate.shared
WCSession.default.activate()
BackgroundRunnerPlugin.registerBackgroundTask()
BackgroundRunnerPlugin.handleApplicationDidFinishLaunching(launchOptions: launchOptions)
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
// Called when the app was launched with a url. Feel free to add additional processing here,
// but if you want the App API to support tracking app url opens, make sure to keep this call
return ApplicationDelegateProxy.shared.application(app, open: url, options: options)
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
// Called when the app was launched with an activity, including Universal Links.
// Feel free to add additional processing here, but if you want the App API to support
// tracking app url opens, make sure to keep this call
return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler)
}
}
I have iOS-capWatch-watch added under Frameworks, Libraries, and Embedded Content:
Here's the error I get when I update the watch data:
- 主要言語
- Swift
- スター
- 49
- フォーク
- 11
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ionic-team/CapacitorWatch のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
ionic-team/CapacitorWatch#45 ·
-
Capacitor 8オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
ionic-team/CapacitorWatch#46 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
ionic-team/CapacitorWatch#41 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
ionic-team/CapacitorWatch#40 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
ionic-team/CapacitorWatch#39 ·
ionic-team/CapacitorWatch の issue をすべて見る
似ている issue
-
product / auth product / console product / databases product / messaging product / self-hosted product / sites product / storage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
binding:web core docs p3
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
RunanywhereAI/runanywhere-sdks#1123 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
Countly/countly-sdk-ios#485 ·
メンテナーはふだん 1 日以内に返信
-
area:ui enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
s3onghyun/bulchimbeon#22 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信