WCSessionオブジェクトを使用して時計アプリ(watchOS 3.3 beta 4)から対応するiOSアプリにデータをsendMessage(_:replyHandler:errorHandler:)
経由で送信しています。 documentation from Appleによると:いつWCSession sendMessageがiOSアプリをバックグラウンドで起動できないのですか?
Calling this method from your WatchKit extension while it is active and running wakes up the corresponding iOS app in the background and makes it reachable.
しかし、私はWCSession
オブジェクトのisReachable
プロパティがsendMessage
を呼び出す前にfalse
であれば、メッセージがこのエラーで送信できなかったことを見つける: Error Domain=WCErrorDomain Code=7007 "WatchConnectivity session on paired device is not reachable." UserInfo={NSLocalizedDescription=WatchConnectivity session on paired device is not reachable.}
セッションがアクティブになります私はこのsendMessage
コールがiOSアプリを到達可能にしてから送信することになっていると信じていますが、これは起こっていません。
これはどのような状況で起こりますか?回避策はありますか?
どのようにテストしていますか?これは端末に搭載されていて、携帯電話と時計は現在Bluetoothと接続されていますか? – Cobra
はい、これは電話機とBluetooth接続しているデバイス上にあります。通常、電話機は到達可能になりますが、時間の10%未満で失敗します。 –