No more than one component displaying, including the default components
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- swift, typescript
- Área
- mobile-dev
Línea de trabajo
Reproduce los fallos de visualización y de actualización de datos de la primera compilación y, después, inspecciona watchappApp.swift, AppDelegate.swift y las llamadas a Watch.updateWatchUI y Watch.updateWatchData mostradas en el informe. Compara el comportamiento de la UI de Watch predeterminada y personalizada, y usa el error de actualización de datos informado como punto de partida para el diagnóstico. Se considera terminado cuando todos los componentes previstos se muestran y los datos de Watch se actualizan sin el error informado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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:
- Lenguaje dominante
- Swift
- Estrellas
- 49
- Forks
- 11
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ionic-team/CapacitorWatch
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
ionic-team/CapacitorWatch#45 ·
-
Capacitor 8Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
ionic-team/CapacitorWatch#46 ·
-
Not Supporting for Capacitor 6Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
ionic-team/CapacitorWatch#41 · 2 comentarios ·
-
Error while updating the DataAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
ionic-team/CapacitorWatch#40 · 2 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
ionic-team/CapacitorWatch#39 ·
Todos los issues de ionic-team/CapacitorWatch
Issues similares
-
builtin-port enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
cmlarsen/writemorebetter#235 ·
Los mantenedores suelen responder en 1 día
-
bug-pending-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
NativeScript/NativeScript#11525 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
callstack/agent-device#3627 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día