ios即时通讯支持通知栏吗?
iOS的推送是由服务端下发的,直接系统弹出的,所以不支持修改样式
但我们最新的beta版本会提供客户端发消息时定制
推送文案的功能
http://baichuan.taobao.com/doc2/detail.htm?spm=0.0.0.0.D3LiyP&treeId=41&articleId=102828&docType=1
相关接口:
1、监听消息发送的回调
- (void)addMessageLifeDelegate:(id)aDelegate forPriority:(YWBlockPriority)aPriority;
2、在回调里面,根据消息内容,判断是否需要修改推送文案,如果需要修改,则修改controlParameters。详细请查看YWConversationServiceDef.h中的定义
- (YWMessageLifeContext *)messageLifeWillSend:(YWMessageLifeContext *)aContext{ YWMessageLifeContext *resultContext = aContext; NSLog(@'消息生命周期回调,即将发送消息: msgBody:%@ \t convId:%@', aContext.messageBody, aContext.conversation.conversationId); if ([[TestConfigDef sharedInstance] configStateOfKey:kWXOMessageControl]) { /// 开启消息控制 NSString *controlContent = [[TestConfigDef sharedInstance] configContentOfKey:kWXOMessageControl]; NSDictionary *params = nil; NSError *error = nil; @try { params = [NSJSONSerialization JSONObjectWithData:[controlContent dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&error]; } @catch (NSException *exception) { NSLog(@'消息控制:json解析失败: %@', error); } if ([params isKindOfClass:[NSDictionary class]] && params.count > 0) { NSLog(@'消息控制: %@', params); [resultContext setControlParameters:params]; } } return resultContext;}
赞0
踩0