Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

channel doesn't have 'subscribe' interface anymore? #621

Closed
thomasyuan opened this issue Jul 21, 2017 · 2 comments
Closed

channel doesn't have 'subscribe' interface anymore? #621

thomasyuan opened this issue Jul 21, 2017 · 2 comments

Comments

@thomasyuan
Copy link

Pod version 1.04.

This is what I have in ARTChannel.h

//
//  ARTChannel.h
//  ably
//
//  Created by Yavor Georgiev on 20.08.15.
//  Copyright (c) 2015 г. Ably. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ARTTypes.h"
#import "ARTDataEncoder.h"
#import "ARTLog.h"

@class ARTChannelOptions;
@class ARTMessage;
@class __GENERIC(ARTPaginatedResult, ItemType);
@class ARTDataQuery;

ART_ASSUME_NONNULL_BEGIN

@interface ARTChannel : NSObject

@property (nonatomic, strong, readonly) NSString *name;

- (instancetype)initWithName:(NSString *)name andOptions:(ARTChannelOptions *)options andLogger:(ARTLog *)logger;

- (void)publish:(art_nullable NSString *)name data:(art_nullable id)data;
- (void)publish:(art_nullable NSString *)name data:(art_nullable id)data callback:(art_nullable void (^)(ARTErrorInfo *__art_nullable error))callback;

- (void)publish:(art_nullable NSString *)name data:(art_nullable id)data clientId:(NSString *)clientId;
- (void)publish:(art_nullable NSString *)name data:(art_nullable id)data clientId:(NSString *)clientId callback:(art_nullable void (^)(ARTErrorInfo *__art_nullable error))callback;

- (void)publish:(__GENERIC(NSArray, ARTMessage *) *)messages;
- (void)publish:(__GENERIC(NSArray, ARTMessage *) *)messages callback:(art_nullable void (^)(ARTErrorInfo *__art_nullable error))callback;

- (void)history:(void(^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback;

@end

ART_ASSUME_NONNULL_END

@ricardopereira
Copy link
Contributor

@thomasyuan subscribe is only available in Realtime, see https://github.com/ably/ably-ios/blob/master/Source/ARTRealtimeChannel.h#L34-L37

Are you facing some sort of error?

@thomasyuan
Copy link
Author

Thank @ricardopereira, my mistake.
When I read the document, I focused on swift code. So I defined
var channel: ARTChannel!
Change to
var channel: ARTRealtimeChannel!
fixed it.

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

No branches or pull requests

2 participants