Skip to content

Commit

Permalink
iOS - update
Browse files Browse the repository at this point in the history
1.更新 iOS SDK 2.2.4
2.添加 免打扰相关功能、API - 获取全部未读数
3.调整文件、代码结构
  • Loading branch information
pikacode committed Jan 4, 2017
1 parent 0b7de9f commit 833a349
Show file tree
Hide file tree
Showing 27 changed files with 1,332 additions and 580 deletions.
173 changes: 170 additions & 3 deletions doc/iOS_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ API 统一说明:
- [群组操作](#group)
- [跨应用接口](#cross-app-method)
- [好友管理](#friendmanager)
- [免打扰](#disturb)
- [监听事件](#documentevent)


Expand Down Expand Up @@ -78,7 +79,7 @@ API 统一说明:
#### 参数说明
- field:数字、或纯数字字符串

/// 用户信息字段: 用户名
/// 用户信息字段: 用户名
kJMSGUserFieldsNickname = 0,
/// 用户信息字段: 生日
kJMSGUserFieldsBirthday = 1,
Expand Down Expand Up @@ -189,8 +190,18 @@ window.JMessage.updateFriendNoteText(username, appKey, noteText, successCallback
获取全部单聊、群里会话信息
#### 接口定义
window.JMessage.getAllConversation(successCallback, errorCallback);
### API - getAllUnreadCount

获取当前所有会话的未读消息的总数

#### 接口定义

```
window.JMessage.getAllUnreadCount(successCallback, errorCallback);
```

### API - clearSingleUnreadCount

清除单聊会话未读数
#### 接口定义
window.JMessage.clearSingleUnreadCount(username, successCallback, errorCallback);
Expand Down Expand Up @@ -346,6 +357,8 @@ window.JMessage.sendLocationMessage(name, appKey, single, latitude, longitude, s





### API - sendInvitationRequest

发送添加好友请求
Expand Down Expand Up @@ -392,6 +405,150 @@ window.JMessage.declineInvitation(username, appkey, reason, successCallback, err
window.JMessage.removeFromFriendList(username, appkey, successCallback, errorCallback);
```



## Disturb

注:用户&群组的免打扰状态、群主 appkey、群最大成员数量在 API - getUserInfo/getGroupInfo 获取。



### API - noDisturbList

用户免打扰列表 设置全局免打扰标识

#### 接口定义

```
window.JMessage.getNoDisturblist(successCallback, errorCallback);
```



### API - isSetGlobalNoDisturb

获取全局免打扰状态

#### 接口定义

```
window.JMessage.getNoDisturbGlobal(successCallback, errorCallback);
```



### API - setIsGlobalNoDisturb

设置是否全局免打扰

#### 接口定义

```
window.JMessage.setNoDisturbGlobal(isGlobalNoDisturb, successCallback, errorCallback);
```

#### 参数说明

isGlobalNoDisturb:1 是/0 否



### API - blackList

获取黑名单列表

#### 接口定义

```
window.JMessage.getBlacklist(successCallback, errorCallback);
```



### API - userSetIsNoDisturb

设置用户免打扰(支持跨应用设置)

#### 接口定义

```
window.JMessage.setUserNoDisturb(username, appkey, isNoDisturb, successCallback, errorCallback);
```



### API - isInBlacklist

获取黑名单状态

#### 接口定义

```
window.JMessage.isInBlacklist(username, appkey, successCallback, errorCallback);
```



### API - addUsersToBlacklist

添加黑名单

#### 接口定义

```
window.JMessage.addUsersToBlacklist_ios(usernamesArray, successCallback, errorCallback);
```



### API - delUsersFromBlacklist

删除黑名单

#### 接口定义

```
window.JMessage.delUsersFromBlacklist_ios(usernamesArray, successCallback, errorCallback);
```



### API - cross_addUsersToBlacklist

跨应用添加黑名单

#### 接口定义

```
window.JMessage.cross_addUsersToBlacklist(usernamesArray, appkey, successCallback, errorCallback);
```



### API - cross_delUsersFromBlacklist

跨应用删除黑名单

#### 接口定义

```
window.JMessage.cross_delUsersFromBlacklist(usernamesArray, appkey, successCallback, errorCallback);
```



### API - groupSetIsNoDisturb

设置群组消息免打扰

#### 接口定义

```
window.JMessage.groupSetIsNoDisturb(groupId, isNoDisturb, successCallback, errorCallback);
```



## DocumentEvent

##### jmessage.onConversationChanged
Expand Down Expand Up @@ -463,7 +620,15 @@ kJMSGEventNotificationServerAlterPassword = 2,

kJMSGEventNotificationUserLoginStatusUnexpected = 70,




/// 事件类型:当前登录用户信息变更通知事件(非客户端修改)

kJMSGEventNotificationCurrentUserInfoChange = 40,




// 免打扰事件

/// 事件类型: 免打扰变更
Expand All @@ -475,6 +640,8 @@ kJMSGEventNotificationNoDisturbChange = 37,
kJMSGEventNotificationBlacklistChange = 38,




// 好友相关事件

/// 事件类型: 好友邀请相关
Expand Down Expand Up @@ -521,4 +688,4 @@ kJMSGEventNotificationRemoveGroupMembers = 11,

/// 事件类型: 群信息更新

kJMSGEventNotificationUpdateGroupInfo = 12
kJMSGEventNotificationUpdateGroupInfo = 12
10 changes: 6 additions & 4 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@
</feature>
</config-file>

<hook type="after_plugin_install" src="script/ios-install.js" />
<hook type="before_plugin_uninstall" src="script/ios-uninstall.js" />
<!-- <hook type="after_plugin_install" src="script/ios-install.js" />-->
<!-- <hook type="before_plugin_uninstall" src="script/ios-uninstall.js" />-->

<header-file src="src/ios/Plugins/JPushDefine.h"/>
<header-file src="src/ios/Plugins/JMessageDefine.h"/>
<header-file src="src/ios/Plugins/JMessagePlugin.h"/>
<source-file src="src/ios/Plugins/JMessagePlugin.m"/>
<header-file src="src/ios/Plugins/JMessageHelper.h"/>
<header-file src="src/ios/Plugins/ConstantDef.h"/>
<source-file src="src/ios/Plugins/JMessageHelper.m"/>


<resource-file src="src/ios/JMessageConfig.plist" />

<framework src="src/ios/lib/JMessage.framework" custom="true" />
Expand All @@ -61,7 +63,7 @@
<framework src="libz.tbd"/>
<framework src="libsqlite3.0.tbd"/>
<framework src="libresolv.tbd"/>
<config-file target="*JMessageConfig.plist" parent="APP_KEY">
<config-file target="*JMessageConfig.plist" parent="Appkey">
<string>$APP_KEY</string>
</config-file>
</platform>
Expand Down
16 changes: 10 additions & 6 deletions src/ios/JMessageConfig.plist
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>APP_KEY</key>
<string></string>
<key>CHANNEL</key>
<string>Subscription</string>
</dict>
<dict>
<key>Appkey</key>
<string></string>
<key>Channel</key>
<string>Subscription</string>
<key>IsProduction</key>
<false/>
<key>Delay</key>
<false/>
</dict>
</plist>
17 changes: 17 additions & 0 deletions src/ios/Plugins/AppDelegate+JMessage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// AppDelegate+JPush.h
// delegateExtention
//
// Created by 张庆贺 on 15/8/3.
// Copyright (c) 2015年 JPush. All rights reserved.
//

#import "AppDelegate.h"
#import <UserNotifications/UserNotifications.h>
#import <JMessage/JMessage.h>

@interface AppDelegate (JMessage) <JPUSHRegisterDelegate>
-(void)registerForRemoteNotification;
-(void)startJPushSDK;
-(void)startJMessageSDK;
@end
Loading

0 comments on commit 833a349

Please sign in to comment.