Ejemplo n.º 1
0
 /// <summary>
 /// Called when a message is received and the peer needs a response.
 /// </summary>
 public override void DidReceiveMessage(WCSession session, NSDictionary <NSString, NSObject> message, WCSessionReplyHandler replyHandler)
 {
     this.DidReceiveMessage(session, message);
     replyHandler(message); // Echo back the time stamp.
 }
Ejemplo n.º 2
0
        public void DidReceiveMessage(WCSession session, NSDictionary <NSString, NSObject> message, WCSessionReplyHandler replyHandler)
        {
            var writer = new BarcodeWriter <UIImage>
            {
                Format  = BarcodeFormat.QR_CODE,
                Options = new EncodingOptions
                {
                    Height = 200,
                    Width  = 200,
                    Margin = 0
                },
                Renderer = new BarcodeRenderer()
            };

            var qrCodeUrl = new NSObject();

            message.TryGetValue(new NSString("qrCode"), out qrCodeUrl);

            var img = writer.Write(qrCodeUrl.ToString());

            myImage.SetImage(img);
            myImage.SetRelativeWidth(0.98f, 0);
            myImage.SetRelativeHeight(0.98f, 0);

            var asdf = WKExtension.SharedExtension.Delegate as ExtensionDelegate;

            HealthStore.EndWorkoutSession(asdf.WorkoutSession);
        }