Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

请求支持cordova6,目前ios无法编译通过 #8

Open
justintseng opened this issue Jun 16, 2016 · 5 comments
Open

请求支持cordova6,目前ios无法编译通过 #8

justintseng opened this issue Jun 16, 2016 · 5 comments

Comments

@justintseng
Copy link

请求支持cordova6,目前ios无法编译通过

/Plugins/io.rong.imlib/src/ios/RongCloudLibPlugin.m:22:19: error: no visible @interface for 'CDVPlugin' declares the selector 'initWithWebView:' self = [super initWithWebView:theWebView];

@truebug
Copy link

truebug commented Jun 18, 2016

replace old block with lines below:

  • (void)pluginInitialize {
    self.appEventReceiver = [[RongCloudAppEventReceiver alloc] init];
    }

@zyf0330
Copy link

zyf0330 commented Jul 22, 2016

具体怎么替换呢?完全不了解ios代码

@truebug
Copy link

truebug commented Jul 22, 2016

我已经改用极光的jmessage了,融云最新的代码不晓得更新没有,之前使用时的代码是在安装好插件后替换这里(我在ionic 1.3下):
找到platforms/ios/src/[你的项目名称]/下的RongCloudLibPlugin.m
找到这几行

  • (instancetype)initWithWebView:(UIWebView*)theWebView {

self = [super initWithWebView:theWebView];
if (self) {
self.appEventReceiver = [[RongCloudAppEventReceiver alloc] init];
}
return self;
}

替换为这几行(其实就是加了个宏判定当cordova>=4.0时换个呼叫方法)
+#ifdef __CORDOVA_4_0_0
+- (void)pluginInitialize {

  • //[self initNotifications];
  • self.appEventReceiver = [[RongCloudAppEventReceiver alloc] init];
    +}
    +#else
    +- (CDVPlugin_)initWithWebView:(UIWebView_)theWebView{
  • if (self=[super initWithWebView:theWebView]) {
  • self.appEventReceiver = [[RongCloudAppEventReceiver alloc] init];
  • }
  • return self;
    +}
    +#endif

2016-07-22 11:53 GMT+08:00 追随 [email protected]:

具体怎么替换呢?完全不了解ios代码


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADNkKvDcRp6TYia3qPACYOTumAUGAvqIks5qYD69gaJpZM4I3a8p
.

Best Regards,
Bug

@zyf0330
Copy link

zyf0330 commented Jul 25, 2016

多谢,原来是这样。希望插件能尽快更新。

@h2oiswater
Copy link

@truebug perfect solution !!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants