Comments (7)
I've only been using the Xcode 7 beta for trying Swift 2 and iOS 9. (SwiftR is not yet updated for either.) I'm guessing you're targeting iOS 8 in Xcode 7. If so, how? I'm able to install the iOS 8 simulator, but not select it as the base SDK for my targets. If you can help me with that, I can probably help you.
As an aside: do you have any issues in Xcode 6?
from swiftr.
Hi Adam, yup, I'm targetting iOS8 in XCode 7. I'm able to run it on simulator, but I don't get any callbacks on 'on' & 'invoke'.
I've just tried on XCode 6, same thing, no callback.
Btw, how do you get the callback result on 'invoke' ? There's no callback block/closure on the 'invoke' method.
I've also tried the SignalR Obj-C version with XCode6, but the 'on' function doesn't return as well... It stops here: [SERVER_SENT_EVENTS] SSE: GET /signalr/signalr/connect.
from swiftr.
You won't get a callback on invoke
. That method invokes a SignlaR server-side method, which in turn invokes your on
callback. See the SwifR demo application as an example.
// 1. Client: Inovkes SendComplex on SignalR server
complexHub.invoke("sendComplex", arguments: [message])
// 2. Server: Invokes notifyComplex on connected clients
public void SendComplex(ComplexMessage message)
{
Clients.All.notifyComplex (message);
}
// 3. Client: handler method invoked as result of step 2
self?.complexHub.on("notifyComplex") { args in
let m: AnyObject = args!["0"] as AnyObject!
println(m)
}
Normally, you might have many clients listening for notifyComplex
. Think of an example where you have many iOS clients connected to a SignalR server for sync. One of your devices tells SignalR that data needs to be updated. SignalR tells your other iOS (or web, Android, whatever) clients.
In order to help, I'd need to see both your iOS client and SignalR server code. Do you have other clients already working properly with your SignalR server?
from swiftr.
Hi Adam, it's working on 'on' now (XCode6 - Swift). Is there a connection id like the javascript or Android version ?
from swiftr.
Cool. No, there is no way to access the connection ID right now, just because I haven't needed it in my own use. I can add it though if it'll help you.
from swiftr.
Hi Adam, oh I see. Nvm, I can get it from the server instead. Thx !
from swiftr.
You're welcome! FYI, I did make a change to provide the connection ID anyway in commit d561fdd. The demo application shows how to get it.
from swiftr.
Related Issues (20)
- Ignore SSL on SignalR HOT 3
- "There was an error invoking Hub" Swift 4 HOT 5
- My signalR connection is established but can not invoke the hub function.
- hub.invoke(...) Won't handle any response.
- SignalR 1.0.0-preview2-final in .NET core?
- SwiftR 0.14.0 is not connecting with server using Xcode 9.3, Swift 4.1 and iOS 11.3 HOT 3
- dyld: Library not loaded: @rpath/SwiftR.framework/SwiftR
- Spelling issue
- Hub.on is not getting called after establishing connection HOT 1
- How to remove registed hub in hubs
- How can i upgrade from v2.2 to v2.4?
- Close a persistent connection
- loging connection information
- How to remove event from chathub?
- Xcode 10 can't run in swift 4 HOT 5
- Mac Catalyst support! HOT 3
- UIWebView deprecated from iOS 13 HOT 1
- UIWebView deprecated HOT 9
- not supporting latest iOS . please make it compatible for swift 5 and iOS 15.
- Solved UIWebView deprecated and Swift 5 compatibility
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 swiftr.