Comments (9)
I would like to add it to watch too.
from qrcode.
Should be possible, I'll try to add that alongside swift 2.3 and 3.0 support in the near future.
from qrcode.
he only way to show the clock qr is sending them from iPhone to watch
from qrcode.
i send a rendered png of the QR from my iphone app to the watch in a current project.
from qrcode.
I'm trying to do with WatchConnectivity but I find the error
Domain Error Code = 7014 = WCErrorDomain "Could not be delivered Payload." UserInfo = {NSLocalizedDescription = Payload Could not be delivered.}
This is the side of the watch
session.sendMessage ([ "reference" self.qr_data], replyHandler: {(response) -> Void in if let imageQR = response [ "imageQR"] he? NSData, let boardingPass = UIImage (data: imageQR as Data) { self.imagenPass = boardingPass DispatchQueue.main.async (execute: {() -> Void in self.showBoardingPass () }) }}, ErrorHandler: {(error) -> Void in print (error) })
On the side of the phone (AppDelegate.swift)
func session (_ session: WCSession, didReceiveMessage message: [String: Any], replyHandler: @escaping ([String: Any]) -> void) { if let reference = message [ "reference"] he? String, let boardingPass = QRCode (reference) { replyHandler ([ "imageQR" boardingPass.PNGData as AnyObject]) } }
I am with watchOS3 and iOS10 in previous versions these methods functioned. I don´t know if be a problem of simulator. Any help would be greatly appreciated.
A greeting.
from qrcode.
i send the QR like this:
func createImageForWatch(_ qr_string: String) {
if WCSession.isSupported() {
WCSession.default().delegate = self
WCSession.default().activate()
} else {
return
}
if var qrCodeObject = QRCode(qr_string) {
qrCodeObject.size = CGSize(width: 135, height: 135)
qrCodeObject.color = CIColor(color: UIColor.black)
qrCodeObject.backgroundColor = CIColor(color: UIColor.white)
let qrImg = qrCodeObject.image!
let data = UIImageJPEGRepresentation(qrImg!, 1.0)
let userInfo: [String: Any] = [
"QR" : data!
]
WCSession.default().transferUserInfo([
"MyData" : userInfo
])
}
}
from qrcode.
@diolce i think the problem could be that, now you need to have all the delegate methods in the session delegate.
in my case in the viewController that creates the image i have this as that is my delegate.
//MARK: WatchConnectivity Session Delegate
func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
print("activationDidCompleteWith")
}
func sessionDidBecomeInactive(_ session: WCSession) {
print("sessionDidBecomeInactive")
}
func sessionDidDeactivate(_ session: WCSession) {
print("sessionDidDeactivate")
}
from qrcode.
Hey @antonioreyna
can you tell me why it is 135 instead of 136? Apple Watch 38 size is 272, not 270 so I'd like to know why it's better to use the 135 value.
Thanks
from qrcode.
hello, in my case i added it a table row and i wanted some padding so i used that size 😃
from qrcode.
Related Issues (20)
- Apple tvOS Support HOT 1
- compiler error HOT 1
- Version 1.0 not available on cocoapods HOT 5
- You may want to add this to the README HOT 1
- Crash issue on Xcode8 with swift2.3 HOT 4
- Submit to app Store HOT 3
- Pod is still at version 0.5 HOT 2
- Error correction level HOT 1
- Maximum capacity HOT 5
- Update podspec on CocoaPods registry HOT 1
- Crashes on iOS8 (when build with Xcode 8 / Swift 3) HOT 1
- When setting QRCode's backgroundColor clear. It comes out to be black background. HOT 3
- Logo on the middle ? HOT 2
- Can I use this qr code generator to store images? HOT 1
- swift4 support HOT 5
- CIColorExtension.swift 'characters' is deprecated: Please use String or Substring directly HOT 1
- Swift4.2 Please HOT 2
- Swift 5 update HOT 2
- SwiftPM Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qrcode.