You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/11/08 02:12:20 UTC

[GitHub] songxing10000 commented on issue #1696: weex页面在客户端上的刷新问题

songxing10000 commented on issue #1696: weex页面在客户端上的刷新问题
URL: https://github.com/apache/incubator-weex/issues/1696#issuecomment-436848327
 
 
   目前解决的笨办法,在开发阶段,还是大大提升了效率。
   ```objc
   NSString *ip = @"172.16.69.154";
       NSString *port = @"8081";
       NSURL *socketURL = [NSURL URLWithString:[NSString stringWithFormat:@"ws://%@:%@/sockjs-node/websocket", ip, port]];
       self.hotReloadSocket = [[SRWebSocket alloc] initWithURL:socketURL protocols:@[@"echo-protocol"]];
       self.hotReloadSocket.delegate = self;
       [self.hotReloadSocket open];
   ```
   ```objc
   - (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message
   {
       /// 这里暂时用的type hash来区分
       if([message hasPrefix:@"{\"type\":\"hash\""]) {
           [self refreshWeex];
       }
   }
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services